llvm.org GIT mirror llvm / b1e1e82
Change these tests to feed the assembly files to opt directly, instead of using llvm-as, now that opt supports this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
1404 changed file(s) with 1514 addition(s) and 1514 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llvm-as < %s | opt -anders-aa -disable-output
0 ; RUN: opt %s -anders-aa -disable-output
11
22 define void @x(i16 %Y) {
33 entry:
None ; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis | not grep undef
0 ; RUN: opt %s -anders-aa -gvn | llvm-dis | not grep undef
11 ; PR2160
22
33 declare void @f(i32*)
None ; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis | not grep undef
0 ; RUN: opt %s -anders-aa -gvn | llvm-dis | not grep undef
11 ; PR2169
22
33 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -anders-aa -gvn -deadargelim | llvm-dis | grep store | not grep null
0 ; RUN: opt %s -anders-aa -gvn -deadargelim | llvm-dis | 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: llvm-as < %s | opt -anders-aa -gvn -instcombine | llvm-dis \
0 ; RUN: opt %s -anders-aa -gvn -instcombine | llvm-dis \
11 ; RUN: | grep {ret i1 true}
22
33 @G = internal global i32* null
None ; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis \
0 ; RUN: opt %s -anders-aa -gvn | llvm-dis \
11 ; RUN: | not grep {ret i32 undef}
22
33 ;; From PR 2160
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn -instcombine | llvm-dis | grep DONOTREMOVE
4 ; RUN: opt %s -gvn -instcombine | llvm-dis | grep DONOTREMOVE
55
66 define i32 @test() {
77 %A = alloca i32
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn -instcombine | llvm-dis | grep sub
0 ; RUN: opt %s -gvn -instcombine | llvm-dis | grep sub
11
22 ; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn -instcombine | llvm-dis | not grep sub
2 ; RUN: opt %s -gvn -instcombine | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -dse | llvm-dis | grep {store i32 0}
0 ; RUN: opt %s -dse | llvm-dis | grep {store i32 0}
11
22 define void @test({i32,i32 }* %P) {
33 %Q = getelementptr {i32,i32}* %P, i32 1
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | \
1 ; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | \
22 ; RUN: grep {sub i32}
3 ; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | \
3 ; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | \
44 ; RUN: not grep {ret i32 0}
55 ; END.
66
0 ; PR1600
1 ; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | \
1 ; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | \
22 ; RUN: grep {ret i32 0}
33 ; END.
44
None ; RUN: llvm-as < %s | opt -basicaa -gvn -dce | llvm-dis | grep tmp7
0 ; RUN: opt %s -basicaa -gvn -dce | llvm-dis | grep tmp7
11
22 %struct.A = type { i32 }
33 %struct.B = type { %struct.A }
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -std-compile-opts | llvm-dis | grep store
0 ; RUN: opt %s -std-compile-opts | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep load
0 ; RUN: opt %s -basicaa -gvn | llvm-dis | grep load
11
22 declare noalias i32* @noalias()
33
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {ret i32 1}
0 ; RUN: opt %s -gvn | llvm-dis | 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: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep load | count 1
0 ; RUN: opt %s -basicaa -gvn | llvm-dis | grep load | count 1
11
22 @flag0 = internal global i32 zeroinitializer
33 @turn = internal global i32 zeroinitializer
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -basicaa -gvn -instcombine -dce | llvm-dis | not grep REMOVE
3 ; RUN: opt %s -basicaa -gvn -instcombine -dce | llvm-dis | 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: llvm-as < %s | opt -basicaa -gvn -instcombine -dce \
4 ; RUN: opt %s -basicaa -gvn -instcombine -dce \
55 ; RUN: | llvm-dis | 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: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | not grep load
3 ; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | not grep load
44
55 @B = global i16 8 ; [#uses=2]
66
0 ; A very rudimentary test on AliasAnalysis::getModRefInfo.
1 ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | grep {ret i1 true}
0 ; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | 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: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | grep {ret i32 0}
0 ; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | grep {ret i32 0}
11
22 declare i32* @test(i32* nocapture)
33
None ; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestConst | count 2
1 ; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure | count 3
2 ; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestNone | count 4
0 ; RUN: opt %s -basicaa -gvn | llvm-dis | grep TestConst | count 2
1 ; RUN: opt %s -basicaa -gvn | llvm-dis | grep TestPure | count 3
2 ; RUN: opt %s -basicaa -gvn | llvm-dis | 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: llvm-as < %s | opt -basicaa -licm | llvm-dis | FileCheck %s
4 ; RUN: opt %s -basicaa -licm | llvm-dis | FileCheck %s
55
66 @A = global i32 7 ; [#uses=3]
77 @B = global i32 8 ; [#uses=2]
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | grep call | count 2
0 ; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | grep call | count 2
11
22 @g = internal global i32 0 ; [#uses=2]
33
None ; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | not grep load
0 ; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | not grep load
11 @X = internal global i32 4 ; [#uses=1]
22
33 define i32 @test(i32* %P) {
None ; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | not grep load
0 ; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | 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: llvm-as < %s | opt -globalsmodref-aa -gvn -instcombine | llvm-dis | \
0 ; RUN: opt %s -globalsmodref-aa -gvn -instcombine | llvm-dis | \
11 ; RUN: grep {ret i32 0}
22
33 @G = internal global i32* null ; [#uses=3]
None ; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | not grep load
0 ; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -postdomfrontier -disable-output
0 ; RUN: opt %s -postdomfrontier -disable-output
11
22 define void @SManager() {
33 entry:
None ; RUN: llvm-as < %s | opt -postdomfrontier -disable-output
0 ; RUN: opt %s -postdomfrontier -disable-output
11
22 define void @args_out_of_range() {
33 entry:
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -insert-edge-profiling | llvm-dis | FileCheck %s
1 ; RUN: opt %s -insert-edge-profiling | llvm-dis | FileCheck %s
22
33 ; ModuleID = ''
44
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep "icmp s"
0 ; RUN: opt %s -indvars -adce -simplifycfg | llvm-dis | grep "icmp s"
11 ; PR1598
22
33 define i32 @f(i32 %a, i32 %b, i32 %x, i32 %y) {
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -indvars | llvm-dis | grep printd | grep 1206807378
0 ; RUN: opt %s -indvars | llvm-dis | grep printd | grep 1206807378
11 ; PR1798
22
33 declare void @printd(i32)
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -analyze -scalar-evolution -disable-output
0 ; RUN: opt %s -analyze -scalar-evolution -disable-output
11 ; PR1827
22
33 declare void @use(i32)
None ; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output
0 ; RUN: opt %s -analyze -scalar-evolution -disable-output
11 ; PR2602
22
33 define i32 @a() nounwind {
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -analyze -scalar-evolution
0 ; RUN: opt %s -analyze -scalar-evolution
11 ; PR4501
22
33 define void @test() {
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -analyze -scalar-evolution -disable-output
0 ; RUN: opt %s -analyze -scalar-evolution -disable-output
11 ; PR4537
22
33 ; ModuleID = 'b.bc'
None ; RUN: llvm-as < %s | opt -iv-users
0 ; RUN: opt %s -iv-users
11 ; PR4538
22
33 ; ModuleID = 'bugpoint-reduced-simplified.bc'
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -indvars | llvm-dis > %t
0 ; RUN: opt %s -indvars | llvm-dis > %t
11 ; RUN: grep select %t | count 2
22 ; RUN: grep {icmp ne i32.\* %w } %t
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -indvars -disable-output
0 ; RUN: opt %s -indvars -disable-output
11 ; PR 3909
22
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep smax | count 2
1 ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \
0 ; RUN: opt %s -analyze -scalar-evolution -disable-output \
11 ; RUN: | FileCheck %s
22 ; PR4569
33
44 ; of the bug that was causing the Olden Health benchmark to output incorrect
55 ; results!
66 ;
7 ; RUN: llvm-as < %s | opt -constprop | llvm-dis > %t.1
7 ; RUN: opt %s -constprop | llvm-dis > %t.1
88 ; RUN: llvm-as < %s | llvm-dis | llvm-as | opt -constprop | \
99 ; RUN: llvm-dis > %t.2
1010 ; RUN: diff %t.1 %t.2
33 ; Check by running globaldce, which will remove the constant if there are
44 ; no references to it!
55 ;
6 ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | \
6 ; RUN: opt %s -globaldce | llvm-dis | \
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: llvm-as < %s | opt -instcombine | llvm-dis | llvm-as
3 ; RUN: opt %s -instcombine | llvm-dis | llvm-as
44
55 %CHESS_POSITION = type { i32, i32 }
66 @pawn_probes = external global i32 ; [#uses=0]
None ; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis | not grep br
0 ; RUN: opt %s -instcombine -simplifycfg | llvm-dis | not grep br
11
22 @.str_1 = internal constant [6 x i8] c"_Bool\00" ; <[6 x i8]*> [#uses=2]
33
None ; RUN: llvm-as < %s | opt -verify | llvm-dis | llvm-as -disable-output
0 ; RUN: opt %s -verify | llvm-dis | llvm-as -disable-output
11
22 define {i32, i8} @foo(i32 %p) {
33 ret i32 1, i8 2
None ; RUN: llvm-as < %s | opt -strip | llvm-dis | llvm-as | llvm-dis
0 ; RUN: opt %s -strip | llvm-dis | llvm-as | llvm-dis
11
22 ; Stripping the name from A should not break references to it.
33 %A = type opaque
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis
0 ; RUN: opt %s -constprop | llvm-dis
11 ; PR3465
22
33 define double @test() {
None ; RUN: llvm-as < %s | opt -anders-aa -argpromotion
0 ; RUN: opt %s -anders-aa -argpromotion
11
22 declare void @llvm.gcroot(i8**, i8*)
33
None ; RUN: llvm-as < %s | opt -deadargelim
0 ; RUN: opt %s -deadargelim
11
22 declare void @llvm.gcroot(i8**, i8*)
33
None ; RUN: llvm-as < %s | opt -inline | llvm-dis | grep example
0 ; RUN: opt %s -inline | llvm-dis | grep example
11
22 %IntArray = type { i32, [0 x i32*] }
33
None ; RUN: llvm-as < %s | opt -inline | llvm-dis | grep sample
1 ; RUN: llvm-as < %s | opt -inline | llvm-dis | grep example
0 ; RUN: opt %s -inline | llvm-dis | grep sample
1 ; RUN: opt %s -inline | llvm-dis | grep example
22
33 %IntArray = type { i32, [0 x i32*] }
44
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -instcombine | \
0 ; RUN: opt %s -instcombine | \
11 ; RUN: llc -march=ppc32 -mcpu=g5 | not grep vperm
22 ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 > %t
33 ; RUN: grep vsldoi %t | count 2
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 302245289961712575840256
1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep K40018000000000000000
0 ; RUN: opt %s -instcombine | llvm-dis | grep 302245289961712575840256
1 ; RUN: opt %s -instcombine | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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
0 ; RUN: llvm-as < %s | llc
1 ; RUN: llvm-as < %s | llc -O0
1 ; RUN: llc %s -o - -O0
22 %llvm.dbg.anchor.type = type { i32, i32 }
33 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
44 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
None ; RUN: llvm-as < %s | llc -o /dev/null -verify-dom-info
0 ; RUN: llc %s -o /dev/null -verify-dom-info
11 %llvm.dbg.anchor.type = type { i32, i32 }
22 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* }
33 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
None ; RUN: llvm-as < %s | llc -o /dev/null
0 ; RUN: llc %s -o /dev/null
11
22 %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }*, i8*, i8* }
33 @llvm.dbg.variable24 = external constant %llvm.dbg.variable.type ; <%llvm.dbg.variable.type*> [#uses=1]
None ; RUN: llvm-as < %s | llc -o /dev/null
0 ; RUN: llc %s -o /dev/null
11 %llvm.dbg.anchor.type = type { i32, i32 }
22 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* }
33 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
None ; RUN: llvm-as < %s | llc -o /dev/null
0 ; RUN: llc %s -o /dev/null
11 %llvm.dbg.anchor.type = type { i32, i32 }
22 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
33 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* }
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep store | count 5
0 ; RUN: opt %s -instcombine | llvm-dis | 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: llvm-as < %s | opt -instcombine | llvm-dis | not grep alloca
0 ; RUN: opt %s -instcombine | llvm-dis | 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: llvm-as < %s | opt -instcombine | llvm-dis | not grep alloca
0 ; RUN: opt %s -instcombine | llvm-dis | 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: llvm-as < %s | llc -o /dev/null
0 ; RUN: llc %s -o /dev/null
11 %llvm.dbg.anchor.type = type { i32, i32 }
22 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
33 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 }
0 ; RUN: llvm-as < %s | llc
1 ; RUN: llvm-as < %s | llc -O0
1 ; RUN: llc %s -o - -O0
22 %llvm.dbg.anchor.type = type { i32, i32 }
33 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
44 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
11 ; 2009-06-12-InlineFunctStart.ll with one change. In function main, the bb1
22 ; does not have llvm.dbg.stoppiont intrinsic before llvm.dbg.func.start.
33 ; RUN: llvm-as < %s | llc
4 ; RUN: llvm-as < %s | llc -O0
4 ; RUN: llc %s -o - -O0
55 %llvm.dbg.anchor.type = type { i32, i32 }
66 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
77 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
None ; RUN: llvm-as < %s | llc -asm-verbose -O0 | not grep ".long 0x0 ## DW_AT_abstract_origin"
0 ; RUN: llc %s -o - -asm-verbose -O0 | not grep ".long 0x0 ## DW_AT_abstract_origin"
11
22 %llvm.dbg.anchor.type = type { i32, i32 }
33 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
None ; RUN: llvm-as < %s | llc -O0 | grep "label" | count 8
0 ; RUN: llc %s -o - -O0 | grep "label" | count 8
11 ; PR2614
22 ; XFAIL: *
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -load=%llvmlibsdir/LLVMHello%shlibext -hello \
2 ; RUN: -disable-output - |& grep Hello
1 ; RUN: opt %s -load=%llvmlibsdir/LLVMHello%shlibext -hello \
2 ; RUN: -disable-output |& grep Hello
33
44 @junk = global i32 0
55
None ; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis > %t
0 ; RUN: opt %s -std-compile-opts | llvm-dis > %t
11 ; RUN: grep undef %t | count 1
22 ; RUN: grep 5 %t | count 1
33 ; RUN: grep 7 %t | count 1
None ; RUN: llvm-as < %s | llc -o - | %llvmgcc -xassembler -c -o /dev/null -
0 ; RUN: llc %s -o - | %llvmgcc -xassembler -c -o /dev/null -
11 ; PR2609
22 %struct..0._11 = type { i32 }
33 %struct..1__pthread_mutex_s = type { i32, i32, i32, i32, i32, %struct..0._11 }
0 ; Call graph construction crash: Not handling indirect calls right
11 ;
2 ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -analyze -loops | \
4 ; RUN: opt %s -analyze -loops | \
55 ; RUN: grep { Loop at depth 3 containing: %Inner
}
66 ;
77 define void @test() {
None ;RUN: llvm-as < %s | opt -codegenprepare -disable-output
0 ;RUN: opt %s -codegenprepare -disable-output
11
22 define void @foo() {
33 entry:
None ;RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -instcombine | llvm-dis | grep true
0 ; RUN: opt %s -instcombine | llvm-dis | 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: llvm-as < %s | opt -inline -internalize -disable-output
0 ; RUN: opt %s -inline -internalize -disable-output
11 define void @foo() nounwind {
22 ret void
33 }
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -verify | llvm-dis | grep noimplicitfloat
1 ; RUN: opt %s -verify | llvm-dis | 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: llvm-as < %s | opt -adce | llvm-dis | grep BB1
2 ; RUN: opt %s -adce | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -adce
2 ; RUN: opt %s -adce
33
44 @bk = external global i32 ; [#uses=2]
55 @hufts = external global i32 ; [#uses=1]
0 ; Testcase reduced from 197.parser by bugpoint
1 ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -adce
4 ; RUN: opt %s -adce
55
66 target datalayout = "e-p:32:32"
77
None ; RUN: llvm-as < %s | opt -adce -disable-output
0 ; RUN: opt %s -adce -disable-output
11
22 @G = external global i32* ; [#uses=1]
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -adce -simplifycfg | llvm-dis | not grep then:
0 ; RUN: opt %s -adce -simplifycfg | llvm-dis | not grep then:
11
22 define void @dead_test8(i32* %data.1, i32 %idx.1) {
33 entry:
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -adce -disable-output
0 ; RUN: opt %s -adce -disable-output
11
22 define i32 @main() {
33 br label %loop
None ; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis | grep call
0 ; RUN: opt %s -adce -simplifycfg | llvm-dis | grep call
11 declare void @exit(i32)
22
33 define i32 @main(i32 %argc) {
None ; RUN: llvm-as < %s | opt -adce -disable-output
0 ; RUN: opt %s -adce -disable-output
11
22 define void @test() {
33 entry:
None ; RUN: llvm-as < %s | opt -adce -disable-output
0 ; RUN: opt %s -adce -disable-output
11
22 declare void @strlen()
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -adce | llvm-dis | not grep call
0 ; RUN: opt %s -adce | llvm-dis | not grep call
11
22 declare i32 @strlen(i8*) readonly nounwind
33
None ; RUN: llvm-as < %s | opt -adce | llvm-dis | grep null
0 ; RUN: opt %s -adce | llvm-dis | grep null
11
22 declare i32 @strlen(i8*) readnone
33
None ; RUN: llvm-as < %s | opt -adce -disable-output
0 ; RUN: opt %s -adce -disable-output
11
22 define void @test() {
33 unreachable
None ; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep nounwind | count 2
0 ; RUN: opt %s -argpromotion | llvm-dis | grep nounwind | count 2
11
22 define internal i32 @deref(i32* %x) nounwind {
33 entry:
None ; RUN: llvm-as < %s | opt -argpromotion | llvm-dis > %t
0 ; RUN: opt %s -argpromotion | llvm-dis > %t
11 ; RUN: cat %t | grep {define.*@callee(.*i32\\*}
22 ; PR2498
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -argpromotion -instcombine | llvm-dis | not grep load
0 ; RUN: opt %s -argpromotion -instcombine | llvm-dis | not grep load
11
22 %QuadTy = type { i32, i32, i32, i32 }
33 @G = constant %QuadTy {
None ; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep zeroext
0 ; RUN: opt %s -argpromotion | llvm-dis | grep zeroext
11
22 %struct.ss = type { i32, i64 }
33
None ; RUN: llvm-as < %s | opt -argpromotion -mem2reg | llvm-dis | not grep alloca
0 ; RUN: opt %s -argpromotion -mem2reg | llvm-dis | 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: llvm-as < %s | opt -argpromotion | llvm-dis | grep -F {i32* byval} | count 2
0 ; RUN: opt %s -argpromotion | llvm-dis | 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: llvm-as < %s | opt -argpromotion -scalarrepl | llvm-dis | not grep load
0 ; RUN: opt %s -argpromotion -scalarrepl | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -argpromotion -instcombine | llvm-dis | not grep load
0 ; RUN: opt %s -argpromotion -instcombine | llvm-dis | not grep load
11
22 @G1 = constant i32 0 ; [#uses=1]
33 @G2 = constant i32* @G1 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | \
0 ; RUN: opt %s -argpromotion | llvm-dis | \
11 ; RUN: not grep {load i32\* null}
22
33 define internal i32 @callee(i1 %C, i32* %P) {
None ; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | \
0 ; RUN: opt %s -argpromotion | llvm-dis | \
11 ; RUN: grep {load i32\\* %A}
22
33 define internal i32 @callee(i1 %C, i32* %P) {
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -loop-extract -disable-output
0 ; RUN: opt %s -loop-extract -disable-output
11
22 define void @solve() {
33 entry:
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -loop-extract-single -disable-output
0 ; RUN: opt %s -loop-extract-single -disable-output
11
22 define void @ab() {
33 entry:
None ; RUN: llvm-as < %s | opt -loop-extract -disable-output
0 ; RUN: opt %s -loop-extract -disable-output
11
22 define void @sendMTFValues() {
33 entry:
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -loop-extract -disable-output
0 ; RUN: opt %s -loop-extract -disable-output
11
22 define void @maketree() {
33 entry:
None ; RUN: llvm-as < %s | opt -loop-extract -disable-output
0 ; RUN: opt %s -loop-extract -disable-output
11
22 declare i32 @_IO_getc()
33
None ; RUN: llvm-as < %s | opt -extract-blocks -disable-output
0 ; RUN: opt %s -extract-blocks -disable-output
11
22 define void @test1() {
33 no_exit.0.i:
None ; RUN: llvm-as < %s | opt -extract-blocks -disable-output
0 ; RUN: opt %s -extract-blocks -disable-output
11 define i32 @foo() {
22 br label %EB
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -condprop -disable-output
0 ; RUN: opt %s -condprop -disable-output
11 ; PR979
22
33 target datalayout = "e-p:32:32"
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -condprop | llvm-dis | \
0 ; RUN: opt %s -condprop | llvm-dis | \
11 ; RUN: not grep {br label}
22
33 %llvm.dbg.anchor.type = type { i32, i32 }
None ; RUN: llvm-as < %s | opt -condprop | llvm-dis | \
0 ; RUN: opt %s -condprop | llvm-dis | \
11 ; RUN: not grep {br label}
2 ; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep T2
2 ; RUN: opt %s -condprop | llvm-dis | not grep T2
33
44
55 define i32 @test(i1 %C) {
None ; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi
0 ; RUN: opt %s -condprop | llvm-dis | not grep phi
11
22 define i32 @test(i32 %C, i1 %Val) {
33 switch i32 %C, label %T1 [
None ; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi
0 ; RUN: opt %s -condprop | llvm-dis | not grep phi
11
22 declare i1 @foo()
33
None ; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi
0 ; RUN: opt %s -condprop | llvm-dis | not grep phi
11
22 define i32 @foo(i1, i32, i32) {
33 prologue:
0 ; Make sure that the constant propogator doesn't divide by zero!
11 ;
2 ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -constprop | llvm-dis | \
6 ; RUN: opt %s -constprop | llvm-dis | \
77 ; RUN: not grep {i32 0}
88
99 define i32 @test1() {
0 ; SetCC on boolean values was not implemented!
11
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | \
2 ; RUN: opt %s -constprop -die | llvm-dis | \
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: llvm-as < %s | opt -constprop
2 ; RUN: opt %s -constprop
33 ;
44
55 define i32 @test() {
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
0 ; RUN: opt %s -constprop | llvm-dis | \
11 ; RUN: not grep {ret i1 false}
22
33 @b = external global [2 x { }] ; <[2 x { }]*> [#uses=2]
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
0 ; RUN: opt %s -constprop | llvm-dis | \
11 ; RUN: grep {i32 -1}
2 ; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
2 ; RUN: opt %s -constprop | llvm-dis | \
33 ; RUN: not grep zeroinitializer
44
55 define <4 x i32> @test() {
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
0 ; RUN: opt %s -instcombine | llvm-dis | \
11 ; RUN: grep {ret i1 false}
22 define i1 @test() {
33 %X = trunc i32 320 to i1 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
0 ; RUN: opt %s -constprop | llvm-dis | \
11 ; RUN: grep {ret i32 -1}
2 ; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
2 ; RUN: opt %s -constprop | llvm-dis | \
33 ; RUN: grep {ret i32 1}
44
55 define i32 @test1() {
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep 1065353216
0 ; RUN: opt %s -constprop | llvm-dis | grep 1065353216
11
22 define i32 @test() {
33 %A = bitcast float 1.000000e+00 to i32 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep {ret i13 13}
0 ; RUN: opt %s -constprop | llvm-dis | grep {ret i13 13}
11 ; PR1816
22 declare i13 @llvm.cttz.i13(i13)
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -constprop -die | llvm-dis | not grep add
3 ; RUN: opt %s -constprop -die | llvm-dis | not grep add
44
55 define i32 @test(i1 %B) {
66 br i1 %B, label %BB1, label %BB2
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
0 ; RUN: opt %s -instcombine | llvm-dis | not grep bitcast
11 ; PR2165
22
33 define <1 x i64> @test() {
0 ; bswap should be constant folded when it is passed a constant argument
11
2 ; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep call
2 ; RUN: opt %s -constprop | llvm-dis | not grep call
33
44 declare i16 @llvm.bswap.i16(i16)
55
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep call
0 ; RUN: opt %s -constprop | llvm-dis | not grep call
11
22 declare double @cos(double)
33
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0}
0 ; RUN: opt %s -instcombine | llvm-dis | grep {ret i32 0}
11 ; PR4424
22 declare void @ext()
33
None ; RUN: llvm-as < %s | opt -constprop | llvm-dis | \
0 ; RUN: opt %s -constprop | llvm-dis | \
11 ; RUN: grep -F {ret i32* null} | count 2
22
33 define i32* @test1() {
0 ; Ensure constant propogation of logical instructions is working correctly.
11
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | \
2 ; RUN: opt %s -constprop -die | llvm-dis | \
33 ; RUN: not egrep {and|or|xor}
44
55 define i32 @test1() {
0 ; Ensure constant propogation of 'not' instructions is working correctly.
11
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep xor
2 ; RUN: opt %s -constprop -die | llvm-dis | not grep xor
33
44 define i32 @test1() {
55 %R = xor i32 4, -1 ; [#uses=1]
0 ; This is a basic sanity check for constant propogation. The add instruction
11 ; should be eliminated.
22
3 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep phi
3 ; RUN: opt %s -constprop -die | llvm-dis | not grep phi
44
55 define i32 @test(i1 %B) {
66 BB0:
0 ; Ensure constant propagation of remainder instructions is working correctly.
11
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep rem
2 ; RUN: opt %s -constprop -die | llvm-dis | not grep rem
33
44 define i32 @test1() {
55 %R = srem i32 4, 3 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -constmerge | llvm-dis | grep foo
1 ; RUN: llvm-as < %s | opt -constmerge | llvm-dis | grep bar
0 ; RUN: opt %s -constmerge | llvm-dis | grep foo
1 ; RUN: opt %s -constmerge | llvm-dis | grep bar
22
33 ; Don't merge constants in different sections.
44
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -deadargelim | llvm-dis | grep {@test(}
1 ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep dead
0 ; RUN: opt %s -deadargelim | llvm-dis | grep {@test(}
1 ; RUN: opt %s -deadargelim | llvm-dis | not grep dead
22
33 define internal i32 @test(i32 %X, i32 %dead) {
44 ret i32 %X
None ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep {ret i32 0}
0 ; RUN: opt %s -deadargelim | llvm-dis | not grep {ret i32 0}
11 ; PR1735
22
33 define internal i32 @test(i32 %A, ...) {
None ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t
0 ; RUN: opt %s -deadargelim | llvm-dis > %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: llvm-as < %s | opt -deadargelim | llvm-dis | grep byval
0 ; RUN: opt %s -deadargelim | llvm-dis | 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: llvm-as < %s | opt -deadargelim -die | llvm-dis > %t
0 ; RUN: opt %s -deadargelim -die | llvm-dis > %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: llvm-as < %s | opt -deadargelim | llvm-dis
0 ; RUN: opt %s -deadargelim | llvm-dis
11 ; PR3807
22
33 define internal { i32, i32 } @foo() {
None ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEADARG
0 ; RUN: opt %s -deadargelim | llvm-dis | 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: llvm-as < %s | opt -deadargelim | llvm-dis > %t
1 ; RUN: opt %s -deadargelim | llvm-dis > %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: llvm-as < %s | opt -deadargelim | llvm-dis | not grep 47
1 ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep 1.0
0 ; RUN: opt %s -deadargelim | llvm-dis | not grep 47
1 ; RUN: opt %s -deadargelim | llvm-dis | 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: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEAD
0 ; RUN: opt %s -deadargelim | llvm-dis | not grep DEAD
11
22 ; Dead arg only used by dead retval
33 define internal i32 @test(i32 %DEADARG) {
None ; RUN: llvm-as < %s | opt -deadargelim -die | llvm-dis > %t
0 ; RUN: opt %s -deadargelim -die | llvm-dis > %t
11 ; RUN: cat %t | not grep DEAD
22 ; RUN: cat %t | grep LIVE | count 4
33
None ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t
0 ; RUN: opt %s -deadargelim | llvm-dis > %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: llvm-as < %s | opt -deadargelim -instcombine -dce | llvm-dis | not grep i16
4 ; RUN: opt %s -deadargelim -instcombine -dce | llvm-dis | not grep i16
55
66 define internal {i16, i32} @test(i16 %DEADARG) {
77 %A = insertvalue {i16,i32} undef, i16 1, 0
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -dse | llvm-dis | \
0 ; RUN: opt %s -dse | llvm-dis | \
11 ; RUN: grep {store i32 1234567}
22
33 ; Do not delete stores that are only partially killed.
None ; RUN: llvm-as < %s | opt -dse | llvm-dis | grep store
0 ; RUN: opt %s -dse | llvm-dis | grep store
11
22 define double @foo(i8* %X) {
33 %X_addr = alloca i8* ; [#uses=2]
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -dse | llvm-dis | not grep tmp5
0 ; RUN: opt %s -dse | llvm-dis | not grep tmp5
11 ; PR2599
22
33 define void @foo({ i32, i32 }* %x) nounwind {
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -dse | llvm-dis | \
0 ; RUN: opt %s -dse | llvm-dis | \
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: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
0 ; RUN: opt %s -dse | llvm-dis | not grep DEAD
11
22 define void @test(i32* %Q) {
33 %P = alloca i32 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep store
0 ; RUN: opt %s -dse | llvm-dis | not grep store
11
22 %struct.x = type { i32, i32, i32, i32 }
33
None ; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
0 ; RUN: opt %s -dse | llvm-dis | not grep DEAD
11
22 declare void @ext()
33
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
0 ; RUN: opt %s -dse | llvm-dis | not grep DEAD
11
22 define void @test(i32* %Q, i32* %P) {
33 %DEAD = load i32* %Q ; [#uses=1]
None ; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep alloca
0 ; RUN: opt %s -dse | llvm-dis | 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: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
0 ; RUN: opt %s -dse | llvm-dis | not grep DEAD
11
22 define void @test(i32* %Q, i32* %P) {
33 %DEAD = load i32* %Q ; [#uses=1]
None ; RUN: llvm-as < %s | opt -dse | llvm-dis | grep {volatile load}
0 ; RUN: opt %s -dse | llvm-dis | grep {volatile load}
11
22 @g_1 = global i32 0
33
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone
0 ; RUN: opt %s -functionattrs | llvm-dis | grep readnone
11
22 define i32 @a() {
33 %tmp = call i32 @b( ) ; [#uses=1]
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone | count 4
0 ; RUN: opt %s -functionattrs | llvm-dis | grep readnone | count 4
11 @x = global i32 0
22
33 declare i32 @e() readnone
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readonly | count 2
0 ; RUN: opt %s -functionattrs | llvm-dis | grep readonly | count 2
11
22 define i32 @f() {
33 entry:
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep read
0 ; RUN: opt %s -functionattrs | llvm-dis | not grep read
11 ; PR2792
22
33 @g = global i32 0 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone | count 2
0 ; RUN: opt %s -functionattrs | llvm-dis | grep readnone | count 2
11
22 declare i32 @g(i32*) readnone
33
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone
0 ; RUN: opt %s -functionattrs | llvm-dis | grep readnone
11
22 @s = external constant i8 ; [#uses=1]
33
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep {nocapture *%%q}
1 ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep {nocapture *%%p} | count 6
0 ; RUN: opt %s -functionattrs | llvm-dis | not grep {nocapture *%%q}
1 ; RUN: opt %s -functionattrs | llvm-dis | grep {nocapture *%%p} | count 6
22 @g = global i32* null ; [#uses=1]
33
44 define i32* @c1(i32* %q) {
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep {nocapture *%%q}
1 ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep {nocapture *%%p}
0 ; RUN: opt %s -functionattrs | llvm-dis | not grep {nocapture *%%q}
1 ; RUN: opt %s -functionattrs | llvm-dis | grep {nocapture *%%p}
22
33 define i32* @a(i32** %p) {
44 %tmp = load i32** %p
None ; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep read
0 ; RUN: opt %s -functionattrs | llvm-dis | not grep read
11 ; PR3754
22
33 define i8* @m(i32 %size) {
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp10 =}
0 ; RUN: opt %s -gvn | llvm-dis | not grep {tmp10 =}
11
22 %struct.INT2 = type { i32, i32 }
33 @blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2]
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp17625.* = phi i32. }
1 ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp17631.* = phi i32. }
0 ; RUN: opt %s -gvn | llvm-dis | grep {tmp17625.* = phi i32. }
1 ; RUN: opt %s -gvn | llvm-dis | grep {tmp17631.* = phi i32. }
22
33 @last = external global [65 x i32*] ; <[65 x i32*]*> [#uses=1]
44
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis
0 ; RUN: opt %s -gvn | llvm-dis
11
22 @bsLive = external global i32 ; [#uses=2]
33
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp298316 = phi i32 }
0 ; RUN: opt %s -gvn | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp47 = phi i32 }
0 ; RUN: opt %s -gvn | llvm-dis | 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: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp701 =}
0 ; RUN: opt %s -gvn | llvm-dis | not grep {tmp701 =}
11
22 @img_width = external global i16 ; [#uses=2]
33
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep load
0 ; RUN: opt %s -gvn | llvm-dis | not grep load
11 ; PR1996
22
33 %struct.anon = type { i32, i8, i8, i8, i8 }
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn -dse | llvm-dis | grep {call.*memcpy} | count 1
0 ; RUN: opt %s -gvn -dse | llvm-dis | 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: llvm-as < %s | opt -gvn -dse | llvm-dis | grep {call.*memcpy.*cell} | count 2
0 ; RUN: opt %s -gvn -dse | llvm-dis | 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: llvm-as < %s | opt -gvn | llvm-dis | grep {ret i8 \[%\]tmp3}
0 ; RUN: opt %s -gvn | llvm-dis | grep {ret i8 \[%\]tmp3}
11 ; PR2503
22
33 @g_3 = external global i8 ; [#uses=2]
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep getelementptr | count 1
0 ; RUN: opt %s -gvn | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn -disable-output
0 ; RUN: opt %s -gvn -disable-output
11 ; PR3775
22
33 ; ModuleID = 'bugpoint-reduced-simplified.bc'
None ; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis | not grep pre1
0 ; RUN: opt %s -gvn -enable-load-pre | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -gvn | llvm-dis | not grep {%z2 =}
0 ; RUN: opt %s -gvn | llvm-dis | not grep {%z2 =}
11
22 define i32 @main() {
33 block1:
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep tmp2
0 ; RUN: opt %s -gvn | llvm-dis | not grep tmp2
11 ; PR2213
22
33 define i32* @f(i8* %x) {
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep strlen | count 2
0 ; RUN: opt %s -gvn | llvm-dis | 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: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep {call.*strlen} | count 1
0 ; RUN: opt %s -basicaa -gvn | llvm-dis | 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: llvm-as < %s | opt -gvn | llvm-dis | grep {br i1 false}
0 ; RUN: opt %s -gvn | llvm-dis | grep {br i1 false}
11
22 @a = external global i32 ; [#uses=7]
33
None ; RUN: llvm-as < %s | opt -gvn -instcombine | llvm-dis | grep {ret i32 0}
0 ; RUN: opt %s -gvn -instcombine | llvm-dis | grep {ret i32 0}
11 ; PR4189
22 @G = external constant [4 x i32]
33
None ; RUN: llvm-as < %s | opt -gvn -enable-pre | llvm-dis | grep {b.pre}
0 ; RUN: opt %s -gvn -enable-pre | llvm-dis | grep {b.pre}
11
22 define i32 @main(i32 %p) {
33 block1:
None ; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis | grep {%PRE = phi}
0 ; RUN: opt %s -gvn -enable-load-pre | llvm-dis | grep {%PRE = phi}
11
22 define i32 @test(i32* %p, i1 %C) {
33 block1:
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep DEADLOAD
1 ; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep DEADGEP
0 ; RUN: opt %s -gvn | llvm-dis | not grep DEADLOAD
1 ; RUN: opt %s -gvn | llvm-dis | not grep DEADGEP
22
33 define i32 @main(i32** %p) {
44 block1:
None ; RUN: llvm-as < %s | opt -gvn -enable-pre | llvm-dis | grep {.pre}
0 ; RUN: opt %s -gvn -enable-pre | llvm-dis | grep {.pre}
11
22 @H = common global i32 0 ; [#uses=2]
33 @G = common global i32 0 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis | not grep {tmp3 = load}
0 ; RUN: opt %s -gvn -enable-load-pre | llvm-dis | not grep {tmp3 = load}
11
22 @p = external global i32
33 define i32 @f(i32 %n) nounwind {
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep load | count 2
0 ; RUN: opt %s -gvn | llvm-dis | grep load | count 2
11
22 define i32 @main(i32** %p) {
33 block1:
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {DEAD = phi i32 }
0 ; RUN: opt %s -gvn | llvm-dis | grep {DEAD = phi i32 }
11 ; XFAIL: *
22
33 ; FIXME: GVN should eliminate the fully redundant %9 GEP which
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep load
0 ; RUN: opt %s -gvn | llvm-dis | grep load
11 ; FIXME: This should be promotable, but memdep/gvn don't track values
22 ; path/edge sensitively enough.
33
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {%DEAD = phi i32. }
0 ; RUN: opt %s -gvn | llvm-dis | grep {%DEAD = phi i32. }
11
22 define i32 @main(i32** %p) {
33 block1:
None ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {%cv = phi i32}
1 ; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {%bv = phi i32}
0 ; RUN: opt %s -gvn | llvm-dis | grep {%cv = phi i32}
1 ; RUN: opt %s -gvn | llvm-dis | 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: llvm-as < %s | opt -gvn | llvm-dis | grep {DEAD = phi i32 }
0 ; RUN: opt %s -gvn | llvm-dis | grep {DEAD = phi i32 }
11
22 define i32 @main(i32* %p) {
33 block1:
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
0 ; RUN: opt %s -gvnpre | llvm-dis
11
22 define void @_Z4sortI3Lit16LessThan_defaultIS0_EEvPT_iT0_() {
33 entry:
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
0 ; RUN: opt %s -gvnpre | llvm-dis
11
22 define void @strength_test5(i32* %data) {
33 entry:
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -gvnpre | llvm-dis
0 ; RUN: opt %s -gvnpre | llvm-dis
11
22 define fastcc void @compute_max_score_1() {
33 entry:
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
0 ; RUN: opt %s -gvnpre | llvm-dis
11
22 define void @vorbis_lsp_to_curve() {
33 entry:
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
0 ; RUN: opt %s -gvnpre | llvm-dis
11
22 define i32 @TreeCCStreamFlush(i8* %stream) {
33 entry:
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
0 ; RUN: opt %s -gvnpre | llvm-dis
11
22 define i64 @foo({ i32, i32 }** %__v) {
33 entry:
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
0 ; RUN: opt %s -gvnpre | llvm-dis
11
22 define i32* @_ZN6Solver9propagateEv(i32* %this) {
33 entry:
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -gvnpre | llvm-dis | grep tmp114115.gvnpre
0 ; RUN: opt %s -gvnpre | llvm-dis | grep tmp114115.gvnpre
11
22 %struct.AV = type { %struct.XPVAV*, i32, i32 }
33 %struct.CLONE_PARAMS = type { %struct.AV*, i32, %struct.PerlInterpreter* }
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -gvnpre | llvm-dis | not grep {%z3 =}
1 ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | not grep {%z9 =}
0 ; RUN: opt %s -gvnpre | llvm-dis | not grep {%z3 =}
1 ; RUN: opt %s -gvnpre | llvm-dis | not grep {%z9 =}
22
33 define i32 @main() {
44 block1:
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
0 ; RUN: opt %s -gvnpre | llvm-dis | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
0 ; RUN: opt %s -gvnpre | llvm-dis | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
0 ; RUN: opt %s -gvnpre | llvm-dis | grep b.gvnpre
11
22 define i32 @extract({ i32 }* %P) {
33 entry: ; preds = %cond_false, %entry
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
0 ; RUN: opt %s -gvnpre | llvm-dis | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
0 ; RUN: opt %s -gvnpre | llvm-dis | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
0 ; RUN: opt %s -gvnpre | llvm-dis | grep b.gvnpre
11
22 define i32 @extract() {
33 entry: ; preds = %cond_false, %entry
None ; RUN: llvm-as < %s | opt -globaldce
0 ; RUN: opt %s -globaldce
11 ;
22 define internal void @func() {
33 ret void
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -globaldce | llvm-dis | not grep foo
3 ; RUN: opt %s -globaldce | llvm-dis | 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: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
3 ; RUN: opt %s -globaldce | llvm-dis | 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: llvm-as < %s | opt -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: llvm-as < %s | opt -globaldce | llvm-dis | not grep testfunc
1 ; RUN: opt %s -globaldce | llvm-dis | not grep testfunc
22
33 declare i1 ()* @getfunc()
44
0 ; Weak variables should be preserved by global DCE!
11
2 ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | grep @A
2 ; RUN: opt %s -globaldce | llvm-dis | grep @A
33
44
55 @A = weak global i32 54
None ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep @D
1 ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | grep @L | count 3
0 ; RUN: opt %s -globaldce | llvm-dis | not grep @D
1 ; RUN: opt %s -globaldce | llvm-dis | grep @L | count 3
22
33 @A = global i32 0
44 @D = alias internal i32* @A
None ; RUN: llvm-as < %s | opt -globaldce
0 ; RUN: opt %s -globaldce
11
22 @A = alias internal void ()* @F
33 define internal void @F() { ret void }
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
0 ; RUN: opt %s -globaldce | llvm-dis | not grep global
11
22 @X = external global i32
33 @Y = internal global i32 7
None ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep test_
0 ; RUN: opt %s -globaldce | llvm-dis | not grep test_
11
22 ; test_function should not be emitted to the .s file.
33 define available_externally i32 @test_function() {
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -globalopt -disable-output
0 ; RUN: opt %s -globalopt -disable-output
11 ; PR579
22
33 @g_40507551 = internal global i16 31038 ; [#uses=1]
None ; RUN: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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: llvm-as < %s | opt -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"