llvm.org GIT mirror llvm / b908f8a
Make opt default to not adding a target data string and update tests that depend on target data to supply it within the test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85900 91177308-0d34-0410-b5e6-96231b3b80d8 Kenneth Uildriks 9 years ago
59 changed file(s) with 60 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -aa-eval -disable-output |& grep {2 no alias respon}
11 ; TEST that A[1][0] may alias A[0][i].
2 target datalayout = "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"
23
34 define void @test(i32 %N) {
45 entry:
0 ; RUN: opt -gvn -instcombine -S < %s | FileCheck %s
1 target datalayout = "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"
12
23 declare i8 @llvm.atomic.load.add.i8.p0i8(i8*, i8)
34
11 ; determine, as noted in the comments.
22
33 ; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | not grep REMOVE
4 target datalayout = "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"
45
56 @Global = external global { i32 }
67
11 ; the global.
22
33 ; RUN: opt < %s -basicaa -gvn -instcombine -S | not grep load
4 target datalayout = "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"
45
56 @B = global i16 8 ; [#uses=2]
67
0 ; RUN: opt < %s -basicaa -gvn -dse -S | FileCheck %s
1 target datalayout = "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"
12
23 declare void @llvm.memset.i32(i8*, i8, i32, i32)
34 declare void @llvm.memset.i8(i8*, i8, i8, i32)
8788 call void @llvm.lifetime.end(i64 10, i8* %P)
8889 ret void
8990 ; CHECK: ret void
90 }
91 }
22 ; two pointers, then the load should be hoisted, and the store sunk.
33
44 ; RUN: opt < %s -basicaa -licm -S | FileCheck %s
5 target datalayout = "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"
56
67 @A = global i32 7 ; [#uses=3]
78 @B = global i32 8 ; [#uses=2]
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep {count is 2}
11 ; PR3171
2 target datalayout = "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"
23
34 %struct.Foo = type { i32 }
45 %struct.NonPod = type { [2 x %struct.Foo] }
22
33 ; This checks that various insert/extract idiom work without going to the
44 ; stack.
5 target datalayout = "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:32:32"
56
67 define void @test(<4 x float>* %F, float %f) {
78 entry:
0 ; RUN: opt < %s -argpromotion -instcombine -S | not grep load
1 target datalayout = "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"
12
23 %QuadTy = type { i32, i32, i32, i32 }
34 @G = constant %QuadTy {
0 ; RUN: opt < %s -argpromotion -mem2reg -S | not grep alloca
1 target datalayout = "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"
12 define internal i32 @test(i32* %X, i32* %Y) {
23 %A = load i32* %X ; [#uses=1]
34 %B = load i32* %Y ; [#uses=1]
0 ; RUN: opt < %s -argpromotion -scalarrepl -S | not grep load
1 target datalayout = "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"
12 ; Argpromote + scalarrepl should change this to passing the two integers by value.
23
34 %struct.ss = type { i32, i64 }
0 ; RUN: opt < %s -argpromotion -instcombine -S | not grep load
1 target datalayout = "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"
12
23 @G1 = constant i32 0 ; [#uses=1]
34 @G2 = constant i32* @G1 ; [#uses=1]
0 ; RUN: opt < %s -argpromotion -S | \
11 ; RUN: grep {load i32\\* %A}
2 target datalayout = "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"
23
34 define internal i32 @callee(i1 %C, i32* %P) {
45 br i1 %C, label %T, label %F
0 ; RUN: opt < %s -dse -S | not grep tmp5
11 ; PR2599
2 target datalayout = "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"
23
34 define void @foo({ i32, i32 }* %x) nounwind {
45 entry:
11 ; RUN: not grep {store i8}
22 ; Ensure that the dead store is deleted in this case. It is wholely
33 ; overwritten by the second store.
4 target datalayout = "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"
45 define i32 @test() {
56 %V = alloca i32 ; [#uses=3]
67 %V2 = bitcast i32* %V to i8* ; [#uses=1]
0 ; RUN: opt < %s -dse -S | not grep DEAD
1 target datalayout = "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"
12
23 declare void @ext()
34
0 ; RUN: opt < %s -dse -S | not grep DEAD
1 target datalayout = "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"
12
23 define void @test(i32* %Q, i32* %P) {
34 %DEAD = load i32* %Q ; [#uses=1]
0 ; In this case, the global can only be broken up by one level.
11
22 ; RUN: opt < %s -globalopt -S | not grep 12345
3 target datalayout = "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"
34
45 @G = internal global { i32, [4 x float] } zeroinitializer ; <{ i32, [4 x float] }*> [#uses=3]
56
0 ; RUN: opt < %s -globalopt -S | not grep global
1 target datalayout = "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"
12
23 @G = internal global { i32, float, { double } } {
34 i32 1,
0 ; RUN: opt < %s -globalopt -S | not grep global
1 target datalayout = "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"
12
23 @G = internal global i32* null ; [#uses=3]
34
11 ; RUN: not grep inttoptr %t
22 ; RUN: not grep ptrtoint %t
33 ; RUN: grep scevgep %t
4 target datalayout = "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"
45
56 ; Indvars shouldn't need inttoptr/ptrtoint to expand an address here.
67
0 ; RUN: opt < %s -indvars -S \
11 ; RUN: | grep {\[%\]p.2.ip.1 = getelementptr \\\[3 x \\\[3 x double\\\]\\\]\\* \[%\]p, i64 2, i64 \[%\]tmp, i64 1}
2 target datalayout = "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"
23
34 ; Indvars shouldn't expand this to
45 ; %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19
0 ; RUN: opt < %s -inline -scalarrepl -S | FileCheck %s
1 target datalayout = "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"
12
23 define i32 @test1f(i32 %i) {
34 ret i32 %i
0 ; RUN: opt < %s -instcombine -S | FileCheck %s
1 target datalayout = "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"
12
23 declare void @free(i8*)
34
0 ; RUN: opt < %s -instcombine -S | not grep call
11 ; RUN: opt < %s -std-compile-opts -S | not grep xyz
2 target datalayout = "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"
23
34 @.str = internal constant [4 x i8] c"xyz\00" ; <[4 x i8]*> [#uses=1]
45
0 ; RUN: opt < %s -instcombine -S | grep {align 16} | count 1
1 target datalayout = "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"
12
23 ; A multi-dimensional array in a nested loop doing vector stores that
34 ; aren't yet aligned. Instcombine can understand the addressing in the
0 ; RUN: opt < %s -instcombine -S | grep {align 16} | count 1
1 target datalayout = "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"
12
23 ; Instcombine should be able to prove vector alignment in the
34 ; presence of a few mild address computation tricks.
0 ; RUN: opt < %s -instcombine -S | grep {GLOBAL.*align 16}
11 ; RUN: opt < %s -instcombine -S | grep {tmp = load}
2 target datalayout = "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"
23
34 @GLOBAL = internal global [4 x i32] zeroinitializer
45
0 ; Zero byte allocas should be deleted.
1 target datalayout = "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"
12
23 ; RUN: opt < %s -instcombine -S | \
34 ; RUN: not grep alloca
0 ; Ignore stderr, we expect warnings there
11 ; RUN: opt < %s -instcombine 2> /dev/null -S | FileCheck %s
22
3 target datalayout = "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"
34
45 ; Simple case, argument translatable without changing the value
56 declare void @test1a(i8*)
0 ; RUN: opt < %s -instcombine -globaldce -S | \
11 ; RUN: not grep Array
2 target datalayout = "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"
23
34 ; Pulling the cast out of the load allows us to eliminate the load, and then
45 ; the whole array.
0 ; Tests to make sure elimination of casts is working correctly
11 ; RUN: opt < %s -instcombine -S | FileCheck %s
2 target datalayout = "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"
23
34 @inbuf = external global [32832 x i8] ; <[32832 x i8]*> [#uses=1]
45
0 ; Tests to make sure elimination of casts is working correctly
11 ; RUN: opt < %s -instcombine -S | FileCheck %s
2 target datalayout = "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"
23
34 define i16 @test1(i16 %a) {
45 %tmp = zext i16 %a to i32 ; [#uses=2]
0 ; RUN: opt < %s -instcombine -S | FileCheck %s
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12
23 ; Constant folding should fix notionally out-of-bounds indices
34 ; and add inbounds keywords.
0 ; RUN: opt < %s -instcombine -S | not grep icmp
1 target datalayout = "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"
12
23 define i1 @f(i1 %x) {
34 %b = and i1 %x, icmp eq (i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 2 to i8*))
0 ; RUN: opt < %s -instcombine -S | \
11 ; RUN: grep {call float bitcast} | count 1
2 target datalayout = "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"
23 %struct.NSObject = type { %struct.objc_class* }
34 %struct.NSArray = type { %struct.NSObject }
45 %struct.objc_class = type opaque
0 ; RUN: opt < %s -instcombine -S | grep {, align 16} | count 14
1 target datalayout = "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"
12
23 @x = external global <2 x i64>, align 16
34 @xx = external global [13 x <2 x i64>], align 16
0 ; RUN: opt < %s -instcombine -S > %t
1 target datalayout = "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"
12
23 define i1 @test1(i32 *%x) nounwind {
34 entry:
0 ; RUN: opt < %s -memcpyopt -S | not grep {call.*memcpy.}
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12 %a = type { i32 }
23 %b = type { float }
34
0 ; RUN: opt < %s -S -memcpyopt | FileCheck %s
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12
23 ; The resulting memset is only 4-byte aligned, despite containing
34 ; a 16-byte alignmed store in the middle.
0 ; RUN: opt < %s -scalarrepl -instcombine -S | not grep alloca
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12
23 ; Test that an array is not incorrectly deconstructed.
34
0 ; RUN: opt < %s -scalarrepl -S | not grep alloca
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12
23 define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind {
34 %vsiidx = alloca [2 x <4 x i32>], align 16 ; <[2 x <4 x i32>]*> [#uses=3]
33 ; values. This checks of scalarrepl splits up the struct and array properly.
44
55 ; RUN: opt < %s -scalarrepl -S | not grep alloca
6 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
67
78 define i32 @foo() {
89 %target = alloca { i32, i32 } ; <{ i32, i32 }*> [#uses=1]
44
55 ; RUN: opt < %s -scalarrepl -S > %t
66 ; RUN: cat %t | not grep alloca
7 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
78
89 %struct.two = type <{ < 2 x i8 >, i16 }>
910
11 ; is only known to access it with 1-byte alignment.
22 ; RUN: opt < %s -scalarrepl -S | grep {store i16 1, .*, align 1}
33 ; PR3720
4 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
45
56 %struct.st = type { i16 }
67
22 ; depending on the endianness of the target...
33 ; RUN: opt < %s -scalarrepl -S | \
44 ; RUN: not grep alloca
5 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
56
67 define i32 @testfunc(i32 %i, i8 %j) {
78 %I = alloca i32 ; [#uses=3]
0 ; RUN: opt < %s -scalarrepl -mem2reg -S | not grep alloca
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12
23 define i32 @test() {
34 %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1]
0 ; RUN: opt < %s -scalarrepl -mem2reg -S | not grep alloca
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12
23 define i32 @test() {
34 %X = alloca { i32, float } ; <{ i32, float }*> [#uses=1]
0 ; RUN: opt < %s -scalarrepl -S | not grep alloca
11 ; rdar://6532315
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
23 %t = type { { i32, i16, i8, i8 } }
34
45 define i8 @foo(i64 %A) {
0 ; RUN: opt < %s -scalarrepl -S | not grep alloca
11 ; PR3290
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
23
34 ;; Store of integer to whole alloca struct.
45 define i32 @test1(i64 %V) nounwind {
0 ; RUN: opt < %s -scalarrepl -S | not grep alloca
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12 %llvm.dbg.anchor.type = type { i32, i32 }
23 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
34 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* }
0 ; This testcase shows that scalarrepl is able to replace struct alloca's which
11 ; are directly loaded from or stored to (using the first class aggregates
22 ; feature).
3 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
34
45 ; RUN: opt < %s -scalarrepl -S > %t
56 ; RUN: cat %t | not grep alloca
0 ; RUN: opt < %s -scalarrepl -S | not grep {call.*memcpy}
1 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
12 @C.0.1248 = internal constant [128 x float] [ float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 ], align 32 ; <[128 x float]*> [#uses=1]
23
34 define float @grad4(i32 %hash, float %x, float %y, float %z, float %w) {
0 ; RUN: opt < %s -scalarrepl -S | not grep alloca
11 ; RUN: opt < %s -scalarrepl -S | not grep {7 x double}
22 ; RUN: opt < %s -scalarrepl -instcombine -S | grep {ret double %B}
3 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
34
45 define double @test(double %A, double %B) {
56 %ARR = alloca [7 x i64]
11 ; RUN: not grep alloca
22 ; RUN: opt < %s -scalarrepl -S | \
33 ; RUN: grep {bitcast.*float.*i32}
4 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
45
56 define i32 @test(float %X) {
67 %X_addr = alloca float ; [#uses=2]
11 ; RUN: not grep alloca
22 ; RUN: opt < %s -scalarrepl -S | \
33 ; RUN: grep bitcast
4 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
45
56 define <4 x i32> @test(<4 x float> %X) {
67 %X_addr = alloca <4 x float> ; <<4 x float>*> [#uses=2]
0 ; RUN: opt < %s -scalarrepl -S > %t
11 ; RUN: grep {ret <16 x float> %A} %t
22 ; RUN: grep {ret <16 x float> zeroinitializer} %t
3 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
34
45 define <16 x float> @foo(<16 x float> %A) nounwind {
56 %tmp = alloca <16 x float>, align 16
0 ; RUN: opt < %s -scalarrepl -S | not grep alloca
11 ; RUN: opt < %s -scalarrepl -S | grep {load <4 x float>}
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
23
34 define void @test(<4 x float>* %F, float %f) {
45 entry:
131131 cl::desc("data layout string to use if not specified by module"),
132132 cl::value_desc("layout-string"), cl::init(""));
133133
134 static cl::opt
135 NoDefaultDataLayout("no-default-data-layout",
136 cl::desc("no data layout assumptions unless module specifies data layout"));
137
138134 // ---------- Define Printers for module and function passes ------------
139135 namespace {
140136
400396 const std::string &ModuleDataLayout = M.get()->getDataLayout();
401397 if (!ModuleDataLayout.empty())
402398 TD = new TargetData(ModuleDataLayout);
403 else if (!NoDefaultDataLayout)
399 else if (!DefaultDataLayout.empty())
404400 TD = new TargetData(DefaultDataLayout);
405401
406402 if (TD)