llvm.org GIT mirror llvm / f2f6ce6
Change tests from "opt %s" to "opt < %s" so that opt doesn't see the input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
1273 changed file(s) with 1366 addition(s) and 1366 deletion(s). Raw diff Collapse all Expand all
None ; RUN: opt %s -anders-aa -disable-output
0 ; RUN: opt < %s -anders-aa -disable-output
11
22 define void @x(i16 %Y) {
33 entry:
None ; RUN: opt %s -anders-aa -gvn -S | not grep undef
0 ; RUN: opt < %s -anders-aa -gvn -S | not grep undef
11 ; PR2160
22
33 declare void @f(i32*)
None ; RUN: opt %s -anders-aa -gvn -S | not grep undef
0 ; RUN: opt < %s -anders-aa -gvn -S | not grep undef
11 ; PR2169
22
33 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
None ; RUN: opt %s -anders-aa
0 ; RUN: opt < %s -anders-aa
11 ; PR3262
22
33 @.str15 = external global [3 x i8] ; <[3 x i8]*> [#uses=1]
None ; RUN: opt %s -anders-aa -aa-eval 2>/dev/null
0 ; RUN: opt < %s -anders-aa -aa-eval 2>/dev/null
11
22 define void @test1() {
33 %X = malloc i32*
None ; RUN: opt %s -anders-aa -gvn -deadargelim -S | grep store | not grep null
0 ; RUN: opt < %s -anders-aa -gvn -deadargelim -S | grep store | not grep null
11
22 ; Because the 'internal' function is passed to an external function, we don't
33 ; know what the incoming values will alias. As such, we cannot do the
None ; RUN: opt %s -anders-aa -gvn -instcombine -S \
0 ; RUN: opt < %s -anders-aa -gvn -instcombine -S \
11 ; RUN: | grep {ret i1 true}
22
33 @G = internal global i32* null
None ; RUN: opt %s -anders-aa -gvn -S \
0 ; RUN: opt < %s -anders-aa -gvn -S \
11 ; RUN: | not grep {ret i32 undef}
22
33 ;; From PR 2160
None ; RUN: opt %s -anders-aa -disable-output
0 ; RUN: opt < %s -anders-aa -disable-output
11
22 define void @foo() { ret void }
11 ; is performed. It is not legal to delete the second load instruction because
22 ; the value computed by the first load instruction is changed by the store.
33
4 ; RUN: opt %s -gvn -instcombine -S | grep DONOTREMOVE
4 ; RUN: opt < %s -gvn -instcombine -S | grep DONOTREMOVE
55
66 define i32 @test() {
77 %A = alloca i32
None ; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null
0 ; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
11 ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
22 define void @test({[2 x i32],[2 x i32]}* %A, i64 %X, i64 %Y) {
33 %P1 = getelementptr {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X
None ; RUN: opt %s -gvn -instcombine -S | grep sub
0 ; RUN: opt < %s -gvn -instcombine -S | grep sub
11
22 ; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
33
None ; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null
0 ; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
11 ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
22 define void @test([17 x i16]* %mask_bits) {
33 %P1 = getelementptr [17 x i16]* %mask_bits, i64 0, i64 0
None ; RUN: opt %s -licm -disable-output
0 ; RUN: opt < %s -licm -disable-output
11 %struct..apr_array_header_t = type { i32*, i32, i32, i32, i8* }
22 %struct..apr_table_t = type { %struct..apr_array_header_t, i32, [32 x i32], [32 x i32] }
33
None ; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null
0 ; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
11
22 define i32 @MTConcat([3 x i32]* %a.1) {
33 %tmp.961 = getelementptr [3 x i32]* %a.1, i64 0, i64 4
None ; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null
0 ; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
11
22 %struct..RefPoint = type { i32, { i32, i8, i8 } }
33 %struct..RefRect = type { %struct..RefPoint, %struct..RefPoint }
0 ; In this test, a local alloca cannot alias an incoming argument.
11
2 ; RUN: opt %s -gvn -instcombine -S | not grep sub
2 ; RUN: opt < %s -gvn -instcombine -S | not grep sub
33
44 define i32 @test(i32* %P) {
55 %X = alloca i32
0 ; This testcase consists of alias relations which should be completely
11 ; resolvable by basicaa.
22
3 ; RUN: opt %s -aa-eval -print-may-aliases -disable-output \
3 ; RUN: opt < %s -aa-eval -print-may-aliases -disable-output \
44 ; RUN: |& not grep May:
55
66 %T = type { i32, [10 x i8] }
0 ; This testcase consists of alias relations which should be completely
11 ; resolvable by basicaa, but require analysis of getelementptr constant exprs.
22
3 ; RUN: opt %s -aa-eval -print-may-aliases -disable-output \
3 ; RUN: opt < %s -aa-eval -print-may-aliases -disable-output \
44 ; RUN: |& not grep May:
55
66 %T = type { i32, [10 x i8] }
None ; RUN: opt %s -dse -S | grep {store i32 0}
0 ; RUN: opt < %s -dse -S | grep {store i32 0}
11
22 define void @test({i32,i32 }* %P) {
33 %Q = getelementptr {i32,i32}* %P, i32 1
None ; RUN: opt %s -licm
0 ; RUN: opt < %s -licm
11
22 %"java/lang/Object" = type { %struct.llvm_java_object_base }
33 %"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 }
None ; RUN: opt %s -dse
0 ; RUN: opt < %s -dse
11
22 %"java/lang/Object" = type { %struct.llvm_java_object_base }
33 %"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 }
None ; RUN: opt %s -basicaa -gvn -instcombine |\
0 ; RUN: opt < %s -basicaa -gvn -instcombine |\
11 ; RUN: llvm-dis | grep {load i32\\* %A}
22
33 declare double* @useit(i32*)
None ; RUN: opt %s -aa-eval -disable-output |& grep {2 no alias respon}
0 ; RUN: opt < %s -aa-eval -disable-output |& grep {2 no alias respon}
11 ; TEST that A[1][0] may alias A[0][i].
22
33 define void @test(i32 %N) {
0 ; PR1109
1 ; RUN: opt %s -basicaa -gvn -instcombine -S | \
1 ; RUN: opt < %s -basicaa -gvn -instcombine -S | \
22 ; RUN: grep {sub i32}
3 ; RUN: opt %s -basicaa -gvn -instcombine -S | \
3 ; RUN: opt < %s -basicaa -gvn -instcombine -S | \
44 ; RUN: not grep {ret i32 0}
55 ; END.
66
0 ; PR1600
1 ; RUN: opt %s -basicaa -gvn -instcombine -S | \
1 ; RUN: opt < %s -basicaa -gvn -instcombine -S | \
22 ; RUN: grep {ret i32 0}
33 ; END.
44
None ; RUN: opt %s -basicaa -gvn -dce -S | grep tmp7
0 ; RUN: opt < %s -basicaa -gvn -dce -S | grep tmp7
11
22 %struct.A = type { i32 }
33 %struct.B = type { %struct.A }
None ; RUN: opt %s -gvn -disable-output
0 ; RUN: opt < %s -gvn -disable-output
11 ; PR1774
22
33 target datalayout = "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"
None ; RUN: opt %s -gvn -disable-output
0 ; RUN: opt < %s -gvn -disable-output
11 ; PR1782
22
33 target datalayout = "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"
None ; RUN: opt %s -std-compile-opts -S | grep store
0 ; RUN: opt < %s -std-compile-opts -S | grep store
11 ; ModuleID = 'small2.c'
22 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:128:128"
33 target triple = "i386-apple-darwin8"
None ; RUN: opt %s -gvn -disable-output
0 ; RUN: opt < %s -gvn -disable-output
11 ; PR2395
22
33 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"
None ; RUN: opt %s -aa-eval |& grep {1 no alias response}
0 ; RUN: opt < %s -aa-eval |& grep {1 no alias response}
11
22 declare noalias i32* @_Znwj(i32 %x) nounwind
33
None ; RUN: opt %s -aa-eval -print-all-alias-modref-info -disable-output |& grep {MustAlias:.*%R,.*%r}
0 ; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& grep {MustAlias:.*%R,.*%r}
11 ; Make sure that basicaa thinks R and r are must aliases.
22
33 define i32 @test(i8 * %P) {
None ; RUN: opt %s -basicaa -gvn -S | grep load
0 ; RUN: opt < %s -basicaa -gvn -S | grep load
11
22 declare noalias i32* @noalias()
33
None ; RUN: opt %s -gvn -S | grep {ret i32 1}
0 ; RUN: opt < %s -gvn -S | grep {ret i32 1}
11 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:128:128"
22 target triple = "i686-apple-darwin8"
33 %struct.x = type { i32, i32, i32, i32 }
None ; RUN: opt %s -basicaa -gvn -S | grep load | count 1
0 ; RUN: opt < %s -basicaa -gvn -S | grep load | count 1
11
22 @flag0 = internal global i32 zeroinitializer
33 @turn = internal global i32 zeroinitializer
None ; RUN: opt %s -aa-eval -print-all-alias-modref-info \
0 ; RUN: opt < %s -aa-eval -print-all-alias-modref-info \
11 ; RUN: |& grep {MayAlias: double\\* \[%\]p.0.i.0, double\\* \[%\]p3\$}
22 ; PR4267
33
0 ; This testcase tests for various features the basicaa test should be able to
11 ; determine, as noted in the comments.
22
3 ; RUN: opt %s -basicaa -gvn -instcombine -dce -S | not grep REMOVE
3 ; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | not grep REMOVE
44
55 @Global = external global { i32 }
66
11 ; disambiguating some obvious cases. All loads should be removable in
22 ; this testcase.
33
4 ; RUN: opt %s -basicaa -gvn -instcombine -dce -S \
4 ; RUN: opt < %s -basicaa -gvn -instcombine -dce -S \
55 ; RUN: | not grep load
66
77 @A = global i32 7
0 ; A store or load cannot alias a global if the accessed amount is larger then
11 ; the global.
22
3 ; RUN: opt %s -basicaa -gvn -instcombine -S | not grep load
3 ; RUN: opt < %s -basicaa -gvn -instcombine -S | not grep load
44
55 @B = global i16 8 ; [#uses=2]
66
0 ; A very rudimentary test on AliasAnalysis::getModRefInfo.
1 ; RUN: opt %s -print-all-alias-modref-info -aa-eval -disable-output |& \
1 ; RUN: opt < %s -print-all-alias-modref-info -aa-eval -disable-output |& \
22 ; RUN: not grep NoModRef
33
44 define i32 @callee() {
None ; RUN: opt %s -basicaa -gvn -instcombine -S | grep {ret i1 true}
0 ; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i1 true}
11 ; PR2436
22 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:128:128"
33 target triple = "i386-apple-darwin8"
None ; RUN: opt %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
0 ; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
11
22 declare i32* @test(i32* nocapture)
33
None ; RUN: opt %s -basicaa -gvn -S | grep TestConst | count 2
1 ; RUN: opt %s -basicaa -gvn -S | grep TestPure | count 3
2 ; RUN: opt %s -basicaa -gvn -S | grep TestNone | count 4
0 ; RUN: opt < %s -basicaa -gvn -S | grep TestConst | count 2
1 ; RUN: opt < %s -basicaa -gvn -S | grep TestPure | count 3
2 ; RUN: opt < %s -basicaa -gvn -S | grep TestNone | count 4
33 @g = global i32 0 ; [#uses=1]
44
55 define i32 @test() {
11 ; disambiguating some obvious cases. If LICM is able to disambiguate the
22 ; two pointers, then the load should be hoisted, and the store sunk.
33
4 ; RUN: opt %s -basicaa -licm -S | FileCheck %s
4 ; RUN: opt < %s -basicaa -licm -S | FileCheck %s
55
66 @A = global i32 7 ; [#uses=3]
77 @B = global i32 8 ; [#uses=2]
None ; RUN: opt %s -basicaa -gvn -instcombine |\
0 ; RUN: opt < %s -basicaa -gvn -instcombine |\
11 ; RUN: llvm-dis | grep {ret i32 0}
22
33 declare void @foo(i32*)
None ; RUN: opt %s -print-callgraph -disable-output |& \
0 ; RUN: opt < %s -print-callgraph -disable-output |& \
11 ; RUN: grep {Calls function 'callee'} | count 2
22
33 define internal void @callee(...) {
None ; RUN: opt %s -print-callgraph -disable-output |& \
0 ; RUN: opt < %s -print-callgraph -disable-output |& \
11 ; RUN: grep {Calls function}
22
33 @a = global void ()* @f ; [#uses=0]
None ; RUN: opt %s -domtree -break-crit-edges -analyze \
0 ; RUN: opt < %s -domtree -break-crit-edges -analyze \
11 ; RUN: -domtree | grep {3.*%brtrue }
22 ; PR932
33
None ; RUN: opt %s -domtree -break-crit-edges -domtree -disable-output
0 ; RUN: opt < %s -domtree -break-crit-edges -domtree -disable-output
11 ; PR1110
22
33 %struct.OggVorbis_File = type { i8*, i32, i64, i64, %struct.ogg_sync_state, i32, i64*, i64*, i32*, i64*, %struct.vorbis_info*, %struct.vorbis_comment*, i64, i32, i32, i32, double, double, %struct.ogg_stream_state, %struct.vorbis_dsp_state, %struct.vorbis_block, %struct.ov_callbacks }
None ; RUN: opt %s -globalsmodref-aa -gvn -S | grep call | count 2
0 ; RUN: opt < %s -globalsmodref-aa -gvn -S | grep call | count 2
11
22 @g = internal global i32 0 ; [#uses=2]
33
None ; RUN: opt %s -globalsmodref-aa -gvn -S | not grep load
0 ; RUN: opt < %s -globalsmodref-aa -gvn -S | not grep load
11 @X = internal global i32 4 ; [#uses=1]
22
33 define i32 @test(i32* %P) {
None ; RUN: opt %s -globalsmodref-aa -gvn -S | not grep load
0 ; RUN: opt < %s -globalsmodref-aa -gvn -S | not grep load
11
22 ; This test requires the use of previous analyses to determine that
33 ; doesnotmodX does not modify X (because 'sin' doesn't).
None ; RUN: opt %s -globalsmodref-aa -gvn -instcombine -S | \
0 ; RUN: opt < %s -globalsmodref-aa -gvn -instcombine -S | \
11 ; RUN: grep {ret i32 0}
22
33 @G = internal global i32* null ; [#uses=3]
None ; RUN: opt %s -globalsmodref-aa -gvn -S | not grep load
0 ; RUN: opt < %s -globalsmodref-aa -gvn -S | not grep load
11 @X = internal global i32 4 ; [#uses=2]
22
33 define i32 @test(i32* %P) {
0 ; Test that pure functions are cse'd away
1 ; RUN: opt %s -globalsmodref-aa -gvn -instcombine | \
1 ; RUN: opt < %s -globalsmodref-aa -gvn -instcombine | \
22 ; RUN: llvm-dis | not grep sub
33
44 define i32 @pure(i32 %X) {
None ; RUN: opt %s -disable-output -analyze -lda | FileCheck %s
0 ; RUN: opt < %s -disable-output -analyze -lda | FileCheck %s
11
22 ;; x[5] = x[6] // with x being a pointer passed as argument
33
None ; RUN: opt %s -disable-output -analyze -lda | FileCheck %s
0 ; RUN: opt < %s -disable-output -analyze -lda | FileCheck %s
11
22 @x = common global [256 x i32] zeroinitializer, align 4
33 @y = common global [256 x i32] zeroinitializer, align 4
None ; RUN: opt %s -disable-output -analyze -lda | FileCheck %s
0 ; RUN: opt < %s -disable-output -analyze -lda | FileCheck %s
11
22 @x = common global [256 x i32] zeroinitializer, align 4
33 @y = common global [256 x i32] zeroinitializer, align 4
None ; RUN: opt %s -disable-output -analyze -lda | FileCheck %s
0 ; RUN: opt < %s -disable-output -analyze -lda | FileCheck %s
11
22 @x = common global [256 x i32] zeroinitializer, align 4
33 @y = common global [256 x i32] zeroinitializer, align 4
None ; RUN: opt %s -disable-output -analyze -lda | FileCheck %s
0 ; RUN: opt < %s -disable-output -analyze -lda | FileCheck %s
11
22 @x = common global [256 x i32] zeroinitializer, align 4
33
0 ; This testcase was incorrectly computing that the loopentry.7 loop was
11 ; not a child of the loopentry.6 loop.
22 ;
3 ; RUN: opt %s -analyze -loops | \
3 ; RUN: opt < %s -analyze -loops | \
44 ; RUN: grep {^ Loop at depth 4 containing: %loopentry.7
}
55
66 define void @getAndMoveToFrontDecode() {
None ; RUN: opt %s -pointertracking -analyze | FileCheck %s
0 ; RUN: opt < %s -pointertracking -analyze | FileCheck %s
11 target datalayout = "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"
22 target triple = "x86_64-unknown-linux-gnu"
33 @.str = internal constant [5 x i8] c"1234\00" ; <[5 x i8]*> [#uses=1]
None ; RUN: opt %s -analyze -postdomfrontier \
0 ; RUN: opt < %s -analyze -postdomfrontier \
11 ; RUN: -disable-verify
22 ; ModuleID = '2006-09-26-PostDominanceFrontier.bc'
33 target datalayout = "e-p:64:64"
None ; RUN: opt %s -postdomfrontier -disable-output
0 ; RUN: opt < %s -postdomfrontier -disable-output
11
22 define void @SManager() {
33 entry:
None ; RUN: opt %s -postdomfrontier -disable-output
0 ; RUN: opt < %s -postdomfrontier -disable-output
11
22 define void @args_out_of_range() {
33 entry:
None ; RUN: opt %s -postdomtree -analyze | grep entry
0 ; RUN: opt < %s -postdomtree -analyze | grep entry
11 ; PR932
22
33 define void @foo(i1 %x) {
0 ; Test the edge profiling instrumentation.
1 ; RUN: opt %s -insert-edge-profiling -S | FileCheck %s
1 ; RUN: opt < %s -insert-edge-profiling -S | FileCheck %s
22
33 ; ModuleID = ''
44
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep {Loop bb: backedge-taken count is 100}
22 ; PR1533
33
None ; RUN: opt %s -indvars -adce -simplifycfg -S | grep "icmp s"
0 ; RUN: opt < %s -indvars -adce -simplifycfg -S | grep "icmp s"
11 ; PR1598
22
33 define i32 @f(i32 %a, i32 %b, i32 %x, i32 %y) {
None ; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop bb: backedge-taken count is (-1 + (-1 \\* %x) + %y)}
0 ; RUN: opt < %s -scalar-evolution -analyze -disable-output | grep {Loop bb: backedge-taken count is (-1 + (-1 \\* %x) + %y)}
11 ; PR1597
22
33 define i32 @f(i32 %x, i32 %y) {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 13}
22 ; PR1706
33
None ; RUN: opt %s -indvars -S | grep printd | grep 1206807378
0 ; RUN: opt < %s -indvars -S | grep printd | grep 1206807378
11 ; PR1798
22
33 declare void @printd(i32)
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep -e {--> %b}
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep -e {--> %b}
11 ; PR1810
22
33 define void @fun() {
None ; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop header: backedge-taken count is (0 smax %n)}
0 ; RUN: opt < %s -scalar-evolution -analyze -disable-output | grep {Loop header: backedge-taken count is (0 smax %n)}
11
22 define void @foo(i32 %n) {
33 entry:
None ; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop loop: backedge-taken count is (100 + (-100 smax %n))}
0 ; RUN: opt < %s -scalar-evolution -analyze -disable-output | grep {Loop loop: backedge-taken count is (100 + (-100 smax %n))}
11 ; PR2002
22
33 define void @foo(i8 %n) {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep umax
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep umax
11 ; PR2003
22
33 define i32 @foo(i32 %n) {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 61}
22 ; PR2364
33
None ; RUN: opt %s -analyze -scalar-evolution 2>/dev/null
0 ; RUN: opt < %s -analyze -scalar-evolution 2>/dev/null
11 ; PR2433
22
33 define i32 @main1(i32 %argc, i8** %argv) nounwind {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output |& not grep smax
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output |& not grep smax
11 ; PR2261
22
33 @lut = common global [256 x i8] zeroinitializer, align 32 ; <[256 x i8]*> [#uses=1]
None ; RUN: opt %s -analyze -scalar-evolution -disable-output |& not grep smax
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output |& not grep smax
11 ; PR2070
22
33 define i32 @a(i32 %x) nounwind {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep Unpredictable
22 ; PR2088
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 113}
22 ; PR2088
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | \
22 ; RUN: grep -F "backedge-taken count is (-1 + (-1 * %j))"
33 ; PR2607
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | \
22 ; RUN: grep -F "backedge-taken count is (-2147483632 + ((-1 + (-1 * %x)) smax (-1 + (-1 * %y))))"
33 ; PR2607
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: 20028"
22 ; PR2621
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: -19168"
22 ; PR2621
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output
11 ; PR1827
22
33 declare void @use(i32)
None ; RUN: opt %s -analyze -scalar-evolution -disable-output
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output
11 ; PR2602
22
33 define i32 @a() nounwind {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output |& \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output |& \
11 ; RUN: grep {Loop bb: backedge-taken count is (7 + (-1 \\* %argc))}
22 ; XFAIL: *
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: | grep {Loop bb: Unpredictable backedge-taken count\\.}
22
33 ; ScalarEvolution can't compute a trip count because it doesn't know if
None ; RUN: opt %s -analyze -scalar-evolution -disable-output |& grep {/u 3}
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output |& grep {/u 3}
11 ; XFAIL: *
22
33 define i32 @f(i32 %x) nounwind readnone {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {backedge-taken count is 255}
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep {backedge-taken count is 255}
11 ; XFAIL: *
22
33 define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {0 smax}
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep {0 smax}
11 ; XFAIL: *
22
33 define i32 @f(i32 %c.idx.val) {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output |& \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output |& \
11 ; RUN: grep {(((-1 \\* %i0) + (100005 smax %i0)) /u 5)}
22 ; XFAIL: *
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output |& grep {/u 5}
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output |& grep {/u 5}
11 ; XFAIL: *
22
33 define i8 @foo0(i8 %i0) nounwind {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | not grep {/u -1}
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | not grep {/u -1}
11 ; PR3275
22
33 @g_16 = external global i16 ; [#uses=3]
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {(trunc i} | not grep ext
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep {(trunc i} | not grep ext
11
22 define i16 @test1(i8 %x) {
33 %A = sext i8 %x to i32
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {count is 2}
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep {count is 2}
11 ; PR3171
22
33 %struct.Foo = type { i32 }
None ; RUN: opt %s -analyze -scalar-evolution
0 ; RUN: opt < %s -analyze -scalar-evolution
11 ; PR4501
22
33 define void @test() {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 100}
22 ; PR1101
33
None ; RUN: opt %s -scalar-evolution -analyze -disable-output \
0 ; RUN: opt < %s -scalar-evolution -analyze -disable-output \
11 ; RUN: | grep {\\--> (zext} | count 2
22
33 define i32 @foo(i32 %x) {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output
11 ; PR4537
22
33 ; ModuleID = 'b.bc'
None ; RUN: opt %s -iv-users
0 ; RUN: opt < %s -iv-users
11 ; PR4538
22
33 ; ModuleID = 'bugpoint-reduced-simplified.bc'
None ; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop bb3: backedge-taken count is (-1 + %n)}
0 ; RUN: opt < %s -scalar-evolution -analyze -disable-output | grep {Loop bb3: backedge-taken count is (-1 + %n)}
11
22 ; We don't want to use a max in the trip count expression in
33 ; this testcase.
None ; RUN: opt %s -indvars -S > %t
0 ; RUN: opt < %s -indvars -S > %t
11 ; RUN: grep select %t | count 2
22 ; RUN: grep {icmp ne i32.\* %w } %t
33
None ; RUN: opt %s -scalar-evolution -analyze -disable-output \
0 ; RUN: opt < %s -scalar-evolution -analyze -disable-output \
11 ; RUN: | grep {\\--> ((-128 \\* %a) /u -128)}
22
33 ; Don't let ScalarEvolution fold this div away.
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep smax
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep smax
11 ; PR1614
22
33 define i32 @f(i32 %x, i32 %y) {
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: | grep {\{%d,+,\[^\{\}\]\*\}}
22
33 ; ScalarEvolution should be able to understand the loop and eliminate the casts.
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep { --> {.*,+,.*}} | count 8
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep { --> {.*,+,.*}} | count 8
11
22 ; The addrecs in this loop are analyzable only by using nsw information.
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output
11
22 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"
33 %JavaObject = type { [0 x i32 (...)*]*, i8* }
None ; RUN: opt %s -indvars -disable-output
0 ; RUN: opt < %s -indvars -disable-output
11 ; PR 3909
22
33
None ; RUN: opt %s -scev-aa -aa-eval -print-all-alias-modref-info \
0 ; RUN: opt < %s -scev-aa -aa-eval -print-all-alias-modref-info \
11 ; RUN: |& FileCheck %s
22
33 ; At the time of this writing, all of these CHECK lines are cases that
None ; RUN: opt %s -analyze -scalar-evolution -disable-output > %t
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output > %t
11 ; RUN: grep {sext i57 \{0,+,199\} to i64} %t | count 1
22 ; RUN: grep {sext i59 \{0,+,199\} to i64} %t | count 1
33
None ; RUN: opt %s -disable-output -scalar-evolution -analyze \
0 ; RUN: opt < %s -disable-output -scalar-evolution -analyze \
11 ; RUN: | grep { --> \{-128,+,1\} Exits: 127} | count 5
22
33 ; Convert (sext {-128,+,1}) to {sext(-128),+,sext(1)}, since the
None ; RUN: opt %s -disable-output -scalar-evolution -analyze \
0 ; RUN: opt < %s -disable-output -scalar-evolution -analyze \
11 ; RUN: | grep { --> (sext i. \{.\*,+,.\*\} to i64)} | count 5
22
33 ; Don't convert (sext {...,+,...}) to {sext(...),+,sext(...)} in cases
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | FileCheck %s
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | FileCheck %s
11
22 ; CHECK: %tmp3 = sext i8 %tmp2 to i32
33 ; CHECK: --> (sext i8 {0,+,1} to i32) Exits: -1
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep smax | count 2
1 ; RUN: opt %s -analyze -scalar-evolution -disable-output | grep \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep smax | count 2
1 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep \
22 ; RUN: {%. smax %. smax %.}
33 ; PR1614
44
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 10000}
22 ; PR1101
33
None ; RUN: opt %s -analyze -scalar-evolution -disable-output | \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | \
11 ; RUN: grep {backedge-taken count is 4}
22 ; PR1101
33
None ; RUN: opt %s -scalar-evolution -analyze -disable-output \
0 ; RUN: opt < %s -scalar-evolution -analyze -disable-output \
11 ; RUN: | grep {Loop bb3\\.i: Unpredictable backedge-taken count\\.}
22
33 ; ScalarEvolution can't compute a trip count because it doesn't know if
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: | grep {sext.*trunc.*Exits: 11}
22
33 ; ScalarEvolution should be able to compute a loop exit value for %indvar.i8.
None ; RUN: opt %s -analyze -scalar-evolution -disable-output > %t
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output > %t
11 ; RUN: grep sext %t | count 2
22 ; RUN: not grep {(sext} %t
33
None ; RUN: opt %s -analyze -disable-output -scalar-evolution \
0 ; RUN: opt < %s -analyze -disable-output -scalar-evolution \
11 ; RUN: | grep {max backedge-taken count is 1\$}
22
33 @mode_table = global [4 x i32] zeroinitializer ; <[4 x i32]*> [#uses=1]
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: | grep {Loop bb7.i: Unpredictable backedge-taken count\\.}
22
33 target datalayout = "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"
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: | grep {Loop for\\.body: backedge-taken count is (-1 + \[%\]ecx)}
22 ; PR4599
33
None ; RUN: opt %s -scalar-evolution -disable-output -analyze \
0 ; RUN: opt < %s -scalar-evolution -disable-output -analyze \
11 ; RUN: | grep {\\--> (zext i4 (-8 + (trunc i64 (8 \\* %x) to i4)) to i64)}
22
33 ; ScalarEvolution shouldn't try to analyze %z into something like
None ; RUN: opt %s -analyze -scalar-evolution -disable-output \
0 ; RUN: opt < %s -analyze -scalar-evolution -disable-output \
11 ; RUN: | FileCheck %s
22 ; PR4569
33
33 ; Check by running globaldce, which will remove the constant if there are
44 ; no references to it!
55 ;
6 ; RUN: opt %s -globaldce -S | \
6 ; RUN: opt < %s -globaldce -S | \
77 ; RUN: not grep constant
88 ;
99
0 ; Testcase that seems to break the bytecode reader. This comes from the
11 ; "crafty" spec benchmark.
22 ;
3 ; RUN: opt %s -instcombine -S | llvm-as
3 ; RUN: opt < %s -instcombine -S | llvm-as
44
55 %CHESS_POSITION = type { i32, i32 }
66 @pawn_probes = external global i32 ; [#uses=0]
None ; RUN: opt %s -verify -S | llvm-as -disable-output
0 ; RUN: opt < %s -verify -S | llvm-as -disable-output
11
22 define {i32, i8} @foo(i32 %p) {
33 ret i32 1, i8 2
None ; RUN: opt %s -strip -S | llvm-as | llvm-dis
0 ; RUN: opt < %s -strip -S | llvm-as | llvm-dis
11
22 ; Stripping the name from A should not break references to it.
33 %A = type opaque
None ; RUN: opt %s -constprop | llvm-dis
0 ; RUN: opt < %s -constprop | llvm-dis
11 ; PR3465
22
33 define double @test() {
None ; RUN: opt %s -anders-aa -argpromotion
0 ; RUN: opt < %s -anders-aa -argpromotion
11
22 declare void @llvm.gcroot(i8**, i8*)
33
None ; RUN: opt %s -deadargelim
0 ; RUN: opt < %s -deadargelim
11
22 declare void @llvm.gcroot(i8**, i8*)
33
None ; RUN: opt %s -inline -S | grep example
0 ; RUN: opt < %s -inline -S | grep example
11
22 %IntArray = type { i32, [0 x i32*] }
33
None ; RUN: opt %s -inline -S | grep sample
1 ; RUN: opt %s -inline -S | grep example
0 ; RUN: opt < %s -inline -S | grep sample
1 ; RUN: opt < %s -inline -S | grep example
22
33 %IntArray = type { i32, [0 x i32*] }
44
None ; RUN: opt %s -std-compile-opts | llc > %t
0 ; RUN: opt < %s -std-compile-opts | llc > %t
11 ; ModuleID = 'ld3.c'
22 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-f128:64:128"
33 target triple = "powerpc-apple-darwin8"
None ; RUN: opt %s -instcombine | \
0 ; RUN: opt < %s -instcombine | \
11 ; RUN: llc -march=ppc32 -mcpu=g5 | not grep vperm
22 ; RUN: llc < %s -march=ppc32 -mcpu=g5 > %t
33 ; RUN: grep vsldoi %t | count 2
None ; RUN: opt %s -instcombine -S | grep 302245289961712575840256
1 ; RUN: opt %s -instcombine -S | grep K40018000000000000000
0 ; RUN: opt < %s -instcombine -S | grep 302245289961712575840256
1 ; RUN: opt < %s -instcombine -S | grep K40018000000000000000
22 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:128:128"
33 target triple = "i686-apple-darwin9"
44
None ; RUN: opt %s -std-compile-opts | llc
0 ; RUN: opt < %s -std-compile-opts | llc
11 ; ModuleID = 'block12.c'
22 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:128:128"
33 target triple = "i686-apple-darwin8"
None ; RUN: opt %s -std-compile-opts | llc > %t
0 ; RUN: opt < %s -std-compile-opts | llc > %t
11 ; RUN: grep 2147027116 %t | count 3
22 ; RUN: grep 2147228864 %t | count 3
33 ; RUN: grep 2146502828 %t | count 3
None ; RUN: opt %s -scalarrepl -instcombine | \
0 ; RUN: opt < %s -scalarrepl -instcombine | \
11 ; RUN: llc -march=x86 -mcpu=yonah | not grep sub.*esp
22
33 ; This checks that various insert/extract idiom work without going to the
None ; RUN: opt %s -instcombine -S | grep store | count 5
0 ; RUN: opt < %s -instcombine -S | grep store | count 5
11 ; ModuleID = ''
22 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:128:128"
33 target triple = "i386-apple-darwin9.6"
None ; RUN: opt %s -instcombine -S | not grep alloca
0 ; RUN: opt < %s -instcombine -S | not grep alloca
11 ; ModuleID = ''
22 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:128:128"
33 target triple = "i386-apple-darwin9.6"
None ; RUN: opt %s -instcombine -S | not grep alloca
0 ; RUN: opt < %s -instcombine -S | not grep alloca
11 ; ModuleID = ''
22 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:128:128"
33 target triple = "i386-apple-darwin9.6"
None ; RUN: opt %s -print-dbginfo -disable-output | FileCheck %s
0 ; RUN: opt < %s -print-dbginfo -disable-output | FileCheck %s
11 ; grep {%b is variable b of type x declared at x.c:7} %t1
22 ; grep {%2 is variable b of type x declared at x.c:7} %t1
33 ; grep {@c.1442 is variable c of type int declared at x.c:4} %t1
0 ; PR1318
1 ; RUN: opt %s -load=%llvmlibsdir/LLVMHello%shlibext -hello \
1 ; RUN: opt < %s -load=%llvmlibsdir/LLVMHello%shlibext -hello \
22 ; RUN: -disable-output |& grep Hello
33
44 @junk = global i32 0
0 ; Call graph construction crash: Not handling indirect calls right
11 ;
2 ; RUN: opt %s -analyze -print-callgraph >& /dev/null
2 ; RUN: opt < %s -analyze -print-callgraph >& /dev/null
33 ;
44
55 %FunTy = type i32 (i32)
0 ; Inlining used to break PHI nodes. This tests that they are correctly updated
11 ; when a node is split around the call instruction. The verifier caught the error.
22 ;
3 ; RUN: opt %s -inline
3 ; RUN: opt < %s -inline
44 ;
55
66 define i64 @test(i64 %X) {
44 ;
55 ; Fixed by adding new arguments to ConstantFoldTerminator
66 ;
7 ; RUN: opt %s -constprop
7 ; RUN: opt < %s -constprop
88
99 define void @build_tree(i32 %ml) {
1010 ;
11 ; figure out that loop "Inner" should be nested inside of leep "LoopHeader",
22 ; and instead nests it just inside loop "Top"
33 ;
4 ; RUN: opt %s -analyze -loops | \
4 ; RUN: opt < %s -analyze -loops | \
55 ; RUN: grep { Loop at depth 3 containing: %Inner
}
66 ;
77 define void @test() {
None ;RUN: opt %s -codegenprepare -disable-output
0 ;RUN: opt < %s -codegenprepare -disable-output
11
22 define void @foo() {
33 entry:
None ;RUN: opt %s -analyze -dot-cfg-only -disable-output 2>/dev/null
0 ;RUN: opt < %s -analyze -dot-cfg-only -disable-output 2>/dev/null
11 ;PR 1497
22
33 define void @foo() {
None ; RUN: opt %s -loop-unswitch -indvars -disable-output
0 ; RUN: opt < %s -loop-unswitch -indvars -disable-output
11 ; Require SCEV before LCSSA.
22 define void @foo() {
33 entry:
0 ; PR 2034
1 ; RUN: opt %s -anders-aa -instcombine -gvn -disable-output
1 ; RUN: opt < %s -anders-aa -instcombine -gvn -disable-output
22 %struct.FULL = type { i32, i32, [1000 x float*] }
33
44 define i32 @sgesl(%struct.FULL* %a, i32* %ipvt, float* %b, i32 %job) {
None ; RUN: opt %s -instcombine -S | grep true
0 ; RUN: opt < %s -instcombine -S | grep true
11
22 target datalayout = "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"
33 target triple = "x86_64-unknown-linux-gnu"
None ; RUN: opt %s -inline -internalize -disable-output
0 ; RUN: opt < %s -inline -internalize -disable-output
11 define void @foo() nounwind {
22 ret void
33 }
None ; RUN: opt %s -inline -prune-eh -disable-output
0 ; RUN: opt < %s -inline -prune-eh -disable-output
11 define void @f2() {
22 invoke void @f6()
33 to label %ok1 unwind label %lpad1
0
1 ; RUN: opt %s -verify -S | grep noimplicitfloat
1 ; RUN: opt < %s -verify -S | grep noimplicitfloat
22 define void @f() noimplicitfloat {
33 }
0 ; It is illegal to remove BB1 because it will mess up the PHI node!
11 ;
2 ; RUN: opt %s -adce -S | grep BB1
2 ; RUN: opt < %s -adce -S | grep BB1
33
44 define i32 @test(i1 %C, i32 %A, i32 %B) {
55 ;
33 ; removed even though there were uses still around. Now the uses are filled
44 ; in with a dummy value before the PHI is deleted.
55 ;
6 ; RUN: opt %s -adce
6 ; RUN: opt < %s -adce
77
88 %node_t = type { double*, %node_t*, %node_t**, double**, double*, i32, i32 }
99
0 ; This testcase is a distilled form of: 2002-05-28-Crash.ll
11
2 ; RUN: opt %s -adce
2 ; RUN: opt < %s -adce
33
44 define float @test(i32 %i) {
55 %F = sitofp i32 %i to float ; [#uses=1]
1010 ; return !s;
1111 ;}
1212 ;
13 ; RUN: opt %s -adce
13 ; RUN: opt < %s -adce
1414
1515 define i32 @rx_bitset_empty(i32 %size, i32* %set) {
1616 bb1:
22 ; block in this function, it would work fine, but that would be the part we
33 ; have to fix now, wouldn't it....
44 ;
5 ; RUN: opt %s -adce
5 ; RUN: opt < %s -adce
66
77 define void @foo(i8* %reg5481) {
88 %cast611 = bitcast i8* %reg5481 to i8** ; [#uses=1]
0 ; This testcase was extracted from the gzip SPEC benchmark
11 ;
2 ; RUN: opt %s -adce
2 ; RUN: opt < %s -adce
33
44 @bk = external global i32 ; [#uses=2]
55 @hufts = external global i32 ; [#uses=1]
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11
22 define void @test() {
33 br label %BB3
0 ; Testcase reduced from 197.parser by bugpoint
1 ; RUN: opt %s -adce
1 ; RUN: opt < %s -adce
22
33 define void @conjunction_prune() {
44 ;
11 ; entries for it's postdominator. But I think this can only happen when the
22 ; PHI node is dead, so we just avoid patching up dead PHI nodes.
33
4 ; RUN: opt %s -adce
4 ; RUN: opt < %s -adce
55
66 target datalayout = "e-p:32:32"
77
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11
22 @G = external global i32* ; [#uses=1]
33
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11 target datalayout = "e-p:32:32"
22 %struct..CppObjTypeDesc = type { i32, i16, i16 }
33 %struct..TypeToken = type { i32, i16, i16 }
None ; RUN: opt %s -adce -simplifycfg -S | not grep then:
0 ; RUN: opt < %s -adce -simplifycfg -S | not grep then:
11
22 define void @dead_test8(i32* %data.1, i32 %idx.1) {
33 entry:
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11
22 define void @test() {
33 br i1 false, label %then, label %endif
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11
22 define i32 @main() {
33 br label %loop
None ; RUN: opt %s -adce -simplifycfg -S | grep call
0 ; RUN: opt < %s -adce -simplifycfg -S | grep call
11 declare void @exit(i32)
22
33 define i32 @main(i32 %argc) {
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11
22 define void @test() {
33 entry:
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11
22 declare void @strlen()
33
None ; RUN: opt %s -adce -simplifycfg | llvm-dis
0 ; RUN: opt < %s -adce -simplifycfg | llvm-dis
11
22 define i32 @Test(i32 %A, i32 %B) {
33 BB1:
None ; RUN: opt %s -adce -simplifycfg | llvm-dis
0 ; RUN: opt < %s -adce -simplifycfg | llvm-dis
11 %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
22 %spec_fd_t = type { i32, i32, i32, i8* }
33 @__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1]
None ; RUN: opt %s -adce -simplifycfg | llvm-dis
0 ; RUN: opt < %s -adce -simplifycfg | llvm-dis
11 %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
22 %spec_fd_t = type { i32, i32, i32, i8* }
33 @__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1]
None ; RUN: opt %s -adce -S | grep null
0 ; RUN: opt < %s -adce -S | grep null
11
22 declare i32 @strlen(i8*) readnone
33
None ; RUN: opt %s -adce -disable-output
0 ; RUN: opt < %s -adce -disable-output
11
22 define void @test() {
33 unreachable
None ; RUN: opt %s -argpromotion -S | grep nounwind | count 2
0 ; RUN: opt < %s -argpromotion -S | grep nounwind | count 2
11
22 define internal i32 @deref(i32* %x) nounwind {
33 entry:
None ; RUN: opt %s -argpromotion -S > %t
0 ; RUN: opt < %s -argpromotion -S > %t
11 ; RUN: cat %t | grep {define.*@callee(.*i32\\*}
22 ; PR2498
33
None ; RUN: opt %s -inline -argpromotion -disable-output
0 ; RUN: opt < %s -inline -argpromotion -disable-output
11
22 define internal fastcc i32 @hash(i32* %ts, i32 %mod) nounwind {
33 entry:
None ; RUN: opt %s -argpromotion -disable-output
0 ; RUN: opt < %s -argpromotion -disable-output
11
22 define internal fastcc i32 @term_SharingList(i32* %Term, i32* %List) nounwind {
33 entry:
None ; RUN: opt %s -argpromotion -instcombine -S | not grep load
0 ; RUN: opt < %s -argpromotion -instcombine -S | not grep load
11
22 %QuadTy = type { i32, i32, i32, i32 }
33 @G = constant %QuadTy {
None ; RUN: opt %s -argpromotion -S | grep zeroext
0 ; RUN: opt < %s -argpromotion -S | grep zeroext
11
22 %struct.ss = type { i32, i64 }
33
None ; RUN: opt %s -argpromotion -mem2reg -S | not grep alloca
0 ; RUN: opt < %s -argpromotion -mem2reg -S | not grep alloca
11 define internal i32 @test(i32* %X, i32* %Y) {
22 %A = load i32* %X ; [#uses=1]
33 %B = load i32* %Y ; [#uses=1]
None ; RUN: opt %s -argpromotion -S | grep -F {i32* byval} | count 2
0 ; RUN: opt < %s -argpromotion -S | grep -F {i32* byval} | count 2
11 ; Argpromote + scalarrepl should change this to passing the two integers by value.
22
33 %struct.ss = type { i32, i64 }
None ; RUN: opt %s -argpromotion -scalarrepl -S | not grep load
0 ; RUN: opt < %s -argpromotion -scalarrepl -S | not grep load
11 ; Argpromote + scalarrepl should change this to passing the two integers by value.
22
33 %struct.ss = type { i32, i64 }
None ; RUN: opt %s -argpromotion -simplifycfg -constmerge | llvm-dis
0 ; RUN: opt < %s -argpromotion -simplifycfg -constmerge | llvm-dis
11 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:128:128"
22 target triple = "i386-apple-darwin10.0"
33
None ; RUN: opt %s -argpromotion -instcombine -S | not grep load
0 ; RUN: opt < %s -argpromotion -instcombine -S | not grep load
11
22 @G1 = constant i32 0 ; [#uses=1]
33 @G2 = constant i32* @G1 ; [#uses=1]
None ; RUN: opt %s -argpromotion -S | \
0 ; RUN: opt < %s -argpromotion -S | \
11 ; RUN: not grep {load i32\* null}
22
33 define internal i32 @callee(i1 %C, i32* %P) {
None ; RUN: opt %s -argpromotion -S | \
0 ; RUN: opt < %s -argpromotion -S | \
11 ; RUN: grep {load i32\\* %A}
22
33 define internal i32 @callee(i1 %C, i32* %P) {
None ; RUN: opt %s -disable-output -loop-extract-single -loop-rotate -loop-reduce -argpromotion
0 ; RUN: opt < %s -disable-output -loop-extract-single -loop-rotate -loop-reduce -argpromotion
11 ; PR 3085
22
33 %struct.Lit = type { i8 }
None ; RUN: opt %s -block-placement -disable-output -print-function 2> /dev/null
0 ; RUN: opt < %s -block-placement -disable-output -print-function 2> /dev/null
11
22 define i32 @test() {
33 br i1 true, label %X, label %Y
None ; RUN: opt %s -std-compile-opts -o - | llc -o - | grep bork_directive | wc -l | grep 2
0 ; RUN: opt < %s -std-compile-opts -o - | llc -o - | grep bork_directive | wc -l | grep 2
11
22 ;; We don't want branch folding to fold asm directives.
33
None ; RUN: opt %s -loop-extract -disable-output
0 ; RUN: opt < %s -loop-extract -disable-output
11
22 define void @solve() {
33 entry:
None ; RUN: opt %s -loop-extract -disable-output
0 ; RUN: opt < %s -loop-extract -disable-output
11 ; This testcase is failing the loop extractor because not all exit blocks
22 ; are dominated by all of the live-outs.
33
None ; RUN: opt %s -loop-extract-single -disable-output
0 ; RUN: opt < %s -loop-extract-single -disable-output
11
22 define void @ab() {
33 entry:
None ; RUN: opt %s -loop-extract -disable-output
0 ; RUN: opt < %s -loop-extract -disable-output
11
22 define void @sendMTFValues() {
33 entry:
None ; RUN: opt %s -loop-extract -disable-output
0 ; RUN: opt < %s -loop-extract -disable-output
11
22 %struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, i32, i32 }
33 %struct.table_t = type { [1 x %struct.node_t**], [1 x %struct.node_t**] }
None ; RUN: opt %s -loop-extract -disable-output
0 ; RUN: opt < %s -loop-extract -disable-output
11
22 define void @maketree() {
33 entry:
None ; RUN: opt %s -loop-extract -disable-output
0 ; RUN: opt < %s -loop-extract -disable-output
11
22 declare i32 @_IO_getc()
33
None ; RUN: opt %s -extract-blocks -disable-output
0 ; RUN: opt < %s -extract-blocks -disable-output
11
22 define void @test1() {
33 no_exit.0.i:
None ; RUN: opt %s -extract-blocks -disable-output
0 ; RUN: opt < %s -extract-blocks -disable-output
11 define i32 @foo() {
22 br label %EB
33
None ; RUN: opt %s -codegenprepare | llvm-dis
0 ; RUN: opt < %s -codegenprepare | llvm-dis
11 ; PR3113
22 target datalayout = "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"
33 target triple = "x86_64-unknown-linux-gnu"
None ; RUN: opt %s -condprop -disable-output
0 ; RUN: opt < %s -condprop -disable-output
11 ; PR877
22 target datalayout = "E-p:32:32"
33 target triple = "powerpc-apple-darwin9.0.0d1"
None ; RUN: opt %s -condprop -disable-output
0 ; RUN: opt < %s -condprop -disable-output
11 ; PR979
22
33 target datalayout = "e-p:32:32"
None ; RUN: opt %s -inline -tailduplicate -condprop -simplifycfg -disable-output
0 ; RUN: opt < %s -inline -tailduplicate -condprop -simplifycfg -disable-output
11 ; PR1575
22 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"
33 target triple = "i686-pc-linux-gnu"
None ; RUN: opt %s -condprop | llvm-dis
0 ; RUN: opt < %s -condprop | llvm-dis
11 ; PR3405
22 target datalayout = "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"
33 target triple = "x86_64-unknown-linux-gnu"
None ; RUN: opt %s -condprop -S | \
0 ; RUN: opt < %s -condprop -S | \
11 ; RUN: not grep {br label}
22
33 %llvm.dbg.anchor.type = type { i32, i32 }
None ; RUN: opt %s -condprop -S | \
0 ; RUN: opt < %s -condprop -S | \
11 ; RUN: not grep {br label}
2 ; RUN: opt %s -condprop -S | not grep T2
2 ; RUN: opt < %s -condprop -S | not grep T2
33
44
55 define i32 @test(i1 %C) {
0 ; Make sure that the constant propogator doesn't divide by zero!
11 ;
2 ; RUN: opt %s -constprop
2 ; RUN: opt < %s -constprop
33 ;
44
55 define i32 @test() {
33
44 ; Fix #2: The unary not instruction now no longer exists. Change to xor.
55
6 ; RUN: opt %s -constprop -S | \
6 ; RUN: opt < %s -constprop -S | \
77 ; RUN: not grep {i32 0}
88
99 define i32 @test1() {
0 ; SetCC on boolean values was not implemented!
11
2 ; RUN: opt %s -constprop -die -S | \
2 ; RUN: opt < %s -constprop -die -S | \
33 ; RUN: not grep set
44
55 define i1 @test1() {
0 ; Make sure that the constant propagator doesn't cause a sigfpe
11 ;
2 ; RUN: opt %s -constprop
2 ; RUN: opt < %s -constprop
33 ;
44
55 define i32 @test() {
None ; RUN: opt %s -constprop -S | \
0 ; RUN: opt < %s -constprop -S | \
11 ; RUN: not grep {ret i1 false}
22
33 @b = external global [2 x { }] ; <[2 x { }]*> [#uses=2]
None ; RUN: opt %s -constprop -S | \
0 ; RUN: opt < %s -constprop -S | \
11 ; RUN: grep {i32 -1}
2 ; RUN: opt %s -constprop -S | \
2 ; RUN: opt < %s -constprop -S | \
33 ; RUN: not grep zeroinitializer
44
55 define <4 x i32> @test() {
None ; RUN: opt %s -instcombine -S | \
0 ; RUN: opt < %s -instcombine -S | \
11 ; RUN: grep {ret i1 false}
22 define i1 @test() {
33 %X = trunc i32 320 to i1 ; [#uses=1]
None ; RUN: opt %s -constprop -S | \
0 ; RUN: opt < %s -constprop -S | \
11 ; RUN: grep {ret i32 -1}
2 ; RUN: opt %s -constprop -S | \
2 ; RUN: opt < %s -constprop -S | \
33 ; RUN: grep {ret i32 1}
44
55 define i32 @test1() {
None ; RUN: opt %s -constprop -S | grep 1065353216
0 ; RUN: opt < %s -constprop -S | grep 1065353216
11
22 define i32 @test() {
33 %A = bitcast float 1.000000e+00 to i32 ; [#uses=1]
None ; RUN: opt %s -constprop -S | grep {ret i13 13}
0 ; RUN: opt < %s -constprop -S | grep {ret i13 13}
11 ; PR1816
22 declare i13 @llvm.cttz.i13(i13)
33
None ; RUN: opt %s -constprop -disable-output
0 ; RUN: opt < %s -constprop -disable-output
11 ; PR2529
22 define <4 x i1> @test1(i32 %argc, i8** %argv) {
33 entry:
None ; RUN: opt %s -constprop | llvm-dis
0 ; RUN: opt < %s -constprop | llvm-dis
11 ; PR4848
22 target datalayout = "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"
33 target triple = "x86_64-unknown-linux-gnu"
0 ; This is a basic sanity check for constant propogation. The add instruction
11 ; should be eliminated.
22
3 ; RUN: opt %s -constprop -die -S | not grep add
3 ; RUN: opt < %s -constprop -die -S | not grep add
44
55 define i32 @test(i1 %B) {
66 br i1 %B, label %BB1, label %BB2
0 ; bswap should be constant folded when it is passed a constant argument
11
2 ; RUN: opt %s -constprop -S | not grep call
2 ; RUN: opt < %s -constprop -S | not grep call
33
44 declare i16 @llvm.bswap.i16(i16)
55
None ; RUN: opt %s -instcombine -S | grep {ret i32 0}
0 ; RUN: opt < %s -instcombine -S | grep {ret i32 0}
11 ; PR4424
22 declare void @ext()
33
None ; RUN: opt %s -constprop -S | \
0 ; RUN: opt < %s -constprop -S | \
11 ; RUN: grep -F {ret i32* null} | count 2
22
33 define i32* @test1() {
0 ; Ensure constant propogation of 'not' instructions is working correctly.
11
2 ; RUN: opt %s -constprop -die -S | not grep xor
2 ; RUN: opt < %s -constprop -die -S | not grep xor
33
44 define i32 @test1() {
55 %R = xor i32 4, -1 ; [#uses=1]
None ; RUN: opt %s -constmerge > /dev/null
0 ; RUN: opt < %s -constmerge > /dev/null
11
22 @foo.upgrd.1 = internal constant { i32 } { i32 7 } ; <{ i32 }*> [#uses=1]
33 @bar = internal constant { i32 } { i32 7 } ; <{ i32 }*> [#uses=1]
None ; RUN: opt %s -constmerge -S | grep foo
1 ; RUN: opt %s -constmerge -S | grep bar
0 ; RUN: opt < %s -constmerge -S | grep foo
1 ; RUN: opt < %s -constmerge -S | grep bar
22
33 ; Don't merge constants in different sections.
44
None ; RUN: opt %s -deadargelim -disable-output
0 ; RUN: opt < %s -deadargelim -disable-output
11
22 define internal void @build_delaunay({ i32 }* sret %agg.result) {
33 ret void
None ; RUN: opt %s -deadargelim -S | grep {@test(}
1 ; RUN: opt %s -deadargelim -S | not grep dead
0 ; RUN: opt < %s -deadargelim -S | grep {@test(}
1 ; RUN: opt < %s -deadargelim -S | not grep dead
22
33 define internal i32 @test(i32 %X, i32 %dead) {
44 ret i32 %X
None ; RUN: opt %s -deadargelim -S | not grep {ret i32 0}
0 ; RUN: opt < %s -deadargelim -S | not grep {ret i32 0}
11 ; PR1735
22
33 define internal i32 @test(i32 %A, ...) {
None ; RUN: opt %s -deadargelim -S > %t
0 ; RUN: opt < %s -deadargelim -S > %t
11 ; RUN: cat %t | grep nounwind | count 2
22 ; RUN: cat %t | grep signext | count 2
33 ; RUN: cat %t | not grep inreg
None ; RUN: opt %s -deadargelim -S | grep byval
0 ; RUN: opt < %s -deadargelim -S | grep byval
11
22 %struct.point = type { double, double }
33 @pts = global [4 x %struct.point] [ %struct.point { double 1.000000e+00, double 2.000000e+00 }, %struct.point { double 3.000000e+00, double 4.000000e+00 }, %struct.point { double 5.000000e+00, double 6.000000e+00 }, %struct.point { double 7.000000e+00, double 8.000000e+00 } ], align 32 ; <[4 x %struct.point]*> [#uses=1]
None ; RUN: opt %s -deadargelim -die -S > %t
0 ; RUN: opt < %s -deadargelim -die -S > %t
11 ; RUN: cat %t | grep 123
22
33 ; This test tries to catch wrongful removal of return values for a specific case
None ; RUN: opt %s -deadargelim | llvm-dis
0 ; RUN: opt < %s -deadargelim | llvm-dis
11 ; PR3807
22
33 define internal { i32, i32 } @foo() {
None ; RUN: opt %s -deadargelim -S | not grep DEADARG
0 ; RUN: opt < %s -deadargelim -S | not grep DEADARG
11
22 ; test - an obviously dead argument
33 define internal i32 @test(i32 %v, i32 %DEADARG1, i32* %p) {
0 ; This test shows a few canonicalizations made by deadargelim
1 ; RUN: opt %s -deadargelim -S > %t
1 ; RUN: opt < %s -deadargelim -S > %t
22 ; This test should remove {} and replace it with void
33 ; RUN: cat %t | grep {define internal void @test}
44 ; This test shouls replace the {i32} return value with just i32
None ; RUN: opt %s -deadargelim -S | not grep 47
1 ; RUN: opt %s -deadargelim -S | not grep 1.0
0 ; RUN: opt < %s -deadargelim -S | not grep 47
1 ; RUN: opt < %s -deadargelim -S | not grep 1.0
22
33 define i32 @bar(i32 %A) {
44 %tmp4 = tail call i32 (i32, ...)* @foo( i32 %A, i32 %A, i32 %A, i32 %A, i64 47, double 1.000000e+00 ) ; [#uses=1]
None ; RUN: opt %s -deadargelim -S | not grep DEAD
0 ; RUN: opt < %s -deadargelim -S | not grep DEAD
11
22 ; Dead arg only used by dead retval
33 define internal i32 @test(i32 %DEADARG) {
None ; RUN: opt %s -deadargelim -die -S > %t
0 ; RUN: opt < %s -deadargelim -die -S > %t
11 ; RUN: cat %t | not grep DEAD
22 ; RUN: cat %t | grep LIVE | count 4
33
None ; RUN: opt %s -deadargelim -S > %t
0 ; RUN: opt < %s -deadargelim -S > %t
11 ; RUN: grep {define internal zeroext i32 @test1() nounwind} %t
22 ; RUN: grep {define internal %Ty @test2} %t
33
11 ; are unused. All unused values are typed i16, so we can easily check. We also
22 ; run instcombine to fold insert/extractvalue chains and we run dce to clean up
33 ; any remaining dead stuff.
4 ; RUN: opt %s -deadargelim -instcombine -dce -S | not grep i16
4 ; RUN: opt < %s -deadargelim -instcombine -dce -S | not grep i16
55
66 define internal {i16, i32} @test(i16 %DEADARG) {
77 %A = insertvalue {i16,i32} undef, i16 1, 0
None ; RUN: opt %s -dse -scalarrepl -instcombine | \
0 ; RUN: opt < %s -dse -scalarrepl -instcombine | \
11 ; RUN: llvm-dis | not grep {ret i32 undef}
22
33 define i32 @test(double %__x) {
None ; RUN: opt %s -dse -S | \
0 ; RUN: opt < %s -dse -S | \
11 ; RUN: grep {store i32 1234567}
22
33 ; Do not delete stores that are only partially killed.
None ; RUN: opt %s -dse -S | grep store
0 ; RUN: opt < %s -dse -S | grep store
11
22 define double @foo(i8* %X) {
33 %X_addr = alloca i8* ; [#uses=2]
None ; RUN: opt %s -globalsmodref-aa -dse -disable-output
0 ; RUN: opt < %s -globalsmodref-aa -dse -disable-output
11 target datalayout = "E-p:32:32"
22 target triple = "powerpc-apple-darwin8"
33 %struct.ECacheType = type { i32, i32, i32 }
None ; RUN: opt %s -dse -S | not grep tmp5
0 ; RUN: opt < %s -dse -S | not grep tmp5
11 ; PR2599
22
33 define void @foo({ i32, i32 }* %x) nounwind {
None ; RUN: opt %s -dse | llvm-dis
0 ; RUN: opt < %s -dse | llvm-dis
11 ; PR3141
22 %struct.ada__tags__dispatch_table = type { [1 x i32] }
33 %struct.f393a00_1__object = type { %struct.ada__tags__dispatch_table*, i8 }
None ; RUN: opt %s -dse | llvm-dis
0 ; RUN: opt < %s -dse | llvm-dis
11
22 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:128:128"
33 target triple = "i386-apple-darwin7"
None ; RUN: opt %s -dse -S | \
0 ; RUN: opt < %s -dse -S | \
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.
None ; RUN: opt %s -dse -S | not grep DEAD
0 ; RUN: opt < %s -dse -S | not grep DEAD
11
22 define void @test(i32* %Q) {
33 %P = alloca i32 ; [#uses=1]
None ; RUN: opt %s -dse -S | not grep store
0 ; RUN: opt < %s -dse -S | not grep store
11
22 %struct.x = type { i32, i32, i32, i32 }
33
None ; RUN: opt %s -dse -S | not grep DEAD
0 ; RUN: opt < %s -dse -S | not grep DEAD
11
22 declare void @ext()
33
None ; RUN: opt %s -dse | llvm-dis
0 ; RUN: opt < %s -dse | llvm-dis
11
22 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:128:128"
33 target triple = "i386-apple-darwin10.0"
None ; RUN: opt %s -dse -S | not grep DEAD
0 ; RUN: opt < %s -dse -S | not grep DEAD
11
22 define void @test(i32* %Q, i32* %P) {
33 %DEAD = load i32* %Q ; [#uses=1]
None ; RUN: opt %s -dse -S | not grep alloca
0 ; RUN: opt < %s -dse -S | not grep alloca
11 ; ModuleID = 'placeholder.adb'
22 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"
33 target triple = "i686-pc-linux-gnu"
None ; RUN: opt %s -dse -S | not grep DEAD
0 ; RUN: opt < %s -dse -S | not grep DEAD
11
22 define void @test(i32* %Q, i32* %P) {
33 %DEAD = load i32* %Q ; [#uses=1]
None ; RUN: opt %s -dse -S | grep {volatile load}
0 ; RUN: opt < %s -dse -S | grep {volatile load}
11
22 @g_1 = global i32 0
33
None ; RUN: opt %s -functionattrs -S | grep readnone
0 ; RUN: opt < %s -functionattrs -S | grep readnone
11
22 define i32 @a() {
33 %tmp = call i32 @b( ) ; [#uses=1]
None ; RUN: opt %s -functionattrs -S | grep readnone | count 4
0 ; RUN: opt < %s -functionattrs -S | grep readnone | count 4
11 @x = global i32 0
22
33 declare i32 @e() readnone
None ; RUN: opt %s -functionattrs -S | grep readonly | count 2
0 ; RUN: opt < %s -functionattrs -S | grep readonly | count 2
11
22 define i32 @f() {
33 entry:
None ; RUN: opt %s -functionattrs -S | not grep read
0 ; RUN: opt < %s -functionattrs -S | not grep read
11 ; PR2792
22
33 @g = global i32 0 ; [#uses=1]
None ; RUN: opt %s -functionattrs -S | grep readnone | count 2
0 ; RUN: opt < %s -functionattrs -S | grep readnone | count 2
11
22 declare i32 @g(i32*) readnone
33
None ; RUN: opt %s -functionattrs -S | grep readnone
0 ; RUN: opt < %s -functionattrs -S | grep readnone
11
22 @s = external constant i8 ; [#uses=1]
33
None ; RUN: opt %s -functionattrs -S | not grep {nocapture *%%q}
1 ; RUN: opt %s -functionattrs -S | grep {nocapture *%%p} | count 6
0 ; RUN: opt < %s -functionattrs -S | not grep {nocapture *%%q}
1 ; RUN: opt < %s -functionattrs -S | grep {nocapture *%%p} | count 6
22 @g = global i32* null ; [#uses=1]
33
44 define i32* @c1(i32* %q) {
None ; RUN: opt %s -functionattrs -S | not grep {nocapture *%%q}
1 ; RUN: opt %s -functionattrs -S | grep {nocapture *%%p}
0 ; RUN: opt < %s -functionattrs -S | not grep {nocapture *%%q}
1 ; RUN: opt < %s -functionattrs -S | grep {nocapture *%%p}
22
33 define i32* @a(i32** %p) {
44 %tmp = load i32** %p
None ; RUN: opt %s -functionattrs -S | not grep read
0 ; RUN: opt < %s -functionattrs -S | not grep read
11 ; PR3754
22
33 define i8* @m(i32 %size) {
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11
22 %struct.PerlInterpreter = type { i8 }
33 @PL_sv_count = external global i32 ; [#uses=2]
None ; RUN: opt %s -gvn -S | not grep {tmp10 =}
0 ; RUN: opt < %s -gvn -S | not grep {tmp10 =}
11
22 %struct.INT2 = type { i32, i32 }
33 @blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2]
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11
22 %struct.s_segment_inf = type { float, i32, i16, i16, float, float, i32, float, float }
33
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11
22 %struct.TypHeader = type { i32, %struct.TypHeader**, [3 x i8], i8 }
33
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11
22 %struct.ggBRDF = type { i32 (...)** }
33 %struct.ggBox3 = type { %struct.ggPoint3, %struct.ggPoint3 }
None ; RUN: opt %s -gvn -S | grep {tmp17625.* = phi i32. }
1 ; RUN: opt %s -gvn -S | grep {tmp17631.* = phi i32. }
0 ; RUN: opt < %s -gvn -S | grep {tmp17625.* = phi i32. }
1 ; RUN: opt < %s -gvn -S | grep {tmp17631.* = phi i32. }
22
33 @last = external global [65 x i32*] ; <[65 x i32*]*> [#uses=1]
44
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11
22 @bsLive = external global i32 ; [#uses=2]
33
None ; RUN: opt %s -gvn -S | grep {tmp298316 = phi i32 }
0 ; RUN: opt < %s -gvn -S | grep {tmp298316 = phi i32 }
11
22 %struct..0anon = type { i32 }
33 %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11
22 %"struct.Block::$_16" = type { i32 }
33 %struct.Exp = type { %struct.Exp_*, i32, i32, i32, %struct.Exp*, %struct.Exp*, %"struct.Exp::$_10", %"struct.Block::$_16", %"struct.Exp::$_12" }
None ; RUN: opt %s -gvn -S | grep {tmp47 = phi i32 }
0 ; RUN: opt < %s -gvn -S | grep {tmp47 = phi i32 }
11
22 %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
33 @debug = external constant i32 ; [#uses=0]
None ; RUN: opt %s -gvn -S | not grep {tmp701 =}
0 ; RUN: opt < %s -gvn -S | not grep {tmp701 =}
11
22 @img_width = external global i16 ; [#uses=2]
33
None ; RUN: opt %s -gvn -S | not grep load
0 ; RUN: opt < %s -gvn -S | not grep load
11 ; PR1996
22
33 %struct.anon = type { i32, i8, i8, i8, i8 }
None ; RUN: opt %s -anders-aa -gvn
0 ; RUN: opt < %s -anders-aa -gvn
11 ; PR2032
22
33 define i32 @sscal(i32 %n, double %sa1, float* %sx, i32 %incx) {
None ; RUN: opt %s -gvn -dse -S | grep {call.*memcpy} | count 1
0 ; RUN: opt < %s -gvn -dse -S | grep {call.*memcpy} | count 1
11
22 target datalayout = "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"
33 target triple = "x86_64-apple-darwin8"
None ; RUN: opt %s -gvn -dse -S | grep {call.*memcpy.*cell} | count 2
0 ; RUN: opt < %s -gvn -dse -S | grep {call.*memcpy.*cell} | count 2
11 ; PR2099
22
33 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:128:128"
None ; RUN: opt %s -gvn -S | grep {ret i8 \[%\]tmp3}
0 ; RUN: opt < %s -gvn -S | grep {ret i8 \[%\]tmp3}
11 ; PR2503
22
33 @g_3 = external global i8 ; [#uses=2]
None ; RUN: opt %s -gvn -S | grep getelementptr | count 1
0 ; RUN: opt < %s -gvn -S | grep getelementptr | count 1
11
22 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:128:128"
33 target triple = "i386-apple-darwin9.5"
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11 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:128:128"
22 target triple = "i386-apple-darwin7"
33
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11 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:128:128"
22 target triple = "i386-apple-darwin7"
33 @sort_value = external global [256 x i32], align 32 ; <[256 x i32]*> [#uses=2]
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11 ; Cached results must be added to and verified against the visited sets.
22 ; PR3217
33
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11 ; PR3358
22 target datalayout = "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"
33 target triple = "x86_64-unknown-linux-gnu"
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11
22 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:128:128"
33 target triple = "i386-apple-darwin7"
None ; RUN: opt %s -gvn -enable-load-pre -disable-output
0 ; RUN: opt < %s -gvn -enable-load-pre -disable-output
11
22 %struct.VEC_rtx_base = type { i32, i32, [1 x %struct.rtx_def*] }
33 %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base }
None ; RUN: opt %s -gvn -disable-output
0 ; RUN: opt < %s -gvn -disable-output
11 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 }
22 @llvm.dbg.compile_unit298 = external constant %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1]
33
None ; RUN: opt %s -gvn -disable-output
0 ; RUN: opt < %s -gvn -disable-output
11 ; PR3775
22
33 ; ModuleID = 'bugpoint-reduced-simplified.bc'
None ; RUN: opt %s -gvn -enable-load-pre -S | not grep pre1
0 ; RUN: opt < %s -gvn -enable-load-pre -S | not grep pre1
11 ; GVN load pre was hoisting the loads at %13 and %16 up to bb4.outer.
22 ; This is invalid as it bypasses the check for %m.0.ph==null in bb4.
33 ; ModuleID = 'mbuf.c'
None ; RUN: opt %s -gvn | llvm-dis
0 ; RUN: opt < %s -gvn | llvm-dis
11 ; PR4256
22 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"
33 target triple = "i386-linux-gnu"
None ; RUN: opt %s -gvn -S | not grep {%z2 =}
0 ; RUN: opt < %s -gvn -S | not grep {%z2 =}
11
22 define i32 @main() {
33 block1:
None ; RUN: opt %s -gvn -S | not grep tmp2
0 ; RUN: opt < %s -gvn -S | not grep tmp2
11 ; PR2213
22
33 define i32* @f(i8* %x) {
None ; RUN: opt %s -gvn -S | grep strlen | count 2
0 ; RUN: opt < %s -gvn -S | grep strlen | count 2
11 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:128:128"
22 target triple = "i386-apple-darwin9"
33
None ; RUN: opt %s -basicaa -gvn -S | grep {call.*strlen} | count 1
0 ; RUN: opt < %s -basicaa -gvn -S | grep {call.*strlen} | count 1
11 ; Should delete the second call to strlen even though the intervening strchr call exists.
22
33 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:128:128"
None ; RUN: opt %s -gvn -S | grep {br i1 false}
0 ; RUN: opt < %s -gvn -S | grep {br i1 false}
11
22 @a = external global i32 ; [#uses=7]
33
None ; RUN: opt %s -gvn -instcombine -S | grep {ret i32 0}
0 ; RUN: opt < %s -gvn -instcombine -S | grep {ret i32 0}
11 ; PR4189
22 @G = external constant [4 x i32]
33
None ; RUN: opt %s -gvn -enable-pre -S | grep {b.pre}
0 ; RUN: opt < %s -gvn -enable-pre -S | grep {b.pre}
11
22 define i32 @main(i32 %p) {
33 block1:
None ; RUN: opt %s -gvn -enable-load-pre -S | grep {%PRE = phi}
0 ; RUN: opt < %s -gvn -enable-load-pre -S | grep {%PRE = phi}
11
22 define i32 @test(i32* %p, i1 %C) {
33 block1:
None ; RUN: opt %s -gvn -S | not grep DEADLOAD
1 ; RUN: opt %s -gvn -S | not grep DEADGEP
0 ; RUN: opt < %s -gvn -S | not grep DEADLOAD
1 ; RUN: opt < %s -gvn -S | not grep DEADGEP
22
33 define i32 @main(i32** %p) {
44 block1:
None ; RUN: opt %s -gvn -enable-pre -S | grep {.pre}
0 ; RUN: opt < %s -gvn -enable-pre -S | grep {.pre}
11
22 @H = common global i32 0 ; [#uses=2]
33 @G = common global i32 0 ; [#uses=1]
None ; RUN: opt %s -gvn -enable-load-pre -S | not grep {tmp3 = load}
0 ; RUN: opt < %s -gvn -enable-load-pre -S | not grep {tmp3 = load}
11
22 @p = external global i32
33 define i32 @f(i32 %n) nounwind {
None ; RUN: opt %s -gvn -S | grep load | count 2
0 ; RUN: opt < %s -gvn -S | grep load | count 2
11
22 define i32 @main(i32** %p) {
33 block1:
None ; RUN: opt %s -gvn -S | grep {DEAD = phi i32 }
0 ; RUN: opt < %s -gvn -S | grep {DEAD = phi i32 }
11 ; XFAIL: *
22
33 ; FIXME: GVN should eliminate the fully redundant %9 GEP which
None ; RUN: opt %s -gvn -S | grep load
0 ; RUN: opt < %s -gvn -S | grep load
11 ; FIXME: This should be promotable, but memdep/gvn don't track values
22 ; path/edge sensitively enough.
33
None ; RUN: opt %s -gvn -S | grep {%DEAD = phi i32. }
0 ; RUN: opt < %s -gvn -S | grep {%DEAD = phi i32. }
11
22 define i32 @main(i32** %p) {
33 block1:
None ; RUN: opt %s -gvn -S | grep {%cv = phi i32}
1 ; RUN: opt %s -gvn -S | grep {%bv = phi i32}
0 ; RUN: opt < %s -gvn -S | grep {%cv = phi i32}
1 ; RUN: opt < %s -gvn -S | grep {%bv = phi i32}
22 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:128:128"
33 target triple = "i386-apple-darwin7"
44
None ; RUN: opt %s -gvn -S | grep {DEAD = phi i32 }
0 ; RUN: opt < %s -gvn -S | grep {DEAD = phi i32 }
11
22 define i32 @main(i32* %p) {
33 block1:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define void @_Z4sortI3Lit16LessThan_defaultIS0_EEvPT_iT0_() {
33 entry:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define void @strength_test5(i32* %data) {
33 entry:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 @.str1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
33 @.str2 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1]
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define fastcc void @compute_max_score_1() {
33 entry:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define void @vorbis_lsp_to_curve() {
33 entry:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define i32 @TreeCCStreamFlush(i8* %stream) {
33 entry:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define i64 @foo({ i32, i32 }** %__v) {
33 entry:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define i32* @_ZN6Solver9propagateEv(i32* %this) {
33 entry:
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11
22 define void @set_depth_values(i32 %level) {
33 cond_true90: ; preds = %cond_next84
None ; RUN: opt %s -gvnpre -S | grep tmp114115.gvnpre
0 ; RUN: opt < %s -gvnpre -S | grep tmp114115.gvnpre
11
22 %struct.AV = type { %struct.XPVAV*, i32, i32 }
33 %struct.CLONE_PARAMS = type { %struct.AV*, i32, %struct.PerlInterpreter* }
None ; RUN: opt %s -gvnpre | llvm-dis
0 ; RUN: opt < %s -gvnpre | llvm-dis
11 %"struct.ObjectArena" = type { i32, i32, %"struct.ResizeArray", i8*, i8* }
22 %"struct.ResizeArray" = type { i32 (...)**, %"struct.ResizeArrayRaw"* }
33 %"struct.ResizeArrayRaw" = type { i8**, i8*, i32, i32, i32, float, i32 }
None ; RUN: opt %s -gvnpre -S | not grep {%z3 =}
1 ; RUN: opt %s -gvnpre -S | not grep {%z9 =}
0 ; RUN: opt < %s -gvnpre -S | not grep {%z3 =}
1 ; RUN: opt < %s -gvnpre -S | not grep {%z9 =}
22
33 define i32 @main() {
44 block1:
None ; RUN: opt %s -gvnpre -S | grep b.gvnpre
0 ; RUN: opt < %s -gvnpre -S | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: opt %s -gvnpre -S | grep b.gvnpre
0 ; RUN: opt < %s -gvnpre -S | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: opt %s -gvnpre -S | grep b.gvnpre
0 ; RUN: opt < %s -gvnpre -S | grep b.gvnpre
11
22 define i32 @extract({ i32 }* %P) {
33 entry: ; preds = %cond_false, %entry
None ; RUN: opt %s -gvnpre -S | grep b.gvnpre
0 ; RUN: opt < %s -gvnpre -S | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: opt %s -gvnpre -S | grep b.gvnpre
0 ; RUN: opt < %s -gvnpre -S | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: opt %s -gvnpre -S | grep b.gvnpre
0 ; RUN: opt < %s -gvnpre -S | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: opt %s -globaldce
0 ; RUN: opt < %s -globaldce
11 ;
22 define internal void @func() {
33 ret void
None ; RUN: opt %s -globaldce
0 ; RUN: opt < %s -globaldce
11 ;
22
33 @X = global void ()* @func ; [#uses=0]
0 ; Make sure that functions are removed successfully if they are referred to by
11 ; a global that is dead. Make sure any globals they refer to die as well.
22
3 ; RUN: opt %s -globaldce -S | not grep foo
3 ; RUN: opt < %s -globaldce -S | not grep foo
44
55 ;; Unused, kills %foo
66 @b = internal global i32 ()* @foo ; [#uses=0]
0 ; This testcase tests that a worklist is being used, and that globals can be
11 ; removed if they are the subject of a constexpr and ConstantPointerRef
22
3 ; RUN: opt %s -globaldce -S | not grep global
3 ; RUN: opt < %s -globaldce -S | not grep global
44
55 @t0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1]
66 @t1 = internal global [4 x i8] c"bar\00" ; <[4 x i8]*> [#uses=1]
None ; RUN: opt %s -globaldce
0 ; RUN: opt < %s -globaldce
11
22 ;; Should die when function %foo is killed
33 @foo.upgrd.1 = internal global i32 7 ; [#uses=3]
0 ; distilled from 255.vortex
1 ; RUN: opt %s -globaldce -S | not grep testfunc
1 ; RUN: opt < %s -globaldce -S | not grep testfunc
22
33 declare i1 ()* @getfunc()
44
0 ; Weak variables should be preserved by global DCE!
11
2 ; RUN: opt %s -globaldce -S | grep @A
2 ; RUN: opt < %s -globaldce -S | grep @A
33
44
55 @A = weak global i32 54
None ; RUN: opt %s -globaldce -S | not grep @D
1 ; RUN: opt %s -globaldce -S | grep @L | count 3
0 ; RUN: opt < %s -globaldce -S | not grep @D
1 ; RUN: opt < %s -globaldce -S | grep @L | count 3
22
33 @A = global i32 0
44 @D = alias internal i32* @A
None ; RUN: opt %s -globaldce
0 ; RUN: opt < %s -globaldce
11
22 @A = alias internal void ()* @F
33 define internal void @F() { ret void }
None ; RUN: opt %s -globaldce | llc -O0 -o /dev/null
0 ; RUN: opt < %s -globaldce | llc -O0 -o /dev/null
11
22 %struct..0__pthread_mutex_s = type { i32, i32, i32, i32, i32, i32, %struct.__pthread_list_t }
33 %"struct.__gnu_cxx::_ConvertibleConcept" = type { i32 }
None ; RUN: opt %s -globaldce -S | not grep global
0 ; RUN: opt < %s -globaldce -S | not grep global
11
22 @X = external global i32
33 @Y = internal global i32 7
None ; RUN: opt %s -globaldce -S | not grep test_
0 ; RUN: opt < %s -globaldce -S | not grep test_
11
22 ; test_function should not be emitted to the .s file.
33 define available_externally i32 @test_function() {
None ; RUN: opt %s -globalopt
0 ; RUN: opt < %s -globalopt
11
22 @V = global float 1.200000e+01 ; [#uses=1]
33 @G = internal global i32* null ; [#uses=2]
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11 ; PR579
22
33 @g_40507551 = internal global i16 31038 ; [#uses=1]
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11 %RPyString = type { i32, %arraytype.Char }
22 %arraytype.Char = type { i32, [0 x i8] }
33 %arraytype.Signed = type { i32, [0 x i32] }
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11 ; PR820
22 target datalayout = "e-p:32:32"
33 target triple = "i686-pc-linux-gnu"
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11
22 %struct._list = type { i32*, %struct._list* }
33 %struct._play = type { i32, i32*, %struct._list*, %struct._play* }
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11
22 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32"
33 target triple = "thumb-apple-darwin8"
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11
22 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"
33 target triple = "i686-apple-darwin8"
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11 ; PR1491
22
33 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"
None ; RUN: opt %s -globalopt -disable-output
0 ; RUN: opt < %s -globalopt -disable-output
11 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-f128:64:128"
22 target triple = "powerpc-apple-darwin8"
33 %struct.empty0 = type { }
None ; RUN: opt %s -globalopt | llvm-dis
0 ; RUN: opt < %s -globalopt | llvm-dis
11 ; PR1896
22
33 @indirect1 = internal global void (i32)* null ; [#uses=2]
None ; RUN: opt %s -globalopt -S | grep {16 x .31 x double.. zeroinitializer}
0 ; RUN: opt < %s -globalopt -S | grep {16 x .31 x double.. zeroinitializer}
11
22 ; The 'X' indices could be larger than 31. Do not SROA the outer indices of this array.
33 @mm = internal global [16 x [31 x double]] zeroinitializer, align 32
None ; RUN: opt %s -globalopt -S | grep {volatile load}
0 ; RUN: opt < %s -globalopt -S | grep {volatile load}
11 @t0.1441 = internal global double 0x3FD5555555555555, align 8 ; [#uses=1]
22
33 define double @foo() nounwind {
None ; RUN: opt %s -globalopt -S | grep { nest } | count 1
0 ; RUN: opt < %s -globalopt -S | grep { nest } | count 1
11 %struct.FRAME.nest = type { i32, i32 (i32)* }
22 %struct.__builtin_trampoline = type { [10 x i8] }
33 @.str = internal constant [7 x i8] c"%d %d\0A\00" ; <[7 x i8]*> [#uses=1]
11 ; alignments. Elements 0 and 2 must be 16-byte aligned, and element
22 ; 1 must be at least 8 byte aligned (but could be more).
33
4 ; RUN: opt %s -globalopt -S | grep {@G.0 = internal global .*align 16}
5 ; RUN: opt %s -globalopt -S | grep {@G.1 = internal global .*align 8}
6 ; RUN: opt %s -globalopt -S | grep {@G.2 = internal global .*align 16}
4 ; RUN: opt < %s -globalopt -S | grep {@G.0 = internal global .*align 16}
5 ; RUN: opt < %s -globalopt -S | grep {@G.1 = internal global .*align 8}
6 ; RUN: opt < %s -globalopt -S | grep {@G.2 = internal global .*align 16}
77 ; rdar://5891920
88
99 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
11 ; values. This used to crash, because globalopt forgot to put the new var in the
22 ; same address space as the old one.
33
4 ; RUN: opt %s -globalopt -S > %t
4 ; RUN: opt < %s -globalopt -S > %t
55 ; Check that the new global values still have their address space
66 ; RUN: cat %t | grep global.*addrspace
77
None ; RUN: opt %s -globalopt | llvm-dis
0 ; RUN: opt < %s -globalopt | llvm-dis
11 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:128:128"
22 target triple = "i386-apple-darwin7"
33 %struct.foo = type { i32, i32 }
None ; RUN: opt %s -globalopt | llvm-dis
0 ; RUN: opt < %s -globalopt | llvm-dis
11 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:128:128"
22 target triple = "i386-apple-darwin7"
33 %struct.foo = type { i32, i32 }
None ; RUN: opt %s -globalopt -S | grep {phi.*@head}
0 ; RUN: opt < %s -globalopt -S | grep {phi.*@head}
11 ; PR3321
22 target datalayout = "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"
33 target triple = "x86_64-unknown-linux-gnu"
None ; RUN: opt %s -globalopt
0 ; RUN: opt < %s -globalopt
11
22 @g = external global i32
33
None ; RUN: opt %s -globalopt -S | grep {define void @a}
0 ; RUN: opt < %s -globalopt -S | grep {define void @a}
11
22 define internal void @f() {
33 ret void
None ; RUN: opt %s -globalopt -S | not grep global_variable42
0 ; RUN: opt < %s -globalopt -S | not grep global_variable42
11 ; XFAIL: *
22
33 %llvm.dbg.anchor.type = type { i32, i32 }
None ; RUN: opt %s -globalopt -stats -disable-output |& grep "1 globalopt - Number of global vars shrunk to booleans"
0 ; RUN: opt < %s -globalopt -stats -disable-output |& grep "1 globalopt - Number of global vars shrunk to booleans"
11 ; XFAIL: *
22
33 type { } ; type %0
None ; RUN: opt %s -globalopt -S | grep internal | count 2
0 ; RUN: opt < %s -globalopt -S | grep internal | count 2
11
22 global i32 0
33 define i32* @1() {
None ; RUN: opt %s -globalopt -S | grep {@X = internal global i32}
0 ; RUN: opt < %s -globalopt -S | grep {@X = internal global i32}
11 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:128:128"
22 target triple = "i386-apple-darwin7"
33 @X = internal global i32* null ; [#uses=2]
None ; RUN: opt %s -globalopt
0 ; RUN: opt < %s -globalopt
11
22 %struct.s_annealing_sched = type { i32, float, float, float, float }
33 %struct.s_bb = type { i32, i32, i32, i32 }
None ; RUN: opt %s -globalopt -S > %t
0 ; RUN: opt < %s -globalopt -S > %t
11 ; RUN: cat %t | grep foo1 | count 1
22 ; RUN: cat %t | grep foo2 | count 4
33 ; RUN: cat %t | grep bar1 | count 1
None ; RUN: opt %s -globalopt -S | not grep global
0 ; RUN: opt < %s -globalopt -S | not grep global
11
22 @X = internal global i32 4 ; [#uses=1]
33
None ; RUN: opt %s -instcombine -globalopt -S | \
0 ; RUN: opt < %s -instcombine -globalopt -S | \
11 ; RUN: grep {internal fastcc float @foo}
22
33 define internal float @foo() {
None ; RUN: opt %s -globalopt -S | not grep CTOR
0 ; RUN: opt < %s -globalopt -S | not grep CTOR
11 @llvm.global_ctors = appending global [10 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR1 }, { i32, void ()* } { i32 65535, void ()* @CTOR2 }, { i32, void ()* } { i32 65535, void ()* @CTOR3 }, { i32, void ()* } { i32 65535, void ()* @CTOR4 }, { i32, void ()* } { i32 65535, void ()* @CTOR5 }, { i32, void ()* } { i32 65535, void ()* @CTOR6 }, { i32, void ()* } { i32 65535, void ()* @CTOR7 }, { i32, void ()* } { i32 65535, void ()* @CTOR8 }, { i32, void ()* } { i32 2147483647, void ()* null } ] ; <[10 x { i32, void ()* }]*> [#uses=0]
22 @G = global i32 0 ; [#uses=1]
33 @G2 = global i32 0 ; [#uses=1]
None ; RUN: opt %s -globalopt -S | FileCheck %s
0 ; RUN: opt < %s -globalopt -S | FileCheck %s
11
22 ; Don't get fooled by the inbounds keyword; it doesn't change
33 ; the computed address.
None ; RUN: opt %s -globalopt -S | not grep CTOR⏎</