llvm.org GIT mirror llvm / 4f50278
opt: Rename -default-data-layout flag to -data-layout and make it always override the layout. There isn't much point in a flag that only works if the data layout is empty. Differential Revision: https://reviews.llvm.org/D30014 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295468 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 2 years ago
13 changed file(s) with 27 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -asan -asan-module -S \
11 ; RUN: -mtriple=i386-unknown-freebsd \
2 ; RUN: -default-data-layout="e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" | \
2 ; RUN: -data-layout="e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" | \
33 ; RUN: FileCheck --check-prefix=CHECK-32 %s
44
55 ; RUN: opt < %s -asan -asan-module -S \
66 ; RUN: -mtriple=x86_64-unknown-freebsd \
7 ; RUN: -default-data-layout="e-m:e-i64:64-f80:128-n8:16:32:64-S128" | \
7 ; RUN: -data-layout="e-m:e-i64:64-f80:128-n8:16:32:64-S128" | \
88 ; RUN: FileCheck --check-prefix=CHECK-64 %s
99
1010 define i32 @read_4_bytes(i32* %a) sanitize_address {
77
88 ; "TO" - Optimizations and targetdata. This tests target-dependent
99 ; folding in the optimizers.
10 ; RUN: opt -S -o - -instcombine -globalopt -default-data-layout="e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" < %s | FileCheck --check-prefix=TO %s
10 ; RUN: opt -S -o - -instcombine -globalopt -data-layout="e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" < %s | FileCheck --check-prefix=TO %s
1111
1212 ; "SCEV" - ScalarEvolution with default target layout
1313 ; RUN: opt -analyze -scalar-evolution < %s | FileCheck --check-prefix=SCEV %s
None ; RUN: opt < %s -default-data-layout="e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" -instcombine -S | FileCheck %s --check-prefix=LE
1 ; RUN: opt < %s -default-data-layout="E-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" -instcombine -S | FileCheck %s --check-prefix=BE
0 ; RUN: opt < %s -data-layout="e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" -instcombine -S | FileCheck %s --check-prefix=LE
1 ; RUN: opt < %s -data-layout="E-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64" -instcombine -S | FileCheck %s --check-prefix=BE
22
33 ; {{ 0xDEADBEEF, 0xBA }, 0xCAFEBABE}
44 @g1 = constant {{i32,i8},i32} {{i32,i8} { i32 -559038737, i8 186 }, i32 -889275714 }
None ; RUN: opt < %s -default-data-layout="e-p:32:32:32-p1:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -basicaa -gvn -S -die | FileCheck %s
0 ; RUN: opt < %s -data-layout="e-p:32:32:32-p1:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -basicaa -gvn -S -die | FileCheck %s
11
22 define i8 @coerce_offset0_addrspacecast(i32 %V, i32* %P) {
33 store i32 %V, i32* %P
None ; RUN: opt < %s -default-data-layout="e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -basicaa -gvn -S -die | FileCheck %s
1 ; RUN: opt < %s -default-data-layout="E-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-n32" -basicaa -gvn -S -die | FileCheck %s
0 ; RUN: opt < %s -data-layout="e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -basicaa -gvn -S -die | FileCheck %s
1 ; RUN: opt < %s -data-layout="E-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-n32" -basicaa -gvn -S -die | FileCheck %s
22
33 ;; Trivial RLE test.
44 define i32 @test0(i32 %V, i32* %P) {
None ; RUN: opt < %s -indvars -S "-default-data-layout=e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" | FileCheck %s
1 ; RUN: opt < %s -indvars -S "-default-data-layout=e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" | FileCheck %s
0 ; RUN: opt < %s -indvars -S "-data-layout=e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" | FileCheck %s
1 ; RUN: opt < %s -indvars -S "-data-layout=e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" | FileCheck %s
22 ;
33 ; PR11279: Assertion !IVLimit->getType()->isPointerTy()
44 ;
None ; RUN: opt < %s -default-data-layout="e-p:32:32:32" -instcombine -S | FileCheck %s --check-prefix=LE
1 ; RUN: opt < %s -default-data-layout="E-p:32:32:32" -instcombine -S | FileCheck %s --check-prefix=BE
0 ; RUN: opt < %s -data-layout="e-p:32:32:32" -instcombine -S | FileCheck %s --check-prefix=LE
1 ; RUN: opt < %s -data-layout="E-p:32:32:32" -instcombine -S | FileCheck %s --check-prefix=BE
22 ; PR13442
33
44 @test = constant [4 x i32] [i32 1, i32 2, i32 3, i32 4]
None ; RUN: opt < %s -instcombine -S -default-data-layout="E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefix=CHECK -check-prefix=ALL
1 ; RUN: opt < %s -instcombine -S -default-data-layout="E-p:32:32:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefix=P32 -check-prefix=ALL
0 ; RUN: opt < %s -instcombine -S -data-layout="E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefix=CHECK -check-prefix=ALL
1 ; RUN: opt < %s -instcombine -S -data-layout="E-p:32:32:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefix=P32 -check-prefix=ALL
22 ; RUN: opt < %s -instcombine -S | FileCheck %s -check-prefix=NODL -check-prefix=ALL
33
44
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: opt -instcombine -S -default-data-layout="p:32:32:32-p1:16:16:16-n8:16:32:64" < %s | FileCheck %s
1 ; RUN: opt -instcombine -S -data-layout="p:32:32:32-p1:16:16:16-n8:16:32:64" < %s | FileCheck %s
22
33 @G16 = internal constant [10 x i16] [i16 35, i16 82, i16 69, i16 81, i16 85,
44 i16 73, i16 82, i16 69, i16 68, i16 0]
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
11 ; Vary legal integer types in data layout.
2 ; RUN: opt < %s -instcombine -S -default-data-layout=n32 | FileCheck %s --check-prefix=ALL --check-prefix=CHECK32
3 ; RUN: opt < %s -instcombine -S -default-data-layout=n32:64 | FileCheck %s --check-prefix=ALL --check-prefix=CHECK64
2 ; RUN: opt < %s -instcombine -S -data-layout=n32 | FileCheck %s --check-prefix=ALL --check-prefix=CHECK32
3 ; RUN: opt < %s -instcombine -S -data-layout=n32:64 | FileCheck %s --check-prefix=ALL --check-prefix=CHECK64
44
55 ; In all cases, the data-layout is irrelevant. We should shrink as much as possible in InstCombine
66 ; and allow the backend to expand as much as needed to ensure optimal codegen for any target.
0 ; This test makes sure that these instructions are properly constant propagated.
11
2 ; RUN: opt < %s -default-data-layout="e-p:32:32" -sccp -S | FileCheck %s
3 ; RUN: opt < %s -default-data-layout="E-p:32:32" -sccp -S | FileCheck %s
2 ; RUN: opt < %s -data-layout="e-p:32:32" -sccp -S | FileCheck %s
3 ; RUN: opt < %s -data-layout="E-p:32:32" -sccp -S | FileCheck %s
44
55 ; CHECK-NOT: load
66
0 ; RUN: opt -S -simplifycfg < %s | FileCheck %s
1 ; RUN: opt -S -default-data-layout="p:32:32-p1:16:16" -simplifycfg < %s | FileCheck -check-prefix=CHECK -check-prefix=DL %s
1 ; RUN: opt -S -data-layout="p:32:32-p1:16:16" -simplifycfg < %s | FileCheck -check-prefix=CHECK -check-prefix=DL %s
22
33 declare void @foo1()
44
200200 PrintBreakpoints("print-breakpoints-for-testing",
201201 cl::desc("Print select breakpoints location for testing"));
202202
203 static cl::opt
204 DefaultDataLayout("default-data-layout",
205 cl::desc("data layout string to use if not specified by module"),
206 cl::value_desc("layout-string"), cl::init(""));
203 static cl::opt ClDataLayout("data-layout",
204 cl::desc("data layout string to use"),
205 cl::value_desc("layout-string"),
206 cl::init(""));
207207
208208 static cl::opt PreserveBitcodeUseListOrder(
209209 "preserve-bc-uselistorder",
447447 return 1;
448448 }
449449
450 // If we are supposed to override the target triple, do so now.
450 // If we are supposed to override the target triple or data layout, do so now.
451451 if (!TargetTriple.empty())
452452 M->setTargetTriple(Triple::normalize(TargetTriple));
453 if (!ClDataLayout.empty())
454 M->setDataLayout(ClDataLayout);
453455
454456 // Figure out what stream we are supposed to write to...
455457 std::unique_ptr Out;
528530 if (DisableSimplifyLibCalls)
529531 TLII.disableAllFunctions();
530532 Passes.add(new TargetLibraryInfoWrapperPass(TLII));
531
532 // Add an appropriate DataLayout instance for this module.
533 const DataLayout &DL = M->getDataLayout();
534 if (DL.isDefault() && !DefaultDataLayout.empty()) {
535 M->setDataLayout(DefaultDataLayout);
536 }
537533
538534 // Add internal analysis passes from the target machine.
539535 Passes.add(createTargetTransformInfoWrapperPass(TM ? TM->getTargetIRAnalysis()