diff options
Diffstat (limited to 'test/Transforms')
1247 files changed, 6093 insertions, 1433 deletions
diff --git a/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll b/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll index 893d82b..43462fa 100644 --- a/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll +++ b/test/Transforms/ADCE/2002-01-31-UseStuckAround.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o - | opt -adce +; RUN: opt < %s -adce define i32 @"main"(i32 %argc) begin diff --git a/test/Transforms/ADCE/2002-05-22-PHITest.ll b/test/Transforms/ADCE/2002-05-22-PHITest.ll index 04f0051..0095be1 100644 --- a/test/Transforms/ADCE/2002-05-22-PHITest.ll +++ b/test/Transforms/ADCE/2002-05-22-PHITest.ll @@ -1,6 +1,6 @@ ; It is illegal to remove BB1 because it will mess up the PHI node! ; -; RUN: llvm-as < %s | opt -adce | llvm-dis | grep BB1 +; RUN: opt < %s -adce -S | grep BB1 define i32 @test(i1 %C, i32 %A, i32 %B) { ; <label>:0 diff --git a/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll b/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll index 911f8e6..9407b5a 100644 --- a/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll +++ b/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll @@ -4,7 +4,7 @@ ; removed even though there were uses still around. Now the uses are filled ; in with a dummy value before the PHI is deleted. ; -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce %node_t = type { double*, %node_t*, %node_t**, double**, double*, i32, i32 } diff --git a/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll b/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll index 5d25ff1..337be9f 100644 --- a/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll +++ b/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll @@ -1,6 +1,6 @@ ; This testcase is a distilled form of: 2002-05-28-Crash.ll -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce define float @test(i32 %i) { %F = sitofp i32 %i to float ; <float> [#uses=1] diff --git a/test/Transforms/ADCE/2002-05-28-Crash.ll b/test/Transforms/ADCE/2002-05-28-Crash.ll index 27c7205..9bbbd05 100644 --- a/test/Transforms/ADCE/2002-05-28-Crash.ll +++ b/test/Transforms/ADCE/2002-05-28-Crash.ll @@ -11,7 +11,7 @@ ; return !s; ;} ; -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce define i32 @rx_bitset_empty(i32 %size, i32* %set) { bb1: diff --git a/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll b/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll index fb4fe4a..8f8dadf 100644 --- a/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll +++ b/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll @@ -3,7 +3,7 @@ ; block in this function, it would work fine, but that would be the part we ; have to fix now, wouldn't it.... ; -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce define void @foo(i8* %reg5481) { %cast611 = bitcast i8* %reg5481 to i8** ; <i8**> [#uses=1] diff --git a/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll b/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll index 42a7e4d..2f0df67 100644 --- a/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll +++ b/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll @@ -1,6 +1,6 @@ ; This testcase was extracted from the gzip SPEC benchmark ; -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce @bk = external global i32 ; <i32*> [#uses=2] @hufts = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/ADCE/2002-07-29-Segfault.ll b/test/Transforms/ADCE/2002-07-29-Segfault.ll index 1c65b3b..1c8e6e8 100644 --- a/test/Transforms/ADCE/2002-07-29-Segfault.ll +++ b/test/Transforms/ADCE/2002-07-29-Segfault.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce -disable-output define void @test() { br label %BB3 diff --git a/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll b/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll index 4ec9005..17003be 100644 --- a/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll +++ b/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll @@ -1,5 +1,5 @@ ; Testcase reduced from 197.parser by bugpoint -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce define void @conjunction_prune() { ; <label>:0 diff --git a/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll b/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll index 603b14b..d30df19 100644 --- a/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll +++ b/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll @@ -2,7 +2,7 @@ ; entries for it's postdominator. But I think this can only happen when the ; PHI node is dead, so we just avoid patching up dead PHI nodes. -; RUN: llvm-as < %s | opt -adce +; RUN: opt < %s -adce target datalayout = "e-p:32:32" diff --git a/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll b/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll index a9657a7..5206b24 100644 --- a/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll +++ b/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -disable-output +; RUN: opt < %s -adce -disable-output @G = external global i32* ; <i32**> [#uses=1] diff --git a/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll b/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll index e5dd0cc..eb3ef1e 100644 --- a/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll +++ b/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -disable-output +; RUN: opt < %s -adce -disable-output target datalayout = "e-p:32:32" %struct..CppObjTypeDesc = type { i32, i16, i16 } %struct..TypeToken = type { i32, i16, i16 } diff --git a/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll b/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll index 9c6764d..82fa5b2 100644 --- a/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll +++ b/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis | not grep then: +; RUN: opt < %s -adce -simplifycfg -S | not grep then: define void @dead_test8(i32* %data.1, i32 %idx.1) { entry: diff --git a/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll b/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll index e6345c1..444ca8e 100644 --- a/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll +++ b/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -disable-output +; RUN: opt < %s -adce -disable-output define void @test() { br i1 false, label %then, label %endif diff --git a/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll b/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll index 37e077f..499ac51 100644 --- a/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll +++ b/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -disable-output +; RUN: opt < %s -adce -disable-output define i32 @main() { br label %loop diff --git a/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll b/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll index 6e9b17e..5ba1a2e 100644 --- a/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll +++ b/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis | grep call +; RUN: opt < %s -adce -simplifycfg -S | grep call declare void @exit(i32) define i32 @main(i32 %argc) { diff --git a/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll b/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll index 87a1550..a6a41fd 100644 --- a/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll +++ b/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -disable-output +; RUN: opt < %s -adce -disable-output define void @test() { entry: diff --git a/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll b/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll index 8ddbbbe..991e876 100644 --- a/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll +++ b/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -disable-output +; RUN: opt < %s -adce -disable-output declare void @strlen() diff --git a/test/Transforms/ADCE/basictest.ll b/test/Transforms/ADCE/basictest.ll index 22ff0f7..378d702 100644 --- a/test/Transforms/ADCE/basictest.ll +++ b/test/Transforms/ADCE/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis +; RUN: opt < %s -adce -simplifycfg | llvm-dis define i32 @Test(i32 %A, i32 %B) { BB1: diff --git a/test/Transforms/ADCE/basictest1.ll b/test/Transforms/ADCE/basictest1.ll index 29f40de..bbb8878 100644 --- a/test/Transforms/ADCE/basictest1.ll +++ b/test/Transforms/ADCE/basictest1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis +; RUN: opt < %s -adce -simplifycfg | llvm-dis %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 } %spec_fd_t = type { i32, i32, i32, i8* } @__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1] diff --git a/test/Transforms/ADCE/basictest2.ll b/test/Transforms/ADCE/basictest2.ll index 120e233..a17795f 100644 --- a/test/Transforms/ADCE/basictest2.ll +++ b/test/Transforms/ADCE/basictest2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis +; RUN: opt < %s -adce -simplifycfg | llvm-dis %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 } %spec_fd_t = type { i32, i32, i32, i8* } @__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1] diff --git a/test/Transforms/ADCE/dce_pure_call.ll b/test/Transforms/ADCE/dce_pure_call.ll index 3935bf7..66483ab 100644 --- a/test/Transforms/ADCE/dce_pure_call.ll +++ b/test/Transforms/ADCE/dce_pure_call.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce | llvm-dis | not grep call +; RUN: opt -adce -S < %s | not grep call declare i32 @strlen(i8*) readonly nounwind diff --git a/test/Transforms/ADCE/dce_pure_invoke.ll b/test/Transforms/ADCE/dce_pure_invoke.ll index bd28df2..c16d45c 100644 --- a/test/Transforms/ADCE/dce_pure_invoke.ll +++ b/test/Transforms/ADCE/dce_pure_invoke.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce | llvm-dis | grep null +; RUN: opt < %s -adce -S | grep null declare i32 @strlen(i8*) readnone diff --git a/test/Transforms/ADCE/unreachable-function.ll b/test/Transforms/ADCE/unreachable-function.ll index 86c55f5..7c6a30e 100644 --- a/test/Transforms/ADCE/unreachable-function.ll +++ b/test/Transforms/ADCE/unreachable-function.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -adce -disable-output +; RUN: opt < %s -adce -disable-output define void @test() { unreachable diff --git a/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll index 67c061f..e740b29 100644 --- a/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll +++ b/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep nounwind | count 2 +; RUN: opt < %s -argpromotion -S | grep nounwind | count 2 define internal i32 @deref(i32* %x) nounwind { entry: diff --git a/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll b/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll index 11bcb28..d7d5eb5 100644 --- a/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll +++ b/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion | llvm-dis > %t +; RUN: opt < %s -argpromotion -S > %t ; RUN: cat %t | grep {define.*@callee(.*i32\\*} ; PR2498 diff --git a/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll b/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll index 047ff0a..7ee6654 100644 --- a/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll +++ b/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -argpromotion -disable-output +; RUN: opt < %s -inline -argpromotion -disable-output define internal fastcc i32 @hash(i32* %ts, i32 %mod) nounwind { entry: diff --git a/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll b/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll index d406165..aff917c 100644 --- a/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll +++ b/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion -disable-output +; RUN: opt < %s -argpromotion -disable-output define internal fastcc i32 @term_SharingList(i32* %Term, i32* %List) nounwind { entry: diff --git a/test/Transforms/ArgumentPromotion/aggregate-promote.ll b/test/Transforms/ArgumentPromotion/aggregate-promote.ll index 62b1a07..6a60e61 100644 --- a/test/Transforms/ArgumentPromotion/aggregate-promote.ll +++ b/test/Transforms/ArgumentPromotion/aggregate-promote.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion -instcombine | llvm-dis | not grep load +; RUN: opt < %s -argpromotion -instcombine -S | not grep load %QuadTy = type { i32, i32, i32, i32 } @G = constant %QuadTy { diff --git a/test/Transforms/ArgumentPromotion/attrs.ll b/test/Transforms/ArgumentPromotion/attrs.ll index 0fb38be..49c0750 100644 --- a/test/Transforms/ArgumentPromotion/attrs.ll +++ b/test/Transforms/ArgumentPromotion/attrs.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep zeroext +; RUN: opt < %s -argpromotion -S | grep zeroext %struct.ss = type { i32, i64 } diff --git a/test/Transforms/ArgumentPromotion/basictest.ll b/test/Transforms/ArgumentPromotion/basictest.ll index 99697f4..87f6371 100644 --- a/test/Transforms/ArgumentPromotion/basictest.ll +++ b/test/Transforms/ArgumentPromotion/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion -mem2reg | llvm-dis | not grep alloca +; RUN: opt < %s -argpromotion -mem2reg -S | not grep alloca define internal i32 @test(i32* %X, i32* %Y) { %A = load i32* %X ; <i32> [#uses=1] %B = load i32* %Y ; <i32> [#uses=1] diff --git a/test/Transforms/ArgumentPromotion/byval-2.ll b/test/Transforms/ArgumentPromotion/byval-2.ll index d625357..bd62c68 100644 --- a/test/Transforms/ArgumentPromotion/byval-2.ll +++ b/test/Transforms/ArgumentPromotion/byval-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep -F {i32* byval} | count 2 +; RUN: opt < %s -argpromotion -S | grep -F {i32* byval} | count 2 ; Argpromote + scalarrepl should change this to passing the two integers by value. %struct.ss = type { i32, i64 } diff --git a/test/Transforms/ArgumentPromotion/byval.ll b/test/Transforms/ArgumentPromotion/byval.ll index 3a3458f..052528a 100644 --- a/test/Transforms/ArgumentPromotion/byval.ll +++ b/test/Transforms/ArgumentPromotion/byval.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion -scalarrepl | llvm-dis | not grep load +; RUN: opt < %s -argpromotion -scalarrepl -S | not grep load ; Argpromote + scalarrepl should change this to passing the two integers by value. %struct.ss = type { i32, i64 } diff --git a/test/Transforms/ArgumentPromotion/callgraph-update.ll b/test/Transforms/ArgumentPromotion/callgraph-update.ll new file mode 100644 index 0000000..989043d --- /dev/null +++ b/test/Transforms/ArgumentPromotion/callgraph-update.ll @@ -0,0 +1,23 @@ +; RUN: opt < %s -argpromotion -simplifycfg -constmerge | llvm-dis +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" +target triple = "i386-apple-darwin10.0" + +%struct.VEC2 = type { double, double, double } +%struct.VERTEX = type { %struct.VEC2, %struct.VERTEX*, %struct.VERTEX* } +%struct.edge_rec = type { %struct.VERTEX*, %struct.edge_rec*, i32, i8* } + +declare %struct.edge_rec* @alloc_edge() nounwind ssp + +define i64 @build_delaunay(%struct.VERTEX* %tree, %struct.VERTEX* %extra) nounwind ssp { +entry: + br i1 undef, label %bb11, label %bb12 + +bb11: ; preds = %bb10 + %a = call %struct.edge_rec* @alloc_edge() nounwind ; <%struct.edge_rec*> [#uses=0] + ret i64 123 + +bb12: ; preds = %bb10 + %b = call %struct.edge_rec* @alloc_edge() nounwind ; <%struct.edge_rec*> [#uses=1] + %c = ptrtoint %struct.edge_rec* %b to i64 + ret i64 %c +} diff --git a/test/Transforms/ArgumentPromotion/chained.ll b/test/Transforms/ArgumentPromotion/chained.ll index de5f6e5..5ccb752 100644 --- a/test/Transforms/ArgumentPromotion/chained.ll +++ b/test/Transforms/ArgumentPromotion/chained.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion -instcombine | llvm-dis | not grep load +; RUN: opt < %s -argpromotion -instcombine -S | not grep load @G1 = constant i32 0 ; <i32*> [#uses=1] @G2 = constant i32* @G1 ; <i32**> [#uses=1] diff --git a/test/Transforms/ArgumentPromotion/control-flow.ll b/test/Transforms/ArgumentPromotion/control-flow.ll index 76e8fd9..08ca6bc 100644 --- a/test/Transforms/ArgumentPromotion/control-flow.ll +++ b/test/Transforms/ArgumentPromotion/control-flow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | \ +; RUN: opt < %s -argpromotion -S | \ ; RUN: not grep {load i32\* null} define internal i32 @callee(i1 %C, i32* %P) { diff --git a/test/Transforms/ArgumentPromotion/control-flow2.ll b/test/Transforms/ArgumentPromotion/control-flow2.ll index 5875013..79b44d4 100644 --- a/test/Transforms/ArgumentPromotion/control-flow2.ll +++ b/test/Transforms/ArgumentPromotion/control-flow2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | \ +; RUN: opt < %s -argpromotion -S | \ ; RUN: grep {load i32\\* %A} define internal i32 @callee(i1 %C, i32* %P) { diff --git a/test/Transforms/ArgumentPromotion/pr3085.ll b/test/Transforms/ArgumentPromotion/pr3085.ll index e350370..3048c60 100644 --- a/test/Transforms/ArgumentPromotion/pr3085.ll +++ b/test/Transforms/ArgumentPromotion/pr3085.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -loop-extract-single -loop-rotate -loop-reduce -argpromotion +; RUN: opt < %s -disable-output -loop-extract-single -loop-rotate -loop-reduce -argpromotion ; PR 3085 %struct.Lit = type { i8 } diff --git a/test/Transforms/BlockPlacement/basictest.ll b/test/Transforms/BlockPlacement/basictest.ll index 4eec23e..47b5079 100644 --- a/test/Transforms/BlockPlacement/basictest.ll +++ b/test/Transforms/BlockPlacement/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -block-placement -disable-output -print-function 2> /dev/null +; RUN: opt < %s -block-placement -disable-output -print-function 2> /dev/null define i32 @test() { br i1 true, label %X, label %Y diff --git a/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll b/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll index 8afdcae..9d82819 100644 --- a/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll +++ b/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -std-compile-opts -o - | llc -o - | grep bork_directive | wc -l | grep 2 +; RUN: opt < %s -std-compile-opts -o - | llc -o - | grep bork_directive | wc -l | grep 2 ;; We don't want branch folding to fold asm directives. diff --git a/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll b/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll index aba3564..3d0339b 100644 --- a/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll +++ b/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-extract -disable-output +; RUN: opt < %s -loop-extract -disable-output define void @solve() { entry: diff --git a/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll b/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll index a41430d..a6ee63e 100644 --- a/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll +++ b/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-extract -disable-output +; RUN: opt < %s -loop-extract -disable-output ; This testcase is failing the loop extractor because not all exit blocks ; are dominated by all of the live-outs. diff --git a/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll b/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll index ded821b..7cd7279 100644 --- a/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll +++ b/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-extract-single -disable-output +; RUN: opt < %s -loop-extract-single -disable-output define void @ab() { entry: diff --git a/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll b/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll index e2030e2..01fe54b 100644 --- a/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll +++ b/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-extract -disable-output +; RUN: opt < %s -loop-extract -disable-output define void @sendMTFValues() { entry: diff --git a/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll b/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll index 9f4b273..0fbd330 100644 --- a/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll +++ b/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-extract -disable-output +; RUN: opt < %s -loop-extract -disable-output %struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, i32, i32 } %struct.table_t = type { [1 x %struct.node_t**], [1 x %struct.node_t**] } diff --git a/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll b/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll index b1b0324..6b306d2 100644 --- a/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll +++ b/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-extract -disable-output +; RUN: opt < %s -loop-extract -disable-output define void @maketree() { entry: diff --git a/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll b/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll index 48e5a76..91e9799 100644 --- a/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll +++ b/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-extract -disable-output +; RUN: opt < %s -loop-extract -disable-output declare i32 @_IO_getc() diff --git a/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll b/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll index 0ab5498..9f70bdc 100644 --- a/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll +++ b/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -extract-blocks -disable-output +; RUN: opt < %s -extract-blocks -disable-output define void @test1() { no_exit.0.i: diff --git a/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll b/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll index 8cd6094..fc58577 100644 --- a/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll +++ b/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -extract-blocks -disable-output +; RUN: opt < %s -extract-blocks -disable-output define i32 @foo() { br label %EB diff --git a/test/Transforms/CodeGenPrepare/2008-11-24-RAUW-Self.ll b/test/Transforms/CodeGenPrepare/2008-11-24-RAUW-Self.ll index 12d6c0c..1995c7f 100644 --- a/test/Transforms/CodeGenPrepare/2008-11-24-RAUW-Self.ll +++ b/test/Transforms/CodeGenPrepare/2008-11-24-RAUW-Self.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -codegenprepare | llvm-dis +; RUN: opt < %s -codegenprepare | llvm-dis ; PR3113 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" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll b/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll index fa08379..754d19d 100644 --- a/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll +++ b/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -condprop -disable-output +; RUN: opt < %s -condprop -disable-output ; PR877 target datalayout = "E-p:32:32" target triple = "powerpc-apple-darwin9.0.0d1" diff --git a/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll b/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll index 573ee6c..4df8ff9 100644 --- a/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll +++ b/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -condprop -disable-output +; RUN: opt < %s -condprop -disable-output ; PR979 target datalayout = "e-p:32:32" diff --git a/test/Transforms/CondProp/2007-08-01-InvalidRead.ll b/test/Transforms/CondProp/2007-08-01-InvalidRead.ll index 1e1f8cb..6d5f0f5 100644 --- a/test/Transforms/CondProp/2007-08-01-InvalidRead.ll +++ b/test/Transforms/CondProp/2007-08-01-InvalidRead.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -tailduplicate -condprop -simplifycfg -disable-output +; RUN: opt < %s -inline -tailduplicate -condprop -simplifycfg -disable-output ; PR1575 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/CondProp/2009-01-25-SingleEntryPHI.ll b/test/Transforms/CondProp/2009-01-25-SingleEntryPHI.ll index d14ce38..58dd29f 100644 --- a/test/Transforms/CondProp/2009-01-25-SingleEntryPHI.ll +++ b/test/Transforms/CondProp/2009-01-25-SingleEntryPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -condprop | llvm-dis +; RUN: opt < %s -condprop | llvm-dis ; PR3405 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" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Transforms/CondProp/basictest-dbg.ll b/test/Transforms/CondProp/basictest-dbg.ll index d8a680b..9e05ff1 100644 --- a/test/Transforms/CondProp/basictest-dbg.ll +++ b/test/Transforms/CondProp/basictest-dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -condprop | llvm-dis | \ +; RUN: opt < %s -condprop -S | \ ; RUN: not grep {br label} %llvm.dbg.anchor.type = type { i32, i32 } diff --git a/test/Transforms/CondProp/basictest.ll b/test/Transforms/CondProp/basictest.ll index 317247c..49d4735 100644 --- a/test/Transforms/CondProp/basictest.ll +++ b/test/Transforms/CondProp/basictest.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -condprop | llvm-dis | \ +; RUN: opt < %s -condprop -S | \ ; RUN: not grep {br label} -; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep T2 +; RUN: opt < %s -condprop -S | not grep T2 define i32 @test(i1 %C) { diff --git a/test/Transforms/CondProp/phisimplify.ll b/test/Transforms/CondProp/phisimplify.ll index 5b5a304..ce33f1e 100644 --- a/test/Transforms/CondProp/phisimplify.ll +++ b/test/Transforms/CondProp/phisimplify.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi +; RUN: opt < %s -condprop -S | not grep phi define i32 @test(i32 %C, i1 %Val) { switch i32 %C, label %T1 [ diff --git a/test/Transforms/CondProp/phisimplify2.ll b/test/Transforms/CondProp/phisimplify2.ll index 03d12e3..4ecbd88 100644 --- a/test/Transforms/CondProp/phisimplify2.ll +++ b/test/Transforms/CondProp/phisimplify2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi +; RUN: opt < %s -condprop -S | not grep phi declare i1 @foo() diff --git a/test/Transforms/CondProp/phisimplify3.ll b/test/Transforms/CondProp/phisimplify3.ll index 1678597..6166efb 100644 --- a/test/Transforms/CondProp/phisimplify3.ll +++ b/test/Transforms/CondProp/phisimplify3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi +; RUN: opt < %s -condprop -S | not grep phi define i32 @foo(i1, i32, i32) { prologue: diff --git a/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll b/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll index 1a0845c..15a6211 100644 --- a/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll +++ b/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll @@ -1,6 +1,6 @@ ; Make sure that the constant propogator doesn't divide by zero! ; -; RUN: llvm-as < %s | opt -constprop +; RUN: opt < %s -constprop ; define i32 @test() { diff --git a/test/Transforms/ConstProp/2002-05-03-NotOperator.ll b/test/Transforms/ConstProp/2002-05-03-NotOperator.ll index 7a281aa..d9cd674 100644 --- a/test/Transforms/ConstProp/2002-05-03-NotOperator.ll +++ b/test/Transforms/ConstProp/2002-05-03-NotOperator.ll @@ -4,7 +4,7 @@ ; Fix #2: The unary not instruction now no longer exists. Change to xor. -; RUN: llvm-as < $test | opt -constprop | llvm-dis | \ +; RUN: opt < %s -constprop -S | \ ; RUN: not grep {i32 0} define i32 @test1() { diff --git a/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll b/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll index 781d796..dd24d96 100644 --- a/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll +++ b/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll @@ -1,6 +1,6 @@ ; SetCC on boolean values was not implemented! -; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | \ +; RUN: opt < %s -constprop -die -S | \ ; RUN: not grep set define i1 @test1() { diff --git a/test/Transforms/ConstProp/2003-05-12-DivideError.ll b/test/Transforms/ConstProp/2003-05-12-DivideError.ll index a3f239f..2708dce 100644 --- a/test/Transforms/ConstProp/2003-05-12-DivideError.ll +++ b/test/Transforms/ConstProp/2003-05-12-DivideError.ll @@ -1,6 +1,6 @@ ; Make sure that the constant propagator doesn't cause a sigfpe ; -; RUN: llvm-as < %s | opt -constprop +; RUN: opt < %s -constprop ; define i32 @test() { diff --git a/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll b/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll index 9ffbcd1..0b44b99 100644 --- a/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll +++ b/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis | \ +; RUN: opt < %s -constprop -S | \ ; RUN: not grep {ret i1 false} @b = external global [2 x { }] ; <[2 x { }]*> [#uses=2] diff --git a/test/Transforms/ConstProp/2006-11-30-vector-cast.ll b/test/Transforms/ConstProp/2006-11-30-vector-cast.ll index 812cbcf..be76783 100644 --- a/test/Transforms/ConstProp/2006-11-30-vector-cast.ll +++ b/test/Transforms/ConstProp/2006-11-30-vector-cast.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis | \ +; RUN: opt < %s -constprop -S | \ ; RUN: grep {i32 -1} -; RUN: llvm-as < %s | opt -constprop | llvm-dis | \ +; RUN: opt < %s -constprop -S | \ ; RUN: not grep zeroinitializer define <4 x i32> @test() { diff --git a/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll b/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll index 889ef56..e46a875 100644 --- a/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll +++ b/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {ret i1 false} define i1 @test() { %X = trunc i32 320 to i1 ; <i1> [#uses=1] diff --git a/test/Transforms/ConstProp/2006-12-01-bool-casts.ll b/test/Transforms/ConstProp/2006-12-01-bool-casts.ll index dd1e46d..3c06693 100644 --- a/test/Transforms/ConstProp/2006-12-01-bool-casts.ll +++ b/test/Transforms/ConstProp/2006-12-01-bool-casts.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis | \ +; RUN: opt < %s -constprop -S | \ ; RUN: grep {ret i32 -1} -; RUN: llvm-as < %s | opt -constprop | llvm-dis | \ +; RUN: opt < %s -constprop -S | \ ; RUN: grep {ret i32 1} define i32 @test1() { diff --git a/test/Transforms/ConstProp/2007-02-05-BitCast.ll b/test/Transforms/ConstProp/2007-02-05-BitCast.ll index a1d7c3e..ebe3d21 100644 --- a/test/Transforms/ConstProp/2007-02-05-BitCast.ll +++ b/test/Transforms/ConstProp/2007-02-05-BitCast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep 1065353216 +; RUN: opt < %s -constprop -S | grep 1065353216 define i32 @test() { %A = bitcast float 1.000000e+00 to i32 ; <i32> [#uses=1] diff --git a/test/Transforms/ConstProp/2007-11-23-cttz.ll b/test/Transforms/ConstProp/2007-11-23-cttz.ll index 995ce2f..37cda30 100644 --- a/test/Transforms/ConstProp/2007-11-23-cttz.ll +++ b/test/Transforms/ConstProp/2007-11-23-cttz.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis | grep {ret i13 13} +; RUN: opt < %s -constprop -S | grep {ret i13 13} ; PR1816 declare i13 @llvm.cttz.i13(i13) diff --git a/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll b/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll index 4c71463..fd54954 100644 --- a/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll +++ b/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll @@ -1,28 +1,28 @@ -; RUN: llvm-as < %s | opt -constprop -disable-output +; RUN: opt < %s -constprop -disable-output ; PR2529 -define <4 x i32> @test1(i32 %argc, i8** %argv) { +define <4 x i1> @test1(i32 %argc, i8** %argv) { entry: - %foo = vicmp slt <4 x i32> undef, <i32 14, i32 undef, i32 undef, i32 undef> - ret <4 x i32> %foo + %foo = icmp slt <4 x i32> undef, <i32 14, i32 undef, i32 undef, i32 undef> + ret <4 x i1> %foo } -define <4 x i32> @test2(i32 %argc, i8** %argv) { +define <4 x i1> @test2(i32 %argc, i8** %argv) { entry: - %foo = vicmp slt <4 x i32> <i32 undef, i32 undef, i32 undef, i32 + %foo = icmp slt <4 x i32> <i32 undef, i32 undef, i32 undef, i32 undef>, <i32 undef, i32 undef, i32 undef, i32 undef> - ret <4 x i32> %foo + ret <4 x i1> %foo } -define <4 x i32> @test3() { - %foo = vfcmp ueq <4 x float> <float 0.0, float 0.0, float 0.0, float +define <4 x i1> @test3() { + %foo = fcmp ueq <4 x float> <float 0.0, float 0.0, float 0.0, float undef>, <float 1.0, float 1.0, float 1.0, float undef> - ret <4 x i32> %foo + ret <4 x i1> %foo } -define <4 x i32> @test4() { - %foo = vfcmp ueq <4 x float> <float 0.0, float 0.0, float 0.0, float 0.0>, <float 1.0, float 1.0, float 1.0, float 0.0> +define <4 x i1> @test4() { + %foo = fcmp ueq <4 x float> <float 0.0, float 0.0, float 0.0, float 0.0>, <float 1.0, float 1.0, float 1.0, float 0.0> - ret <4 x i32> %foo + ret <4 x i1> %foo } diff --git a/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll b/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll new file mode 100644 index 0000000..fc7ff90 --- /dev/null +++ b/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll @@ -0,0 +1,24 @@ +; RUN: opt < %s -constprop | llvm-dis +; PR4848 +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" +target triple = "x86_64-unknown-linux-gnu" + +%0 = type { %struct.anon } +%1 = type { %0, %2, [24 x i8] } +%2 = type <{ %3, %3 }> +%3 = type { %struct.hrtimer_cpu_base*, i32, %struct.rb_root, %struct.rb_node*, %struct.pgprot, i64 ()*, [16 x i8] } +%struct.anon = type { } +%struct.hrtimer_clock_base = type { %struct.hrtimer_cpu_base*, i32, %struct.rb_root, %struct.rb_node*, %struct.pgprot, i64 ()*, %struct.pgprot, %struct.pgprot } +%struct.hrtimer_cpu_base = type { %0, [2 x %struct.hrtimer_clock_base], %struct.pgprot, i32, i64 } +%struct.pgprot = type { i64 } +%struct.rb_node = type { i64, %struct.rb_node*, %struct.rb_node* } +%struct.rb_root = type { %struct.rb_node* } + +@per_cpu__hrtimer_bases = external global %1, align 8 ; <%1*> [#uses=1] + +define void @init_hrtimers_cpu(i32 %cpu) nounwind noredzone section ".cpuinit.text" { +entry: + %tmp3 = getelementptr %struct.hrtimer_cpu_base* bitcast (%1* @per_cpu__hrtimer_bases to %struct.hrtimer_cpu_base*), i32 0, i32 0 ; <%0*> [#uses=1] + %tmp5 = bitcast %0* %tmp3 to i8* ; <i8*> [#uses=0] + unreachable +} diff --git a/test/Transforms/ConstProp/2009-09-19-ConstFold-i1-ConstExpr.ll b/test/Transforms/ConstProp/2009-09-19-ConstFold-i1-ConstExpr.ll new file mode 100644 index 0000000..8d92c3f --- /dev/null +++ b/test/Transforms/ConstProp/2009-09-19-ConstFold-i1-ConstExpr.ll @@ -0,0 +1,41 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +@X = external global i8 +@Y = external global i8 +@Z = external global i8 + +@A = global i1 add (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) +; CHECK: @A = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) ; <i1*> [#uses=0] +@B = global i1 sub (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) +; CHECK: @B = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) ; <i1*> [#uses=0] +@C = global i1 mul (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) +; CHECK: @C = global i1 and (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) ; <i1*> [#uses=0] + +@D = global i1 sdiv (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) +; CHECK: @D = global i1 icmp ult (i8* @X, i8* @Y) ; <i1*> [#uses=0] +@E = global i1 udiv (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) +; CHECK: @E = global i1 icmp ult (i8* @X, i8* @Y) ; <i1*> [#uses=0] +@F = global i1 srem (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) +; CHECK: @F = global i1 false ; <i1*> [#uses=0] +@G = global i1 urem (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) +; CHECK: @G = global i1 false ; <i1*> [#uses=0] + +@H = global i1 icmp ule (i32* bitcast (i8* @X to i32*), i32* bitcast (i8* @Y to i32*)) +; CHECK: @H = global i1 icmp ule (i8* @X, i8* @Y) ; <i1*> [#uses=0] + +@I = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 false) +; CHECK: @I = global i1 icmp ult (i8* @X, i8* @Y) ; <i1*> [#uses=0] +@J = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 true) +; CHECK: @J = global i1 icmp uge (i8* @X, i8* @Y) ; <i1*> [#uses=0] + +@K = global i1 icmp eq (i1 icmp ult (i8* @X, i8* @Y), i1 false) +; CHECK: @K = global i1 icmp uge (i8* @X, i8* @Y) ; <i1*> [#uses=0] +@L = global i1 icmp eq (i1 icmp ult (i8* @X, i8* @Y), i1 true) +; CHECK: @L = global i1 icmp ult (i8* @X, i8* @Y) ; <i1*> [#uses=0] +@M = global i1 icmp ne (i1 icmp ult (i8* @X, i8* @Y), i1 true) +; CHECK: @M = global i1 icmp uge (i8* @X, i8* @Y) ; <i1*> [#uses=0] +@N = global i1 icmp ne (i1 icmp ult (i8* @X, i8* @Y), i1 false) +; CHECK: @N = global i1 icmp ult (i8* @X, i8* @Y) ; <i1*> [#uses=0] + +@O = global i1 icmp eq (i32 zext (i1 icmp ult (i8* @X, i8* @Y) to i32), i32 0) +; CHECK: @O = global i1 icmp uge (i8* @X, i8* @Y) ; <i1*> [#uses=0] diff --git a/test/Transforms/ConstProp/basictest.ll b/test/Transforms/ConstProp/basictest.ll index 56892d9..2edc55d 100644 --- a/test/Transforms/ConstProp/basictest.ll +++ b/test/Transforms/ConstProp/basictest.ll @@ -1,20 +1,21 @@ +; RUN: opt < %s -constprop -die -S | FileCheck %s + ; This is a basic sanity check for constant propogation. The add instruction ; should be eliminated. - -; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep add - -define i32 @test(i1 %B) { +define i32 @test1(i1 %B) { br i1 %B, label %BB1, label %BB2 -BB1: ; preds = %0 - %Val = add i32 0, 0 ; <i32> [#uses=1] +BB1: + %Val = add i32 0, 0 br label %BB3 -BB2: ; preds = %0 +BB2: br label %BB3 -BB3: ; preds = %BB2, %BB1 - %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] ; <i32> [#uses=1] +BB3: +; CHECK: @test1 +; CHECK: %Ret = phi i32 [ 0, %BB1 ], [ 1, %BB2 ] + %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] ret i32 %Ret } diff --git a/test/Transforms/ConstProp/bitcast2.ll b/test/Transforms/ConstProp/bitcast2.ll index 66def7f..5c5eab1 100644 --- a/test/Transforms/ConstProp/bitcast2.ll +++ b/test/Transforms/ConstProp/bitcast2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast +; RUN: opt < %s -instcombine -S | not grep bitcast ; PR2165 define <1 x i64> @test() { diff --git a/test/Transforms/ConstProp/bswap.ll b/test/Transforms/ConstProp/bswap.ll index 4975827..9fce309 100644 --- a/test/Transforms/ConstProp/bswap.ll +++ b/test/Transforms/ConstProp/bswap.ll @@ -1,6 +1,6 @@ ; bswap should be constant folded when it is passed a constant argument -; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep call +; RUN: opt < %s -constprop -S | not grep call declare i16 @llvm.bswap.i16(i16) diff --git a/test/Transforms/ConstProp/calls.ll b/test/Transforms/ConstProp/calls.ll index c573e56..3c266fe 100644 --- a/test/Transforms/ConstProp/calls.ll +++ b/test/Transforms/ConstProp/calls.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep call +; RUN: opt < %s -constprop -S | not grep call declare double @cos(double) diff --git a/test/Transforms/ConstProp/div-zero.ll b/test/Transforms/ConstProp/div-zero.ll index 166c643..f78a34f 100644 --- a/test/Transforms/ConstProp/div-zero.ll +++ b/test/Transforms/ConstProp/div-zero.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0} +; RUN: opt < %s -instcombine -S | grep {ret i32 0} ; PR4424 declare void @ext() diff --git a/test/Transforms/ConstProp/float-to-ptr-cast.ll b/test/Transforms/ConstProp/float-to-ptr-cast.ll index cbf84f5..d8eb3e8 100644 --- a/test/Transforms/ConstProp/float-to-ptr-cast.ll +++ b/test/Transforms/ConstProp/float-to-ptr-cast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis | \ +; RUN: opt < %s -constprop -S | \ ; RUN: grep -F {ret i32* null} | count 2 define i32* @test1() { diff --git a/test/Transforms/ConstProp/logicaltest.ll b/test/Transforms/ConstProp/logicaltest.ll index 81bdb95..7a90a71 100644 --- a/test/Transforms/ConstProp/logicaltest.ll +++ b/test/Transforms/ConstProp/logicaltest.ll @@ -1,6 +1,6 @@ ; Ensure constant propogation of logical instructions is working correctly. -; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | \ +; RUN: opt < %s -constprop -die -S | \ ; RUN: not egrep {and|or|xor} define i32 @test1() { diff --git a/test/Transforms/ConstProp/nottest.ll b/test/Transforms/ConstProp/nottest.ll index 41ea1b3..799ceca 100644 --- a/test/Transforms/ConstProp/nottest.ll +++ b/test/Transforms/ConstProp/nottest.ll @@ -1,6 +1,6 @@ ; Ensure constant propogation of 'not' instructions is working correctly. -; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep xor +; RUN: opt < %s -constprop -die -S | not grep xor define i32 @test1() { %R = xor i32 4, -1 ; <i32> [#uses=1] diff --git a/test/Transforms/ConstProp/overflow-ops.ll b/test/Transforms/ConstProp/overflow-ops.ll new file mode 100644 index 0000000..1547a4d --- /dev/null +++ b/test/Transforms/ConstProp/overflow-ops.ll @@ -0,0 +1,172 @@ +; RUN: opt < %s -constprop -S | FileCheck %s + +%i8i1 = type {i8, i1} + +;;----------------------------- +;; uadd +;;----------------------------- + +define {i8, i1} @uadd_1() nounwind { +entry: + %t = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 42, i8 100) + ret {i8, i1} %t + +; CHECK: @uadd_1 +; CHECK: ret %i8i1 { i8 -114, i1 false } +} + +define {i8, i1} @uadd_2() nounwind { +entry: + %t = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 142, i8 120) + ret {i8, i1} %t + +; CHECK: @uadd_2 +; CHECK: ret %i8i1 { i8 6, i1 true } +} + +;;----------------------------- +;; usub +;;----------------------------- + +define {i8, i1} @usub_1() nounwind { +entry: + %t = call {i8, i1} @llvm.usub.with.overflow.i8(i8 4, i8 2) + ret {i8, i1} %t + +; CHECK: @usub_1 +; CHECK: ret %i8i1 { i8 2, i1 false } +} + +define {i8, i1} @usub_2() nounwind { +entry: + %t = call {i8, i1} @llvm.usub.with.overflow.i8(i8 4, i8 6) + ret {i8, i1} %t + +; CHECK: @usub_2 +; CHECK: ret %i8i1 { i8 -2, i1 true } +} + +;;----------------------------- +;; sadd +;;----------------------------- + +define {i8, i1} @sadd_1() nounwind { +entry: + %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 42, i8 2) + ret {i8, i1} %t + +; CHECK: @sadd_1 +; CHECK: ret %i8i1 { i8 44, i1 false } +} + +define {i8, i1} @sadd_2() nounwind { +entry: + %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 120, i8 10) + ret {i8, i1} %t + +; CHECK: @sadd_2 +; CHECK: ret %i8i1 { i8 -126, i1 true } +} + +define {i8, i1} @sadd_3() nounwind { +entry: + %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 -120, i8 10) + ret {i8, i1} %t + +; CHECK: @sadd_3 +; CHECK: ret %i8i1 { i8 -110, i1 false } +} + +define {i8, i1} @sadd_4() nounwind { +entry: + %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 -120, i8 -10) + ret {i8, i1} %t + +; CHECK: @sadd_4 +; CHECK: ret %i8i1 { i8 126, i1 true } +} + +define {i8, i1} @sadd_5() nounwind { +entry: + %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 2, i8 -10) + ret {i8, i1} %t + +; CHECK: @sadd_5 +; CHECK: ret %i8i1 { i8 -8, i1 false } +} + + +;;----------------------------- +;; ssub +;;----------------------------- + +define {i8, i1} @ssub_1() nounwind { +entry: + %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 4, i8 2) + ret {i8, i1} %t + +; CHECK: @ssub_1 +; CHECK: ret %i8i1 { i8 2, i1 false } +} + +define {i8, i1} @ssub_2() nounwind { +entry: + %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 4, i8 6) + ret {i8, i1} %t + +; CHECK: @ssub_2 +; CHECK: ret %i8i1 { i8 -2, i1 false } +} + +define {i8, i1} @ssub_3() nounwind { +entry: + %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 -10, i8 120) + ret {i8, i1} %t + +; CHECK: @ssub_3 +; CHECK: ret %i8i1 { i8 126, i1 true } +} + +define {i8, i1} @ssub_3b() nounwind { +entry: + %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 -10, i8 10) + ret {i8, i1} %t + +; CHECK: @ssub_3b +; CHECK: ret %i8i1 { i8 -20, i1 false } +} + +define {i8, i1} @ssub_4() nounwind { +entry: + %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 120, i8 -10) + ret {i8, i1} %t + +; CHECK: @ssub_4 +; CHECK: ret %i8i1 { i8 -126, i1 true } +} + +define {i8, i1} @ssub_4b() nounwind { +entry: + %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 20, i8 -10) + ret {i8, i1} %t + +; CHECK: @ssub_4b +; CHECK: ret %i8i1 { i8 30, i1 false } +} + +define {i8, i1} @ssub_5() nounwind { +entry: + %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 -20, i8 -10) + ret {i8, i1} %t + +; CHECK: @ssub_5 +; CHECK: ret %i8i1 { i8 -10, i1 false } +} + + + +declare {i8, i1} @llvm.uadd.with.overflow.i8(i8, i8) +declare {i8, i1} @llvm.usub.with.overflow.i8(i8, i8) + +declare {i8, i1} @llvm.sadd.with.overflow.i8(i8, i8) +declare {i8, i1} @llvm.ssub.with.overflow.i8(i8, i8) diff --git a/test/Transforms/ConstProp/phi.ll b/test/Transforms/ConstProp/phi.ll index 858c0be..3d9e284 100644 --- a/test/Transforms/ConstProp/phi.ll +++ b/test/Transforms/ConstProp/phi.ll @@ -1,7 +1,7 @@ ; This is a basic sanity check for constant propogation. The add instruction ; should be eliminated. -; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep phi +; RUN: opt < %s -constprop -die -S | not grep phi define i32 @test(i1 %B) { BB0: diff --git a/test/Transforms/ConstProp/remtest.ll b/test/Transforms/ConstProp/remtest.ll index 11861a4..efd2d48 100644 --- a/test/Transforms/ConstProp/remtest.ll +++ b/test/Transforms/ConstProp/remtest.ll @@ -1,6 +1,6 @@ ; Ensure constant propagation of remainder instructions is working correctly. -; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep rem +; RUN: opt < %s -constprop -die -S | not grep rem define i32 @test1() { %R = srem i32 4, 3 ; <i32> [#uses=1] diff --git a/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll b/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll index 658944d..b7b05cf 100644 --- a/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll +++ b/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constmerge > /dev/null +; RUN: opt < %s -constmerge > /dev/null @foo.upgrd.1 = internal constant { i32 } { i32 7 } ; <{ i32 }*> [#uses=1] @bar = internal constant { i32 } { i32 7 } ; <{ i32 }*> [#uses=1] diff --git a/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll b/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll index 9a9c3dd..ce79e3b 100644 --- a/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll +++ b/test/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll @@ -1,5 +1,7 @@ -; RUN: llvm-as < %s | opt -constmerge | llvm-dis | %prcontext foo 2 | grep bar +; RUN: opt -S -constmerge %s | FileCheck %s +; CHECK: @foo = constant i32 6 +; CHECK: @bar = constant i32 6 @foo = constant i32 6 ; <i32*> [#uses=0] @bar = constant i32 6 ; <i32*> [#uses=0] diff --git a/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll b/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll index a621b59..cea18a0 100644 --- a/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll +++ b/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -constmerge | llvm-dis | grep foo -; RUN: llvm-as < %s | opt -constmerge | llvm-dis | grep bar +; RUN: opt < %s -constmerge -S | grep foo +; RUN: opt < %s -constmerge -S | grep bar ; Don't merge constants in different sections. diff --git a/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll b/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll index 0d86800..fac6dd2 100644 --- a/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll +++ b/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim -disable-output +; RUN: opt < %s -deadargelim -disable-output define internal void @build_delaunay({ i32 }* sret %agg.result) { ret void diff --git a/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll b/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll index 2b3a2ea..d5bd6c4 100644 --- a/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll +++ b/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep {@test(} -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep dead +; RUN: opt < %s -deadargelim -S | grep {@test(} +; RUN: opt < %s -deadargelim -S | not grep dead define internal i32 @test(i32 %X, i32 %dead) { ret i32 %X diff --git a/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll b/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll index 2a09b76..d4edce9 100644 --- a/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll +++ b/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep {ret i32 0} +; RUN: opt < %s -deadargelim -S | not grep {ret i32 0} ; PR1735 define internal i32 @test(i32 %A, ...) { diff --git a/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll index 47a85ea..0e9c4f7 100644 --- a/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll +++ b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t +; RUN: opt < %s -deadargelim -S > %t ; RUN: cat %t | grep nounwind | count 2 ; RUN: cat %t | grep signext | count 2 ; RUN: cat %t | not grep inreg diff --git a/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll b/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll index 96cddf1..93282f7 100644 --- a/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll +++ b/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep byval +; RUN: opt < %s -deadargelim -S | grep byval %struct.point = type { double, double } @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] diff --git a/test/Transforms/DeadArgElim/2008-06-23-DeadAfterLive.ll b/test/Transforms/DeadArgElim/2008-06-23-DeadAfterLive.ll index 2c94160..adfd019 100644 --- a/test/Transforms/DeadArgElim/2008-06-23-DeadAfterLive.ll +++ b/test/Transforms/DeadArgElim/2008-06-23-DeadAfterLive.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim -die | llvm-dis > %t +; RUN: opt < %s -deadargelim -die -S > %t ; RUN: cat %t | grep 123 ; This test tries to catch wrongful removal of return values for a specific case diff --git a/test/Transforms/DeadArgElim/2009-03-17-MRE-Invoke.ll b/test/Transforms/DeadArgElim/2009-03-17-MRE-Invoke.ll index f5f2ce1..f251d6c 100644 --- a/test/Transforms/DeadArgElim/2009-03-17-MRE-Invoke.ll +++ b/test/Transforms/DeadArgElim/2009-03-17-MRE-Invoke.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis +; RUN: opt < %s -deadargelim | llvm-dis ; PR3807 define internal { i32, i32 } @foo() { diff --git a/test/Transforms/DeadArgElim/basictest.ll b/test/Transforms/DeadArgElim/basictest.ll index 5f68f98..9ac2222 100644 --- a/test/Transforms/DeadArgElim/basictest.ll +++ b/test/Transforms/DeadArgElim/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEADARG +; RUN: opt < %s -deadargelim -S | not grep DEADARG ; test - an obviously dead argument define internal i32 @test(i32 %v, i32 %DEADARG1, i32* %p) { diff --git a/test/Transforms/DeadArgElim/canon.ll b/test/Transforms/DeadArgElim/canon.ll index b8adb71..025a46a 100644 --- a/test/Transforms/DeadArgElim/canon.ll +++ b/test/Transforms/DeadArgElim/canon.ll @@ -1,5 +1,5 @@ ; This test shows a few canonicalizations made by deadargelim -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t +; RUN: opt < %s -deadargelim -S > %t ; This test should remove {} and replace it with void ; RUN: cat %t | grep {define internal void @test} ; This test shouls replace the {i32} return value with just i32 diff --git a/test/Transforms/DeadArgElim/dead_vaargs.ll b/test/Transforms/DeadArgElim/dead_vaargs.ll index a4444bc..db3135c 100644 --- a/test/Transforms/DeadArgElim/dead_vaargs.ll +++ b/test/Transforms/DeadArgElim/dead_vaargs.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep 47 -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep 1.0 +; RUN: opt < %s -deadargelim -S | not grep 47 +; RUN: opt < %s -deadargelim -S | not grep 1.0 define i32 @bar(i32 %A) { %tmp4 = tail call i32 (i32, ...)* @foo( i32 %A, i32 %A, i32 %A, i32 %A, i64 47, double 1.000000e+00 ) ; <i32> [#uses=1] diff --git a/test/Transforms/DeadArgElim/deadretval.ll b/test/Transforms/DeadArgElim/deadretval.ll index 5395290..5f3817c 100644 --- a/test/Transforms/DeadArgElim/deadretval.ll +++ b/test/Transforms/DeadArgElim/deadretval.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEAD +; RUN: opt < %s -deadargelim -S | not grep DEAD ; Dead arg only used by dead retval define internal i32 @test(i32 %DEADARG) { diff --git a/test/Transforms/DeadArgElim/deadretval2.ll b/test/Transforms/DeadArgElim/deadretval2.ll index 316d755..dcdc36e 100644 --- a/test/Transforms/DeadArgElim/deadretval2.ll +++ b/test/Transforms/DeadArgElim/deadretval2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim -die | llvm-dis > %t +; RUN: opt < %s -deadargelim -die -S > %t ; RUN: cat %t | not grep DEAD ; RUN: cat %t | grep LIVE | count 4 diff --git a/test/Transforms/DeadArgElim/keepalive.ll b/test/Transforms/DeadArgElim/keepalive.ll index 899ebd9..b0b9bf3 100644 --- a/test/Transforms/DeadArgElim/keepalive.ll +++ b/test/Transforms/DeadArgElim/keepalive.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t +; RUN: opt < %s -deadargelim -S > %t ; RUN: grep {define internal zeroext i32 @test1() nounwind} %t ; RUN: grep {define internal %Ty @test2} %t diff --git a/test/Transforms/DeadArgElim/multdeadretval.ll b/test/Transforms/DeadArgElim/multdeadretval.ll index 6e0474a..68d96ee 100644 --- a/test/Transforms/DeadArgElim/multdeadretval.ll +++ b/test/Transforms/DeadArgElim/multdeadretval.ll @@ -2,7 +2,7 @@ ; are unused. All unused values are typed i16, so we can easily check. We also ; run instcombine to fold insert/extractvalue chains and we run dce to clean up ; any remaining dead stuff. -; RUN: llvm-as < %s | opt -deadargelim -instcombine -dce | llvm-dis | not grep i16 +; RUN: opt < %s -deadargelim -instcombine -dce -S | not grep i16 define internal {i16, i32} @test(i16 %DEADARG) { %A = insertvalue {i16,i32} undef, i16 1, 0 diff --git a/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll b/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll index 54fa078..d1a9dd8 100644 --- a/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll +++ b/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse -scalarrepl -instcombine | \ +; RUN: opt < %s -dse -scalarrepl -instcombine | \ ; RUN: llvm-dis | not grep {ret i32 undef} define i32 @test(double %__x) { diff --git a/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll b/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll index 3c40347..cae2a6f 100644 --- a/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll +++ b/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | \ +; RUN: opt < %s -dse -S | \ ; RUN: grep {store i32 1234567} ; Do not delete stores that are only partially killed. diff --git a/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll b/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll index 58d6787..147ec84 100644 --- a/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll +++ b/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | grep store +; RUN: opt < %s -dse -S | grep store define double @foo(i8* %X) { %X_addr = alloca i8* ; <i8**> [#uses=2] diff --git a/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll b/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll index 3b3f8ad..0b08306 100644 --- a/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll +++ b/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalsmodref-aa -dse -disable-output +; RUN: opt < %s -globalsmodref-aa -dse -disable-output target datalayout = "E-p:32:32" target triple = "powerpc-apple-darwin8" %struct.ECacheType = type { i32, i32, i32 } diff --git a/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll b/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll index 0ba8479..4a5d6e2 100644 --- a/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll +++ b/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep tmp5 +; RUN: opt < %s -dse -S | not grep tmp5 ; PR2599 define void @foo({ i32, i32 }* %x) nounwind { diff --git a/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll b/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll index 0f3350d..5958c6c 100644 --- a/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll +++ b/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis +; RUN: opt < %s -dse | llvm-dis ; PR3141 %struct.ada__tags__dispatch_table = type { [1 x i32] } %struct.f393a00_1__object = type { %struct.ada__tags__dispatch_table*, i8 } diff --git a/test/Transforms/DeadStoreElimination/2008-11-29-OffEndOfBlock.ll b/test/Transforms/DeadStoreElimination/2008-11-29-OffEndOfBlock.ll index 11e2ffd..c320a3e 100644 --- a/test/Transforms/DeadStoreElimination/2008-11-29-OffEndOfBlock.ll +++ b/test/Transforms/DeadStoreElimination/2008-11-29-OffEndOfBlock.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis +; RUN: opt < %s -dse | llvm-dis 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" target triple = "i386-apple-darwin7" diff --git a/test/Transforms/DeadStoreElimination/PartialStore.ll b/test/Transforms/DeadStoreElimination/PartialStore.ll index ce19657..0881cb9 100644 --- a/test/Transforms/DeadStoreElimination/PartialStore.ll +++ b/test/Transforms/DeadStoreElimination/PartialStore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | \ +; RUN: opt < %s -dse -S | \ ; RUN: not grep {store i8} ; Ensure that the dead store is deleted in this case. It is wholely ; overwritten by the second store. diff --git a/test/Transforms/DeadStoreElimination/alloca.ll b/test/Transforms/DeadStoreElimination/alloca.ll index 7a2c94f..b6818eb 100644 --- a/test/Transforms/DeadStoreElimination/alloca.ll +++ b/test/Transforms/DeadStoreElimination/alloca.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD +; RUN: opt < %s -dse -S | not grep DEAD define void @test(i32* %Q) { %P = alloca i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/DeadStoreElimination/byval.ll b/test/Transforms/DeadStoreElimination/byval.ll index 08f69a4..fa651b1 100644 --- a/test/Transforms/DeadStoreElimination/byval.ll +++ b/test/Transforms/DeadStoreElimination/byval.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep store +; RUN: opt < %s -dse -S | not grep store %struct.x = type { i32, i32, i32, i32 } diff --git a/test/Transforms/DeadStoreElimination/context-sensitive.ll b/test/Transforms/DeadStoreElimination/context-sensitive.ll index 266fdbc..0da416c 100644 --- a/test/Transforms/DeadStoreElimination/context-sensitive.ll +++ b/test/Transforms/DeadStoreElimination/context-sensitive.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD +; RUN: opt < %s -dse -S | not grep DEAD declare void @ext() diff --git a/test/Transforms/DeadStoreElimination/crash.ll b/test/Transforms/DeadStoreElimination/crash.ll new file mode 100644 index 0000000..7f82cbf --- /dev/null +++ b/test/Transforms/DeadStoreElimination/crash.ll @@ -0,0 +1,26 @@ +; RUN: opt < %s -dse | llvm-dis + +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" +target triple = "i386-apple-darwin10.0" + +@g80 = external global i8 ; <i8*> [#uses=3] + +declare signext i8 @foo(i8 signext, i8 signext) nounwind readnone ssp + +declare i32 @func68(i32) nounwind readonly ssp + +; PR4815 +define void @test1(i32 %int32p54) noreturn nounwind ssp { +entry: + br label %bb + +bb: ; preds = %bb, %entry + %storemerge = phi i8 [ %2, %bb ], [ 1, %entry ] ; <i8> [#uses=1] + store i8 %storemerge, i8* @g80 + %0 = tail call i32 @func68(i32 1) nounwind ssp ; <i32> [#uses=1] + %1 = trunc i32 %0 to i8 ; <i8> [#uses=1] + store i8 %1, i8* @g80, align 1 + store i8 undef, i8* @g80, align 1 + %2 = tail call signext i8 @foo(i8 signext undef, i8 signext 1) nounwind ; <i8> [#uses=1] + br label %bb +} diff --git a/test/Transforms/DeadStoreElimination/free.ll b/test/Transforms/DeadStoreElimination/free.ll index 246de93..8b81ee3 100644 --- a/test/Transforms/DeadStoreElimination/free.ll +++ b/test/Transforms/DeadStoreElimination/free.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD +; RUN: opt < %s -dse -S | not grep DEAD define void @test(i32* %Q, i32* %P) { %DEAD = load i32* %Q ; <i32> [#uses=1] diff --git a/test/Transforms/DeadStoreElimination/memcpy.ll b/test/Transforms/DeadStoreElimination/memcpy.ll index e96b2e8..8d99631 100644 --- a/test/Transforms/DeadStoreElimination/memcpy.ll +++ b/test/Transforms/DeadStoreElimination/memcpy.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep alloca +; RUN: opt < %s -dse -S | not grep alloca ; ModuleID = 'placeholder.adb' 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll index 594671d..e89d3ab 100644 --- a/test/Transforms/DeadStoreElimination/simple.ll +++ b/test/Transforms/DeadStoreElimination/simple.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD +; RUN: opt < %s -dse -S | not grep DEAD define void @test(i32* %Q, i32* %P) { %DEAD = load i32* %Q ; <i32> [#uses=1] diff --git a/test/Transforms/DeadStoreElimination/volatile-load.ll b/test/Transforms/DeadStoreElimination/volatile-load.ll index c458284..59a1129 100644 --- a/test/Transforms/DeadStoreElimination/volatile-load.ll +++ b/test/Transforms/DeadStoreElimination/volatile-load.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | grep {volatile load} +; RUN: opt < %s -dse -S | grep {volatile load} @g_1 = global i32 0 diff --git a/test/Transforms/FunctionAttrs/2008-09-03-Mutual.ll b/test/Transforms/FunctionAttrs/2008-09-03-Mutual.ll index 5261ac4..b0aecfa 100644 --- a/test/Transforms/FunctionAttrs/2008-09-03-Mutual.ll +++ b/test/Transforms/FunctionAttrs/2008-09-03-Mutual.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone +; RUN: opt < %s -functionattrs -S | grep readnone define i32 @a() { %tmp = call i32 @b( ) ; <i32> [#uses=1] diff --git a/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll b/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll index a17d381..535a1d0 100644 --- a/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll +++ b/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone | count 4 +; RUN: opt < %s -functionattrs -S | grep readnone | count 4 @x = global i32 0 declare i32 @e() readnone diff --git a/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll b/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll index cebfdac..b455fdd 100644 --- a/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll +++ b/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readonly | count 2 +; RUN: opt < %s -functionattrs -S | grep readonly | count 2 define i32 @f() { entry: diff --git a/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll b/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll index b6077fd..85df09e 100644 --- a/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll +++ b/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep read +; RUN: opt < %s -functionattrs -S | not grep read ; PR2792 @g = global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll b/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll index 50ca641..09eb468 100644 --- a/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll +++ b/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone | count 2 +; RUN: opt < %s -functionattrs -S | grep readnone | count 2 declare i32 @g(i32*) readnone diff --git a/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll b/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll index d9c0117..672b5e1 100644 --- a/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll +++ b/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone +; RUN: opt < %s -functionattrs -S | grep readnone @s = external constant i8 ; <i8*> [#uses=1] diff --git a/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll b/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll index 39a64e6..53857f6 100644 --- a/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll +++ b/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep {nocapture *%%q} -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep {nocapture *%%p} | count 6 +; RUN: opt < %s -functionattrs -S | not grep {nocapture *%%q} +; RUN: opt < %s -functionattrs -S | grep {nocapture *%%p} | count 6 @g = global i32* null ; <i32**> [#uses=1] define i32* @c1(i32* %q) { diff --git a/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll b/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll index 68a232f..7ef5f06 100644 --- a/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll +++ b/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep {nocapture *%%q} -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep {nocapture *%%p} +; RUN: opt < %s -functionattrs -S | not grep {nocapture *%%q} +; RUN: opt < %s -functionattrs -S | grep {nocapture *%%p} define i32* @a(i32** %p) { %tmp = load i32** %p diff --git a/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll b/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll index 4022033..488e6a9 100644 --- a/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll +++ b/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep read +; RUN: opt < %s -functionattrs -S | not grep read ; PR3754 define i8* @m(i32 %size) { diff --git a/test/Transforms/GVN/2007-07-25-DominatedLoop.ll b/test/Transforms/GVN/2007-07-25-DominatedLoop.ll index 7c10f97..ad580ce 100644 --- a/test/Transforms/GVN/2007-07-25-DominatedLoop.ll +++ b/test/Transforms/GVN/2007-07-25-DominatedLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis %struct.PerlInterpreter = type { i8 } @PL_sv_count = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll b/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll index 442ba08..2e0a101 100644 --- a/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll +++ b/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp10 =} +; RUN: opt < %s -gvn -S | not grep {tmp10 =} %struct.INT2 = type { i32, i32 } @blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2] diff --git a/test/Transforms/GVN/2007-07-25-Loop.ll b/test/Transforms/GVN/2007-07-25-Loop.ll index 2efacb5..6a9f58e 100644 --- a/test/Transforms/GVN/2007-07-25-Loop.ll +++ b/test/Transforms/GVN/2007-07-25-Loop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis %struct.s_segment_inf = type { float, i32, i16, i16, float, float, i32, float, float } diff --git a/test/Transforms/GVN/2007-07-25-NestedLoop.ll b/test/Transforms/GVN/2007-07-25-NestedLoop.ll index cebaaa3..c6d7750 100644 --- a/test/Transforms/GVN/2007-07-25-NestedLoop.ll +++ b/test/Transforms/GVN/2007-07-25-NestedLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis %struct.TypHeader = type { i32, %struct.TypHeader**, [3 x i8], i8 } diff --git a/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll b/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll index 10482d8..ecff657 100644 --- a/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll +++ b/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis %struct.ggBRDF = type { i32 (...)** } %struct.ggBox3 = type { %struct.ggPoint3, %struct.ggPoint3 } diff --git a/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll b/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll index 076ba4c..0be3379 100644 --- a/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll +++ b/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp17625.* = phi i32. } -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp17631.* = phi i32. } +; RUN: opt < %s -gvn -S | grep {tmp17625.* = phi i32. } +; RUN: opt < %s -gvn -S | grep {tmp17631.* = phi i32. } @last = external global [65 x i32*] ; <[65 x i32*]*> [#uses=1] diff --git a/test/Transforms/GVN/2007-07-26-NonRedundant.ll b/test/Transforms/GVN/2007-07-26-NonRedundant.ll index 204803a..7579e8a 100644 --- a/test/Transforms/GVN/2007-07-26-NonRedundant.ll +++ b/test/Transforms/GVN/2007-07-26-NonRedundant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis @bsLive = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/GVN/2007-07-26-PhiErasure.ll b/test/Transforms/GVN/2007-07-26-PhiErasure.ll index 4925df7..d898ab8 100644 --- a/test/Transforms/GVN/2007-07-26-PhiErasure.ll +++ b/test/Transforms/GVN/2007-07-26-PhiErasure.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp298316 = phi i32 } +; RUN: opt < %s -gvn -S | not grep phi %struct..0anon = type { i32 } %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 } @@ -23,6 +23,6 @@ cond_next2943: ; preds = %cond_true2935, %bb2928 bb2982.preheader: ; preds = %cond_next2943 %tmp298316 = load i32* @n_spills, align 4 ; <i32> [#uses=0] - ret i32 0 + ret i32 %tmp298316 } diff --git a/test/Transforms/GVN/2007-07-30-PredIDom.ll b/test/Transforms/GVN/2007-07-30-PredIDom.ll index 1d1aec1..5cb6bb3 100644 --- a/test/Transforms/GVN/2007-07-30-PredIDom.ll +++ b/test/Transforms/GVN/2007-07-30-PredIDom.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis %"struct.Block::$_16" = type { i32 } %struct.Exp = type { %struct.Exp_*, i32, i32, i32, %struct.Exp*, %struct.Exp*, %"struct.Exp::$_10", %"struct.Block::$_16", %"struct.Exp::$_12" } diff --git a/test/Transforms/GVN/2007-07-31-NoDomInherit.ll b/test/Transforms/GVN/2007-07-31-NoDomInherit.ll index 6cb7785..faa1157 100644 --- a/test/Transforms/GVN/2007-07-31-NoDomInherit.ll +++ b/test/Transforms/GVN/2007-07-31-NoDomInherit.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {tmp47 = phi i32 } +; RUN: opt < %s -gvn -S | grep {tmp47 = phi i32 } %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* } @debug = external constant i32 ; <i32*> [#uses=0] diff --git a/test/Transforms/GVN/2007-07-31-RedundantPhi.ll b/test/Transforms/GVN/2007-07-31-RedundantPhi.ll index a9ca71a..0d1d8bc 100644 --- a/test/Transforms/GVN/2007-07-31-RedundantPhi.ll +++ b/test/Transforms/GVN/2007-07-31-RedundantPhi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp701 =} +; RUN: opt < %s -gvn -S | not grep {tmp701 =} @img_width = external global i16 ; <i16*> [#uses=2] diff --git a/test/Transforms/GVN/2008-02-12-UndefLoad.ll b/test/Transforms/GVN/2008-02-12-UndefLoad.ll index 5ee3d6c..de2aa61 100644 --- a/test/Transforms/GVN/2008-02-12-UndefLoad.ll +++ b/test/Transforms/GVN/2008-02-12-UndefLoad.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep load +; RUN: opt < %s -gvn -S | not grep load ; PR1996 %struct.anon = type { i32, i8, i8, i8, i8 } diff --git a/test/Transforms/GVN/2008-02-13-NewPHI.ll b/test/Transforms/GVN/2008-02-13-NewPHI.ll index d3e3251..54998db 100644 --- a/test/Transforms/GVN/2008-02-13-NewPHI.ll +++ b/test/Transforms/GVN/2008-02-13-NewPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -gvn +; RUN: opt < %s -anders-aa -gvn ; PR2032 define i32 @sscal(i32 %n, double %sa1, float* %sx, i32 %incx) { diff --git a/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll b/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll index 54a2201..9a75e1a 100644 --- a/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll +++ b/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -dse | llvm-dis | grep {call.*memcpy} | count 1 +; RUN: opt < %s -gvn -dse -S | grep {call.*memcpy} | count 1 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" target triple = "x86_64-apple-darwin8" diff --git a/test/Transforms/GVN/2008-02-26-MemCpySize.ll b/test/Transforms/GVN/2008-02-26-MemCpySize.ll index 92cac07..6ed8a76 100644 --- a/test/Transforms/GVN/2008-02-26-MemCpySize.ll +++ b/test/Transforms/GVN/2008-02-26-MemCpySize.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -dse | llvm-dis | grep {call.*memcpy.*cell} | count 2 +; RUN: opt < %s -gvn -dse -S | grep {call.*memcpy.*cell} | count 2 ; PR2099 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" diff --git a/test/Transforms/GVN/2008-07-02-Unreachable.ll b/test/Transforms/GVN/2008-07-02-Unreachable.ll index 15667d2..361c155 100644 --- a/test/Transforms/GVN/2008-07-02-Unreachable.ll +++ b/test/Transforms/GVN/2008-07-02-Unreachable.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep undef +; RUN: opt < %s -gvn -S | grep {ret i8 \[%\]tmp3} ; PR2503 @g_3 = external global i8 ; <i8*> [#uses=2] diff --git a/test/Transforms/GVN/2008-12-09-SelfRemove.ll b/test/Transforms/GVN/2008-12-09-SelfRemove.ll index 48ce8f6..c6833e3 100644 --- a/test/Transforms/GVN/2008-12-09-SelfRemove.ll +++ b/test/Transforms/GVN/2008-12-09-SelfRemove.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep getelementptr | count 1 +; RUN: opt < %s -gvn -S | grep getelementptr | count 1 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" target triple = "i386-apple-darwin9.5" diff --git a/test/Transforms/GVN/2008-12-12-RLE-Crash.ll b/test/Transforms/GVN/2008-12-12-RLE-Crash.ll index 99fadc7..da67ee7 100644 --- a/test/Transforms/GVN/2008-12-12-RLE-Crash.ll +++ b/test/Transforms/GVN/2008-12-12-RLE-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis 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" target triple = "i386-apple-darwin7" diff --git a/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll b/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll index 9bcfcac..41f76c8 100644 --- a/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll +++ b/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis 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" target triple = "i386-apple-darwin7" @sort_value = external global [256 x i32], align 32 ; <[256 x i32]*> [#uses=2] diff --git a/test/Transforms/GVN/2008-12-15-CacheVisited.ll b/test/Transforms/GVN/2008-12-15-CacheVisited.ll index b547003..0a63f3f 100644 --- a/test/Transforms/GVN/2008-12-15-CacheVisited.ll +++ b/test/Transforms/GVN/2008-12-15-CacheVisited.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis ; Cached results must be added to and verified against the visited sets. ; PR3217 diff --git a/test/Transforms/GVN/2009-01-21-SortInvalidation.ll b/test/Transforms/GVN/2009-01-21-SortInvalidation.ll index 51ca6cb..3677593 100644 --- a/test/Transforms/GVN/2009-01-21-SortInvalidation.ll +++ b/test/Transforms/GVN/2009-01-21-SortInvalidation.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis ; PR3358 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" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Transforms/GVN/2009-01-22-SortInvalidation.ll b/test/Transforms/GVN/2009-01-22-SortInvalidation.ll index 9b7fa06..95690a5 100644 --- a/test/Transforms/GVN/2009-01-22-SortInvalidation.ll +++ b/test/Transforms/GVN/2009-01-22-SortInvalidation.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis +; RUN: opt < %s -gvn | llvm-dis 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" target triple = "i386-apple-darwin7" diff --git a/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll b/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll index 34dc344..c2d57a1 100644 --- a/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll +++ b/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-load-pre -disable-output +; RUN: opt < %s -gvn -enable-load-pre -disable-output %struct.VEC_rtx_base = type { i32, i32, [1 x %struct.rtx_def*] } %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base } diff --git a/test/Transforms/GVN/2009-03-05-dbg.ll b/test/Transforms/GVN/2009-03-05-dbg.ll index 0450a7a..cad3312 100644 --- a/test/Transforms/GVN/2009-03-05-dbg.ll +++ b/test/Transforms/GVN/2009-03-05-dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -disable-output +; RUN: opt < %s -gvn -disable-output %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 } @llvm.dbg.compile_unit298 = external constant %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1] diff --git a/test/Transforms/GVN/2009-03-10-PREOnVoid.ll b/test/Transforms/GVN/2009-03-10-PREOnVoid.ll index 63ddc45..89d6a5f 100644 --- a/test/Transforms/GVN/2009-03-10-PREOnVoid.ll +++ b/test/Transforms/GVN/2009-03-10-PREOnVoid.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -disable-output +; RUN: opt < %s -gvn -disable-output ; PR3775 ; ModuleID = 'bugpoint-reduced-simplified.bc' diff --git a/test/Transforms/GVN/2009-06-17-InvalidPRE.ll b/test/Transforms/GVN/2009-06-17-InvalidPRE.ll index c8982c8..6ac6072 100644 --- a/test/Transforms/GVN/2009-06-17-InvalidPRE.ll +++ b/test/Transforms/GVN/2009-06-17-InvalidPRE.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis | not grep pre1 +; RUN: opt < %s -gvn -enable-load-pre -S | not grep pre1 ; GVN load pre was hoisting the loads at %13 and %16 up to bb4.outer. ; This is invalid as it bypasses the check for %m.0.ph==null in bb4. ; ModuleID = 'mbuf.c' diff --git a/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll b/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll new file mode 100644 index 0000000..641e920 --- /dev/null +++ b/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll @@ -0,0 +1,67 @@ +; RUN: opt < %s -gvn | llvm-dis +; PR4256 +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" +target triple = "i386-linux-gnu" + %llvm.dbg.anchor.type = type { i32, i32 } + %struct.cset = type { i8*, i8, i8, i32, i8* } + %struct.lmat = type { %struct.re_guts*, i32, %llvm.dbg.anchor.type*, i8*, i8*, i8*, i8*, i8**, i32, i8*, i8*, i8*, i8*, i8* } + %struct.re_guts = type { i32*, %struct.cset*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, [1 x i8] } + +define i8* @lbackref(%struct.lmat* %m, i8* %start, i8* %stop, i32 %startst, i32 %stopst, i32 %lev, i32 %rec) nounwind { +entry: + br label %bb63 + +bb: ; preds = %bb63 + switch i32 0, label %bb62 [ + i32 268435456, label %bb2 + i32 805306368, label %bb9 + i32 -1610612736, label %bb51 + ] + +bb2: ; preds = %bb + br label %bb62 + +bb9: ; preds = %bb + %0 = load i8* %sp.1, align 1 ; <i8> [#uses=0] + br label %bb62 + +bb51: ; preds = %bb + %1 = load i8* %sp.1, align 1 ; <i8> [#uses=0] + ret i8* null + +bb62: ; preds = %bb9, %bb2, %bb + br label %bb63 + +bb63: ; preds = %bb84, %bb69, %bb62, %entry + %sp.1 = phi i8* [ null, %bb62 ], [ %sp.1.lcssa, %bb84 ], [ %start, %entry ], [ %sp.1.lcssa, %bb69 ] ; <i8*> [#uses=3] + br i1 false, label %bb, label %bb65 + +bb65: ; preds = %bb63 + %sp.1.lcssa = phi i8* [ %sp.1, %bb63 ] ; <i8*> [#uses=4] + br i1 false, label %bb66, label %bb69 + +bb66: ; preds = %bb65 + ret i8* null + +bb69: ; preds = %bb65 + switch i32 0, label %bb108.loopexit2.loopexit.loopexit [ + i32 1342177280, label %bb63 + i32 1476395008, label %bb84 + i32 1879048192, label %bb104 + i32 2013265920, label %bb93 + ] + +bb84: ; preds = %bb69 + %2 = tail call i8* @lbackref(%struct.lmat* %m, i8* %sp.1.lcssa, i8* %stop, i32 0, i32 %stopst, i32 0, i32 0) nounwind ; <i8*> [#uses=0] + br label %bb63 + +bb93: ; preds = %bb69 + ret i8* null + +bb104: ; preds = %bb69 + %sp.1.lcssa.lcssa33 = phi i8* [ %sp.1.lcssa, %bb69 ] ; <i8*> [#uses=0] + unreachable + +bb108.loopexit2.loopexit.loopexit: ; preds = %bb69 + ret i8* null +} diff --git a/test/Transforms/GVN/2009-11-12-MemDepMallocBitCast.ll b/test/Transforms/GVN/2009-11-12-MemDepMallocBitCast.ll new file mode 100644 index 0000000..b433297 --- /dev/null +++ b/test/Transforms/GVN/2009-11-12-MemDepMallocBitCast.ll @@ -0,0 +1,15 @@ +; Test to make sure malloc's bitcast does not block detection of a store +; to aliased memory; GVN should not optimize away the load in this program. +; RUN: opt < %s -gvn -S | FileCheck %s + +define i64 @test() { + %1 = tail call i8* @malloc(i64 mul (i64 4, i64 ptrtoint (i64* getelementptr (i64* null, i64 1) to i64))) ; <i8*> [#uses=2] + store i8 42, i8* %1 + %X = bitcast i8* %1 to i64* ; <i64*> [#uses=1] + %Y = load i64* %X ; <i64> [#uses=1] + ret i64 %Y +; CHECK: %Y = load i64* %X +; CHECK: ret i64 %Y +} + +declare noalias i8* @malloc(i64) diff --git a/test/Transforms/GVN/basic.ll b/test/Transforms/GVN/basic.ll index ebf5daaf..1decafa 100644 --- a/test/Transforms/GVN/basic.ll +++ b/test/Transforms/GVN/basic.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {%z2 =} +; RUN: opt < %s -gvn -S | not grep {%z2 =} define i32 @main() { block1: diff --git a/test/Transforms/GVN/bitcast-of-call.ll b/test/Transforms/GVN/bitcast-of-call.ll index 0a045c8..55b4b6e 100644 --- a/test/Transforms/GVN/bitcast-of-call.ll +++ b/test/Transforms/GVN/bitcast-of-call.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep tmp2 +; RUN: opt < %s -gvn -S | not grep tmp2 ; PR2213 define i32* @f(i8* %x) { diff --git a/test/Transforms/GVN/calls-nonlocal.ll b/test/Transforms/GVN/calls-nonlocal.ll index 0d1c8a3..f0edf09 100644 --- a/test/Transforms/GVN/calls-nonlocal.ll +++ b/test/Transforms/GVN/calls-nonlocal.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep strlen | count 2 +; RUN: opt < %s -gvn -S | grep strlen | count 2 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" target triple = "i386-apple-darwin9" diff --git a/test/Transforms/GVN/calls-readonly.ll b/test/Transforms/GVN/calls-readonly.ll index 723ef77..28b5ff0 100644 --- a/test/Transforms/GVN/calls-readonly.ll +++ b/test/Transforms/GVN/calls-readonly.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep {call.*strlen} | count 1 +; RUN: opt < %s -basicaa -gvn -S | grep {call.*strlen} | count 1 ; Should delete the second call to strlen even though the intervening strchr call exists. 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" diff --git a/test/Transforms/GVN/condprop.ll b/test/Transforms/GVN/condprop.ll index 53cbb50..e212d79 100644 --- a/test/Transforms/GVN/condprop.ll +++ b/test/Transforms/GVN/condprop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {br i1 false} +; RUN: opt < %s -gvn -S | grep {br i1 false} @a = external global i32 ; <i32*> [#uses=7] diff --git a/test/Transforms/GVN/load-constant-mem.ll b/test/Transforms/GVN/load-constant-mem.ll index 83b9d38..87f33ea 100644 --- a/test/Transforms/GVN/load-constant-mem.ll +++ b/test/Transforms/GVN/load-constant-mem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -instcombine | llvm-dis | grep {ret i32 0} +; RUN: opt < %s -gvn -instcombine -S | grep {ret i32 0} ; PR4189 @G = external constant [4 x i32] diff --git a/test/Transforms/GVN/local-pre.ll b/test/Transforms/GVN/local-pre.ll index 59158cc..5f03984 100644 --- a/test/Transforms/GVN/local-pre.ll +++ b/test/Transforms/GVN/local-pre.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-pre | llvm-dis | grep {b.pre} +; RUN: opt < %s -gvn -enable-pre -S | grep {b.pre} define i32 @main(i32 %p) { block1: diff --git a/test/Transforms/GVN/lpre-basic.ll b/test/Transforms/GVN/lpre-basic.ll index 5b52863..41b5180 100644 --- a/test/Transforms/GVN/lpre-basic.ll +++ b/test/Transforms/GVN/lpre-basic.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis | grep {%PRE = phi} +; RUN: opt < %s -gvn -enable-load-pre -S | grep {%PRE = phi} define i32 @test(i32* %p, i1 %C) { block1: diff --git a/test/Transforms/GVN/lpre-call-wrap-2.ll b/test/Transforms/GVN/lpre-call-wrap-2.ll index c9f9352..79512a3 100644 --- a/test/Transforms/GVN/lpre-call-wrap-2.ll +++ b/test/Transforms/GVN/lpre-call-wrap-2.ll @@ -1,6 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis > %t -; RUN: %prcontext bb1: 2 < %t | grep phi -; RUN: %prcontext bb1: 2 < %t | not grep load +; RUN: opt -S -gvn -enable-load-pre %s | FileCheck %s ; ; The partially redundant load in bb1 should be hoisted to "bb". This comes ; from this C code (GCC PR 23455): @@ -30,6 +28,9 @@ bb: ; preds = %entry br label %bb1 bb1: ; preds = %bb, %entry +; CHECK: bb1: +; CHECK-NEXT: phi +; CHECK-NEXT: getelementptr %4 = load i32* @outcnt, align 4 ; <i32> [#uses=1] %5 = getelementptr i8* %outbuf, i32 %4 ; <i8*> [#uses=1] store i8 %bi_buf, i8* %5, align 1 diff --git a/test/Transforms/GVN/lpre-call-wrap.ll b/test/Transforms/GVN/lpre-call-wrap.ll index 7470953..4046279 100644 --- a/test/Transforms/GVN/lpre-call-wrap.ll +++ b/test/Transforms/GVN/lpre-call-wrap.ll @@ -1,6 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis > %t -; RUN: %prcontext bb3.backedge: 2 < %t | grep phi -; RUN: %prcontext bb3.backedge: 2 < %t | not grep load +; RUN: opt -S -gvn -enable-load-pre %s | FileCheck %s ; ; Make sure the load in bb3.backedge is removed and moved into bb1 after the ; call. This makes the non-call case faster. @@ -43,6 +41,9 @@ bb1: ; preds = %bb br label %bb3.backedge bb3.backedge: ; preds = %bb, %bb1 +; CHECK: bb3.backedge: +; CHECK-NEXT: phi +; CHECK-NEXT: icmp %7 = load i32* %0, align 4 ; <i32> [#uses=2] %8 = icmp eq i32 %7, 0 ; <i1> [#uses=1] br i1 %8, label %return, label %bb diff --git a/test/Transforms/GVN/mixed.ll b/test/Transforms/GVN/mixed.ll index 0c4f65c..5152f68 100644 --- a/test/Transforms/GVN/mixed.ll +++ b/test/Transforms/GVN/mixed.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep DEADLOAD -; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep DEADGEP +; RUN: opt < %s -gvn -S | not grep DEADLOAD +; RUN: opt < %s -gvn -S | not grep DEADGEP define i32 @main(i32** %p) { block1: diff --git a/test/Transforms/GVN/pre-basic-add.ll b/test/Transforms/GVN/pre-basic-add.ll index f00bda3..c13099f 100644 --- a/test/Transforms/GVN/pre-basic-add.ll +++ b/test/Transforms/GVN/pre-basic-add.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-pre | llvm-dis | grep {.pre} +; RUN: opt < %s -gvn -enable-pre -S | grep {.pre} @H = common global i32 0 ; <i32*> [#uses=2] @G = common global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/GVN/pre-single-pred.ll b/test/Transforms/GVN/pre-single-pred.ll index cb71617..706a16b 100644 --- a/test/Transforms/GVN/pre-single-pred.ll +++ b/test/Transforms/GVN/pre-single-pred.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -enable-load-pre | llvm-dis | not grep {tmp3 = load} +; RUN: opt < %s -gvn -enable-load-pre -S | not grep {tmp3 = load} @p = external global i32 define i32 @f(i32 %n) nounwind { diff --git a/test/Transforms/GVN/rle-dominated.ll b/test/Transforms/GVN/rle-dominated.ll index 0d51717..e86f592 100644 --- a/test/Transforms/GVN/rle-dominated.ll +++ b/test/Transforms/GVN/rle-dominated.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep load | count 2 +; RUN: opt < %s -gvn -S | grep load | count 2 define i32 @main(i32** %p) { block1: diff --git a/test/Transforms/GVN/rle-must-alias.ll b/test/Transforms/GVN/rle-must-alias.ll index ada4398..79cc363 100644 --- a/test/Transforms/GVN/rle-must-alias.ll +++ b/test/Transforms/GVN/rle-must-alias.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {DEAD = phi i32 } +; RUN: opt < %s -gvn -S | grep {DEAD = phi i32 } ; XFAIL: * ; FIXME: GVN should eliminate the fully redundant %9 GEP which diff --git a/test/Transforms/GVN/rle-no-phi-translate.ll b/test/Transforms/GVN/rle-no-phi-translate.ll index 9ffbe21..57457a7 100644 --- a/test/Transforms/GVN/rle-no-phi-translate.ll +++ b/test/Transforms/GVN/rle-no-phi-translate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep load +; RUN: opt < %s -gvn -S | grep load ; FIXME: This should be promotable, but memdep/gvn don't track values ; path/edge sensitively enough. diff --git a/test/Transforms/GVN/rle-nonlocal.ll b/test/Transforms/GVN/rle-nonlocal.ll index d932231..51b8986 100644 --- a/test/Transforms/GVN/rle-nonlocal.ll +++ b/test/Transforms/GVN/rle-nonlocal.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {%DEAD = phi i32. } +; RUN: opt < %s -gvn -S | grep {%DEAD = phi i32. } define i32 @main(i32** %p) { block1: diff --git a/test/Transforms/GVN/rle-phi-translate.ll b/test/Transforms/GVN/rle-phi-translate.ll index b5311ee..1f1baa9 100644 --- a/test/Transforms/GVN/rle-phi-translate.ll +++ b/test/Transforms/GVN/rle-phi-translate.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {%cv = phi i32} -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {%bv = phi i32} +; RUN: opt < %s -gvn -S | grep {%cv = phi i32} +; RUN: opt < %s -gvn -S | grep {%bv = phi i32} 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" target triple = "i386-apple-darwin7" diff --git a/test/Transforms/GVN/rle-semidominated.ll b/test/Transforms/GVN/rle-semidominated.ll index 5c11b06..04e8c38 100644 --- a/test/Transforms/GVN/rle-semidominated.ll +++ b/test/Transforms/GVN/rle-semidominated.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {DEAD = phi i32 } +; RUN: opt < %s -gvn -S | grep {DEAD = phi i32 } define i32 @main(i32* %p) { block1: diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll new file mode 100644 index 0000000..cdd1f4f --- /dev/null +++ b/test/Transforms/GVN/rle.ll @@ -0,0 +1,282 @@ +; RUN: opt < %s -gvn -S | FileCheck %s + +; 32-bit little endian target. +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" + +;; Trivial RLE test. +define i32 @test0(i32 %V, i32* %P) { + store i32 %V, i32* %P + + %A = load i32* %P + ret i32 %A +; CHECK: @test0 +; CHECK: ret i32 %V +} + + +;;===----------------------------------------------------------------------===;; +;; Tests for crashers +;;===----------------------------------------------------------------------===;; + +;; PR5016 +define i8 @crash0({i32, i32} %A, {i32, i32}* %P) { + store {i32, i32} %A, {i32, i32}* %P + %X = bitcast {i32, i32}* %P to i8* + %Y = load i8* %X + ret i8 %Y +} + + +;;===----------------------------------------------------------------------===;; +;; Store -> Load and Load -> Load forwarding where src and dst are different +;; types, but where the base pointer is a must alias. +;;===----------------------------------------------------------------------===;; + +;; i32 -> f32 forwarding. +define float @coerce_mustalias1(i32 %V, i32* %P) { + store i32 %V, i32* %P + + %P2 = bitcast i32* %P to float* + + %A = load float* %P2 + ret float %A +; CHECK: @coerce_mustalias1 +; CHECK-NOT: load +; CHECK: ret float +} + +;; i32* -> float forwarding. +define float @coerce_mustalias2(i32* %V, i32** %P) { + store i32* %V, i32** %P + + %P2 = bitcast i32** %P to float* + + %A = load float* %P2 + ret float %A +; CHECK: @coerce_mustalias2 +; CHECK-NOT: load +; CHECK: ret float +} + +;; float -> i32* forwarding. +define i32* @coerce_mustalias3(float %V, float* %P) { + store float %V, float* %P + + %P2 = bitcast float* %P to i32** + + %A = load i32** %P2 + ret i32* %A +; CHECK: @coerce_mustalias3 +; CHECK-NOT: load +; CHECK: ret i32* +} + +;; i32 -> f32 load forwarding. +define float @coerce_mustalias4(i32* %P, i1 %cond) { + %A = load i32* %P + + %P2 = bitcast i32* %P to float* + %B = load float* %P2 + br i1 %cond, label %T, label %F +T: + ret float %B + +F: + %X = bitcast i32 %A to float + ret float %X + +; CHECK: @coerce_mustalias4 +; CHECK: %A = load i32* %P +; CHECK-NOT: load +; CHECK: ret float +; CHECK: F: +} + +;; i32 -> i8 forwarding +define i8 @coerce_mustalias5(i32 %V, i32* %P) { + store i32 %V, i32* %P + + %P2 = bitcast i32* %P to i8* + + %A = load i8* %P2 + ret i8 %A +; CHECK: @coerce_mustalias5 +; CHECK-NOT: load +; CHECK: ret i8 +} + +;; i64 -> float forwarding +define float @coerce_mustalias6(i64 %V, i64* %P) { + store i64 %V, i64* %P + + %P2 = bitcast i64* %P to float* + + %A = load float* %P2 + ret float %A +; CHECK: @coerce_mustalias6 +; CHECK-NOT: load +; CHECK: ret float +} + +;; i64 -> i8* (32-bit) forwarding +define i8* @coerce_mustalias7(i64 %V, i64* %P) { + store i64 %V, i64* %P + + %P2 = bitcast i64* %P to i8** + + %A = load i8** %P2 + ret i8* %A +; CHECK: @coerce_mustalias7 +; CHECK-NOT: load +; CHECK: ret i8* +} + +;; non-local i32/float -> i8 load forwarding. +define i8 @coerce_mustalias_nonlocal0(i32* %P, i1 %cond) { + %P2 = bitcast i32* %P to float* + %P3 = bitcast i32* %P to i8* + br i1 %cond, label %T, label %F +T: + store i32 42, i32* %P + br label %Cont + +F: + store float 1.0, float* %P2 + br label %Cont + +Cont: + %A = load i8* %P3 + ret i8 %A + +; CHECK: @coerce_mustalias_nonlocal0 +; CHECK: Cont: +; CHECK: %A = phi i8 [ +; CHECK-NOT: load +; CHECK: ret i8 %A +} + +;; non-local i32/float -> i8 load forwarding. This also tests that the "P3" +;; bitcast equivalence can be properly phi translated. +define i8 @coerce_mustalias_nonlocal1(i32* %P, i1 %cond) { + %P2 = bitcast i32* %P to float* + br i1 %cond, label %T, label %F +T: + store i32 42, i32* %P + br label %Cont + +F: + store float 1.0, float* %P2 + br label %Cont + +Cont: + %P3 = bitcast i32* %P to i8* + %A = load i8* %P3 + ret i8 %A + +;; FIXME: This is disabled because this caused a miscompile in the llvm-gcc +;; bootstrap, see r82411 +; +; HECK: @coerce_mustalias_nonlocal1 +; HECK: Cont: +; HECK: %A = phi i8 [ +; HECK-NOT: load +; HECK: ret i8 %A +} + + +;; non-local i32 -> i8 partial redundancy load forwarding. +define i8 @coerce_mustalias_pre0(i32* %P, i1 %cond) { + %P3 = bitcast i32* %P to i8* + br i1 %cond, label %T, label %F +T: + store i32 42, i32* %P + br label %Cont + +F: + br label %Cont + +Cont: + %A = load i8* %P3 + ret i8 %A + +; CHECK: @coerce_mustalias_pre0 +; CHECK: F: +; CHECK: load i8* %P3 +; CHECK: Cont: +; CHECK: %A = phi i8 [ +; CHECK-NOT: load +; CHECK: ret i8 %A +} + +;;===----------------------------------------------------------------------===;; +;; Store -> Load and Load -> Load forwarding where src and dst are different +;; types, and the reload is an offset from the store pointer. +;;===----------------------------------------------------------------------===;; + +;; i32 -> i8 forwarding. +;; PR4216 +define i8 @coerce_offset0(i32 %V, i32* %P) { + store i32 %V, i32* %P + + %P2 = bitcast i32* %P to i8* + %P3 = getelementptr i8* %P2, i32 2 + + %A = load i8* %P3 + ret i8 %A +; CHECK: @coerce_offset0 +; CHECK-NOT: load +; CHECK: ret i8 +} + +;; non-local i32/float -> i8 load forwarding. +define i8 @coerce_offset_nonlocal0(i32* %P, i1 %cond) { + %P2 = bitcast i32* %P to float* + %P3 = bitcast i32* %P to i8* + %P4 = getelementptr i8* %P3, i32 2 + br i1 %cond, label %T, label %F +T: + store i32 42, i32* %P + br label %Cont + +F: + store float 1.0, float* %P2 + br label %Cont + +Cont: + %A = load i8* %P4 + ret i8 %A + +; CHECK: @coerce_offset_nonlocal0 +; CHECK: Cont: +; CHECK: %A = phi i8 [ +; CHECK-NOT: load +; CHECK: ret i8 %A +} + + +;; non-local i32 -> i8 partial redundancy load forwarding. +define i8 @coerce_offset_pre0(i32* %P, i1 %cond) { + %P3 = bitcast i32* %P to i8* + %P4 = getelementptr i8* %P3, i32 2 + br i1 %cond, label %T, label %F +T: + store i32 42, i32* %P + br label %Cont + +F: + br label %Cont + +Cont: + %A = load i8* %P4 + ret i8 %A + +; CHECK: @coerce_offset_pre0 +; CHECK: F: +; CHECK: load i8* %P4 +; CHECK: Cont: +; CHECK: %A = phi i8 [ +; CHECK-NOT: load +; CHECK: ret i8 %A +} + + diff --git a/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll b/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll index a79f673..37356f2 100644 --- a/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll +++ b/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globaldce +; RUN: opt < %s -globaldce ; define internal void @func() { ret void diff --git a/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll b/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll index 2a39846..740f720 100644 --- a/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll +++ b/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globaldce +; RUN: opt < %s -globaldce ; @X = global void ()* @func ; <void ()**> [#uses=0] diff --git a/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll index dac81a3..766c227 100644 --- a/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll +++ b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll @@ -1,7 +1,7 @@ ; Make sure that functions are removed successfully if they are referred to by ; a global that is dead. Make sure any globals they refer to die as well. -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep foo +; RUN: opt < %s -globaldce -S | not grep foo ;; Unused, kills %foo @b = internal global i32 ()* @foo ; <i32 ()**> [#uses=0] diff --git a/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll b/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll index d07f014..42fcb1e 100644 --- a/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll +++ b/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll @@ -1,7 +1,7 @@ ; This testcase tests that a worklist is being used, and that globals can be ; removed if they are the subject of a constexpr and ConstantPointerRef -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global +; RUN: opt < %s -globaldce -S | not grep global @t0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1] @t1 = internal global [4 x i8] c"bar\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll b/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll index b49bfcc..6221fa3 100644 --- a/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll +++ b/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globaldce +; RUN: opt < %s -globaldce ;; Should die when function %foo is killed @foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=3] diff --git a/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll b/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll index c6c51df..738ec43 100644 --- a/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll +++ b/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll @@ -1,5 +1,5 @@ ; distilled from 255.vortex -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep testfunc +; RUN: opt < %s -globaldce -S | not grep testfunc declare i1 ()* @getfunc() diff --git a/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll b/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll index 12d4736..5b2c97f 100644 --- a/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll +++ b/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll @@ -1,6 +1,6 @@ ; Weak variables should be preserved by global DCE! -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | grep @A +; RUN: opt < %s -globaldce -S | grep @A @A = weak global i32 54 diff --git a/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll b/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll index 264b81d..6658cee 100644 --- a/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll +++ b/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep @D -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | grep @L | count 3 +; RUN: opt < %s -globaldce -S | not grep @D +; RUN: opt < %s -globaldce -S | grep @L | count 3 @A = global i32 0 @D = alias internal i32* @A diff --git a/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll b/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll index 8c15c51..68933c6 100644 --- a/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll +++ b/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globaldce +; RUN: opt < %s -globaldce @A = alias internal void ()* @F define internal void @F() { ret void } diff --git a/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll b/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll new file mode 100644 index 0000000..29864f8 --- /dev/null +++ b/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll @@ -0,0 +1,264 @@ +; RUN: opt < %s -globaldce | llc -O0 -o /dev/null + +%struct..0__pthread_mutex_s = type { i32, i32, i32, i32, i32, i32, %struct.__pthread_list_t } +%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>" = type { i32 } +%struct.__pthread_list_t = type { %struct.__pthread_list_t*, %struct.__pthread_list_t* } +%struct.pthread_attr_t = type { i64, [48 x i8] } +%struct.pthread_mutex_t = type { %struct..0__pthread_mutex_s } + +@_ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0] +@_ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0] +@_ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0] +@_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0] +@_ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; <i32 (i64)*> [#uses=0] +@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0] +@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0] +@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0] +@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%struct.pthread_mutex_t*, %"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*)* @pthread_mutex_init ; <i32 (%struct.pthread_mutex_t*, %"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*)*> [#uses=0] +@_ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0] +@_ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0] +@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*)* @pthread_mutexattr_init ; <i32 (%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*)*> [#uses=0] +@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*, i32)* @pthread_mutexattr_settype ; <i32 (%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*, i32)*> [#uses=0] +@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*)* @pthread_mutexattr_destroy ; <i32 (%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*)*> [#uses=0] + +define weak void @_ZN9__gnu_cxx26__aux_require_boolean_exprIbEEvRKT_(i8* %__t) { +entry: + tail call void @llvm.dbg.func.start(metadata !0) + tail call void @llvm.dbg.stoppoint(i32 240, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !0) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_19_ConvertibleConceptIjjEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !8) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !8) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPcEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !11) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !11) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKcEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !12) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !12) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPwEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !13) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !13) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKwEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !14) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !14) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPwEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !15) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !15) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPcEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !16) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !16) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIiEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !17) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !17) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIlEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !18) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !18) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIxEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !19) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !19) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIjEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !20) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !20) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIcSt11char_traitsIcEEcEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !21) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !21) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIwSt11char_traitsIwEEwEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !22) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !22) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPcEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !23) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !23) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKcEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !24) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !24) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKcSsEEEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !25) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !25) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPcSsEEEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !26) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !26) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKwSbIwSt11char_traitsIwESaIwEEEEEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !27) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !27) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPwSbIwSt11char_traitsIwESaIwEEEEEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !28) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !28) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPwEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !29) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !29) + ret void +} + +define weak void @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKwEEEEvv() { +entry: + tail call void @llvm.dbg.func.start(metadata !30) + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) + tail call void @llvm.dbg.region.end(metadata !30) + ret void +} + +declare void @llvm.dbg.func.start(metadata) nounwind readnone + +declare void @llvm.dbg.stoppoint(i32, i32, metadata) nounwind readnone + +declare void @llvm.dbg.region.end(metadata) nounwind readnone + +declare extern_weak i32 @pthread_once(i32*, void ()*) + +declare extern_weak i8* @pthread_getspecific(i32) + +declare extern_weak i32 @pthread_setspecific(i32, i8*) + +declare extern_weak i32 @pthread_create(i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*) + +declare extern_weak i32 @pthread_cancel(i64) + +declare extern_weak i32 @pthread_mutex_lock(%struct.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_trylock(%struct.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_init(%struct.pthread_mutex_t*, %"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*) + +declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*) + +declare extern_weak i32 @pthread_key_delete(i32) + +declare extern_weak i32 @pthread_mutexattr_init(%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*) + +declare extern_weak i32 @pthread_mutexattr_settype(%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*, i32) + +declare extern_weak i32 @pthread_mutexattr_destroy(%"struct.__gnu_cxx::_ConvertibleConcept<unsigned int,unsigned int>"*) + +!0 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__aux_require_boolean_expr<bool>", metadata !"__aux_require_boolean_expr<bool>", metadata !"_ZN9__gnu_cxx26__aux_require_boolean_exprIbEEvRKT_", metadata !2, i32 239, metadata !3, i1 false, i1 true} +!1 = metadata !{i32 458769, i32 0, i32 4, metadata !"concept-inst.cc", metadata !"/home/buildbot/buildslave/llvm-x86_64-linux-selfhost/llvm-gcc.obj/x86_64-unknown-linux-gnu/libstdc++-v3/src/../../../../llvm-gcc.src/libstdc++-v3/src", metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build)", i1 true, i1 true, metadata !"", i32 0} +!2 = metadata !{i32 458769, i32 0, i32 4, metadata !"boost_concept_check.h", metadata !"/home/buildbot/buildslave/llvm-x86_64-linux-selfhost/llvm-gcc.obj/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits", metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build)", i1 false, i1 true, metadata !"", i32 0} +!3 = metadata !{i32 458773, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !4, i32 0} +!4 = metadata !{null, metadata !5} +!5 = metadata !{i32 458768, metadata !1, metadata !"", metadata !1, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !6} +!6 = metadata !{i32 458790, metadata !1, metadata !"", metadata !1, i32 0, i64 8, i64 8, i64 0, i32 0, metadata !7} +!7 = metadata !{i32 458788, metadata !1, metadata !"bool", metadata !1, i32 0, i64 8, i64 8, i64 0, i32 0, i32 2} +!8 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_ConvertibleConcept<unsigned int, unsigned int> >", metadata !"__function_requires<__gnu_cxx::_ConvertibleConcept<unsigned int, unsigned int> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_19_ConvertibleConceptIjjEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!9 = metadata !{i32 458773, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !10, i32 0} +!10 = metadata !{null} +!11 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<char*> >", metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<char*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPcEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!12 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<const char*> >", metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<const char*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKcEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!13 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<wchar_t*> >", metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<wchar_t*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPwEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!14 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<const wchar_t*> >", metadata !"__function_requires<__gnu_cxx::_InputIteratorConcept<const wchar_t*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKwEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!15 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<wchar_t*> >", metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<wchar_t*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPwEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!16 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<char*> >", metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<char*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPcEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!17 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<int> >", metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<int> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIiEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!18 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<long int> >", metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<long int> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIlEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!19 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<long long int> >", metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<long long int> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIxEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!20 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<unsigned int> >", metadata !"__function_requires<__gnu_cxx::_LessThanComparableConcept<unsigned int> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIjEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!21 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_OutputIteratorConcept<std::ostreambuf_iterator<char, std::char_traits<char> >, char> >", metadata !"__function_requires<__gnu_cxx::_OutputIteratorConcept<std::ostreambuf_iterator<char, std::char_traits<char> >, char> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIcSt11char_traitsIcEEcEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!22 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_OutputIteratorConcept<std::ostreambuf_iterator<wchar_t, std::char_traits<wchar_t> >, wchar_t> >", metadata !"__function_requires<__gnu_cxx::_OutputIteratorConcept<std::ostreambuf_iterator<wchar_t, std::char_traits<wchar_t> >, wchar_t> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIwSt11char_traitsIwEEwEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!23 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<char*> >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<char*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPcEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!24 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<const char*> >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<const char*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKcEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!25 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKcSsEEEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!26 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPcSsEEEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!27 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<const wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKwSbIwSt11char_traitsIwESaIwEEEEEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!28 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator<wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPwSbIwSt11char_traitsIwESaIwEEEEEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!29 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<wchar_t*> >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<wchar_t*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPwEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} +!30 = metadata !{i32 458798, i32 0, metadata !1, metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<const wchar_t*> >", metadata !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept<const wchar_t*> >", metadata !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKwEEEEvv", metadata !2, i32 61, metadata !9, i1 false, i1 true} diff --git a/test/Transforms/GlobalDCE/basicvariabletest.ll b/test/Transforms/GlobalDCE/basicvariabletest.ll index c883e58..a97b66d 100644 --- a/test/Transforms/GlobalDCE/basicvariabletest.ll +++ b/test/Transforms/GlobalDCE/basicvariabletest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global +; RUN: opt < %s -globaldce -S | not grep global @X = external global i32 @Y = internal global i32 7 diff --git a/test/Transforms/GlobalDCE/externally_available.ll b/test/Transforms/GlobalDCE/externally_available.ll index ccdf7e1..cc88cb1 100644 --- a/test/Transforms/GlobalDCE/externally_available.ll +++ b/test/Transforms/GlobalDCE/externally_available.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep test_ +; RUN: opt < %s -globaldce -S | not grep test_ ; test_function should not be emitted to the .s file. define available_externally i32 @test_function() { diff --git a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll index 5f784e0..bdcf1fa 100644 --- a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll +++ b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt +; RUN: opt < %s -globalopt @V = global float 1.200000e+01 ; <float*> [#uses=1] @G = internal global i32* null ; <i32**> [#uses=2] diff --git a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll index 80f8243..7bcb1d4 100644 --- a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll +++ b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output ; PR579 @g_40507551 = internal global i16 31038 ; <i16*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll index 5eac431..ab2077a 100644 --- a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll +++ b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output %RPyString = type { i32, %arraytype.Char } %arraytype.Char = type { i32, [0 x i8] } %arraytype.Signed = type { i32, [0 x i32] } diff --git a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll index 5559ef1..c971219 100644 --- a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll +++ b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output ; PR820 target datalayout = "e-p:32:32" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll index 39be6c4..352639a 100644 --- a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll +++ b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output %struct._list = type { i32*, %struct._list* } %struct._play = type { i32, i32*, %struct._list*, %struct._play* } diff --git a/test/Transforms/GlobalOpt/2007-04-05-Crash.ll b/test/Transforms/GlobalOpt/2007-04-05-Crash.ll index 1991d90..d306d14 100644 --- a/test/Transforms/GlobalOpt/2007-04-05-Crash.ll +++ b/test/Transforms/GlobalOpt/2007-04-05-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output 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" target triple = "thumb-apple-darwin8" diff --git a/test/Transforms/GlobalOpt/2007-05-13-Crash.ll b/test/Transforms/GlobalOpt/2007-05-13-Crash.ll index 22fee77..5703909 100644 --- a/test/Transforms/GlobalOpt/2007-05-13-Crash.ll +++ b/test/Transforms/GlobalOpt/2007-05-13-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll b/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll index 7394f04..7036c15 100644 --- a/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll +++ b/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output ; PR1491 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" diff --git a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll index 0d7d036..442cb92 100644 --- a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll +++ b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -disable-output +; RUN: opt < %s -globalopt -disable-output 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" target triple = "powerpc-apple-darwin8" %struct.empty0 = type { } diff --git a/test/Transforms/GlobalOpt/2008-01-03-Crash.ll b/test/Transforms/GlobalOpt/2008-01-03-Crash.ll index 3d8c77d..4105ab1 100644 --- a/test/Transforms/GlobalOpt/2008-01-03-Crash.ll +++ b/test/Transforms/GlobalOpt/2008-01-03-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis +; RUN: opt < %s -globalopt | llvm-dis ; PR1896 @indirect1 = internal global void (i32)* null ; <void (i32)**> [#uses=2] diff --git a/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll b/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll index aace346..82abc8fe 100644 --- a/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll +++ b/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {16 x .31 x double.. zeroinitializer} +; RUN: opt < %s -globalopt -S | grep {16 x .31 x double.. zeroinitializer} ; The 'X' indices could be larger than 31. Do not SROA the outer indices of this array. @mm = internal global [16 x [31 x double]] zeroinitializer, align 32 diff --git a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll index 779e7fb..0c81700 100644 --- a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll +++ b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {volatile load} +; RUN: opt < %s -globalopt -S | grep {volatile load} @t0.1441 = internal global double 0x3FD5555555555555, align 8 ; <double*> [#uses=1] define double @foo() nounwind { diff --git a/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll b/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll index 59996c5..0e70c49 100644 --- a/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll +++ b/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep { nest } | count 1 +; RUN: opt < %s -globalopt -S | grep { nest } | count 1 %struct.FRAME.nest = type { i32, i32 (i32)* } %struct.__builtin_trampoline = type { [10 x i8] } @.str = internal constant [7 x i8] c"%d %d\0A\00" ; <[7 x i8]*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll b/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll index 8a0b5b3..cfc9f30 100644 --- a/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll +++ b/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll @@ -2,9 +2,9 @@ ; alignments. Elements 0 and 2 must be 16-byte aligned, and element ; 1 must be at least 8 byte aligned (but could be more). -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.0 = internal global .*align 16} -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.1 = internal global .*align 8} -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@G.2 = internal global .*align 16} +; RUN: opt < %s -globalopt -S | grep {@G.0 = internal global .*align 16} +; RUN: opt < %s -globalopt -S | grep {@G.1 = internal global .*align 8} +; RUN: opt < %s -globalopt -S | grep {@G.2 = internal global .*align 16} ; rdar://5891920 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" diff --git a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll index 735a84d..5e64f80 100644 --- a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll +++ b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll @@ -2,7 +2,7 @@ ; values. This used to crash, because globalopt forgot to put the new var in the ; same address space as the old one. -; RUN: llvm-as < %s | opt -globalopt | llvm-dis > %t +; RUN: opt < %s -globalopt -S > %t ; Check that the new global values still have their address space ; RUN: cat %t | grep global.*addrspace diff --git a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll index cdc2771..3242e1e 100644 --- a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll +++ b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis +; RUN: opt < %s -globalopt | llvm-dis 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" target triple = "i386-apple-darwin7" %struct.foo = type { i32, i32 } diff --git a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll index f284840..51dcac1 100644 --- a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll +++ b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis +; RUN: opt < %s -globalopt | llvm-dis 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" target triple = "i386-apple-darwin7" %struct.foo = type { i32, i32 } diff --git a/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll b/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll index 03ec3b6..c4b6e52 100644 --- a/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll +++ b/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {phi.*@head} +; RUN: opt < %s -globalopt -S | grep {phi.*@head} ; PR3321 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" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll index e59c8df..a1b69ef 100644 --- a/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll +++ b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt +; RUN: opt < %s -globalopt @g = external global i32 diff --git a/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll b/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll index f042e59..5e639fd 100644 --- a/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll +++ b/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {define void @a} +; RUN: opt < %s -globalopt -S | grep {define void @a} define internal void @f() { ret void diff --git a/test/Transforms/GlobalOpt/2009-03-03-dbg.ll b/test/Transforms/GlobalOpt/2009-03-03-dbg.ll index 1996f62..070f89f 100644 --- a/test/Transforms/GlobalOpt/2009-03-03-dbg.ll +++ b/test/Transforms/GlobalOpt/2009-03-03-dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global_variable42 +; RUN: opt < %s -globalopt -S | not grep global_variable42 ; XFAIL: * %llvm.dbg.anchor.type = type { i32, i32 } diff --git a/test/Transforms/GlobalOpt/2009-03-05-dbg.ll b/test/Transforms/GlobalOpt/2009-03-05-dbg.ll index 30e9a63..a5f9ed3 100644 --- a/test/Transforms/GlobalOpt/2009-03-05-dbg.ll +++ b/test/Transforms/GlobalOpt/2009-03-05-dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -stats -disable-output |& grep "1 globalopt - Number of global vars shrunk to booleans" +; RUN: opt < %s -globalopt -stats -disable-output |& grep "1 globalopt - Number of global vars shrunk to booleans" ; XFAIL: * type { } ; type %0 diff --git a/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll b/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll index ea13d29..62f75e1 100644 --- a/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll +++ b/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep internal | count 2 +; RUN: opt < %s -globalopt -S | grep internal | count 2 global i32 0 define i32* @1() { diff --git a/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll b/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll index 8dba5b1..e024fc2 100644 --- a/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll +++ b/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X = internal global i32} +; RUN: opt < %s -globalopt -S | grep {@X = internal global i32} 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" target triple = "i386-apple-darwin7" @X = internal global i32* null ; <i32**> [#uses=2] diff --git a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll index 0ce16dd..abd3109 100644 --- a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll +++ b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt +; RUN: opt < %s -globalopt %struct.s_annealing_sched = type { i32, float, float, float, float } %struct.s_bb = type { i32, i32, i32, i32 } diff --git a/test/Transforms/GlobalOpt/alias-resolve.ll b/test/Transforms/GlobalOpt/alias-resolve.ll index 3cae413..8451179 100644 --- a/test/Transforms/GlobalOpt/alias-resolve.ll +++ b/test/Transforms/GlobalOpt/alias-resolve.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis > %t +; RUN: opt < %s -globalopt -S > %t ; RUN: cat %t | grep foo1 | count 1 ; RUN: cat %t | grep foo2 | count 4 ; RUN: cat %t | grep bar1 | count 1 diff --git a/test/Transforms/GlobalOpt/basictest.ll b/test/Transforms/GlobalOpt/basictest.ll index 1c3bdbb..4332d3d 100644 --- a/test/Transforms/GlobalOpt/basictest.ll +++ b/test/Transforms/GlobalOpt/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global +; RUN: opt < %s -globalopt -S | not grep global @X = internal global i32 4 ; <i32*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/constantexpr-dangle.ll b/test/Transforms/GlobalOpt/constantexpr-dangle.ll index 6fa139b..099c607 100644 --- a/test/Transforms/GlobalOpt/constantexpr-dangle.ll +++ b/test/Transforms/GlobalOpt/constantexpr-dangle.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -globalopt | llvm-dis | \ +; RUN: opt < %s -instcombine -globalopt -S | \ ; RUN: grep {internal fastcc float @foo} define internal float @foo() { diff --git a/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll b/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll index 45fb453..5fe89ee 100644 --- a/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll +++ b/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR +; RUN: opt < %s -globalopt -S | not grep CTOR @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] @G = global i32 0 ; <i32*> [#uses=1] @G2 = global i32 0 ; <i32*> [#uses=1] @@ -56,9 +56,9 @@ define internal void @CTOR4() { } define internal void @CTOR5() { - %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2] + %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2] %X.2 = load i32* %X.2p ; <i32> [#uses=1] - %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1] + %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1] store i32 %X.2, i32* %X.1p store i32 42, i32* %X.2p ret void diff --git a/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll b/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll new file mode 100644 index 0000000..9b11985 --- /dev/null +++ b/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll @@ -0,0 +1,23 @@ +; RUN: opt < %s -globalopt -S | FileCheck %s + +; Don't get fooled by the inbounds keyword; it doesn't change +; the computed address. + +; CHECK: @H = global i32 2 +; CHECK: @I = global i32 2 + +@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ] +@addr = external global i32 +@G = internal global [6 x [5 x i32]] zeroinitializer +@H = global i32 80 +@I = global i32 90 + +define internal void @CTOR() { + store i32 1, i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 2, i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + %t = load i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 %t, i32* @H + %s = load i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 %s, i32* @I + ret void +} diff --git a/test/Transforms/GlobalOpt/ctor-list-opt.ll b/test/Transforms/GlobalOpt/ctor-list-opt.ll index 56aeadb..887e7ee 100644 --- a/test/Transforms/GlobalOpt/ctor-list-opt.ll +++ b/test/Transforms/GlobalOpt/ctor-list-opt.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep CTOR +; RUN: opt < %s -globalopt -S | not grep CTOR @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] @G = global i32 0 ; <i32*> [#uses=1] @G2 = global i32 0 ; <i32*> [#uses=1] @@ -43,9 +43,9 @@ define internal void @CTOR4() { } define internal void @CTOR5() { - %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2] + %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2] %X.2 = load i32* %X.2p ; <i32> [#uses=1] - %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1] + %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1] store i32 %X.2, i32* %X.1p store i32 42, i32* %X.2p ret void diff --git a/test/Transforms/GlobalOpt/deadglobal-2.ll b/test/Transforms/GlobalOpt/deadglobal-2.ll index def6a09..4f81819 100644 --- a/test/Transforms/GlobalOpt/deadglobal-2.ll +++ b/test/Transforms/GlobalOpt/deadglobal-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal +; RUN: opt < %s -globalopt -S | not grep internal ; This is a harder case to delete as the GEP has a variable index. diff --git a/test/Transforms/GlobalOpt/deadglobal.ll b/test/Transforms/GlobalOpt/deadglobal.ll index 7a47b8e..c8d8e76 100644 --- a/test/Transforms/GlobalOpt/deadglobal.ll +++ b/test/Transforms/GlobalOpt/deadglobal.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep internal +; RUN: opt < %s -globalopt -S | not grep internal @G = internal global i32 123 ; <i32*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/globalsra-partial.ll b/test/Transforms/GlobalOpt/globalsra-partial.ll index e52e7fe..9a068e9 100644 --- a/test/Transforms/GlobalOpt/globalsra-partial.ll +++ b/test/Transforms/GlobalOpt/globalsra-partial.ll @@ -1,6 +1,6 @@ ; In this case, the global can only be broken up by one level. -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep 12345 +; RUN: opt < %s -globalopt -S | not grep 12345 @G = internal global { i32, [4 x float] } zeroinitializer ; <{ i32, [4 x float] }*> [#uses=3] diff --git a/test/Transforms/GlobalOpt/globalsra-unknown-index.ll b/test/Transforms/GlobalOpt/globalsra-unknown-index.ll new file mode 100644 index 0000000..9397a12 --- /dev/null +++ b/test/Transforms/GlobalOpt/globalsra-unknown-index.ll @@ -0,0 +1,41 @@ +; RUN: opt < %s -globalopt -S > %t +; RUN: grep {@Y = internal global \\\[3 x \[%\]struct.X\\\] zeroinitializer} %t +; RUN: grep load %t | count 6 +; RUN: grep {add i32 \[%\]a, \[%\]b} %t | count 3 + +; globalopt should not sra the global, because it can't see the index. + +%struct.X = type { [3 x i32], [3 x i32] } + +@Y = internal global [3 x %struct.X] zeroinitializer + +@addr = external global i8 + +define void @frob() { + store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 ptrtoint (i8* @addr to i64)), align 4 + ret void +} +define i32 @borf(i64 %i, i64 %j) { + %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0 + %a = load i32* %p + %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0 + %b = load i32* %q + %c = add i32 %a, %b + ret i32 %c +} +define i32 @borg(i64 %i, i64 %j) { + %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1 + %a = load i32* %p + %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1 + %b = load i32* %q + %c = add i32 %a, %b + ret i32 %c +} +define i32 @borh(i64 %i, i64 %j) { + %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2 + %a = load i32* %p + %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2 + %b = load i32* %q + %c = add i32 %a, %b + ret i32 %c +} diff --git a/test/Transforms/GlobalOpt/globalsra.ll b/test/Transforms/GlobalOpt/globalsra.ll index 3623555..276ca64 100644 --- a/test/Transforms/GlobalOpt/globalsra.ll +++ b/test/Transforms/GlobalOpt/globalsra.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global +; RUN: opt < %s -globalopt -S | not grep global @G = internal global { i32, float, { double } } { i32 1, diff --git a/test/Transforms/GlobalOpt/heap-sra-1.ll b/test/Transforms/GlobalOpt/heap-sra-1.ll index 37e6d47..6df559e 100644 --- a/test/Transforms/GlobalOpt/heap-sra-1.ll +++ b/test/Transforms/GlobalOpt/heap-sra-1.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f0} -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f1} +; RUN: opt < %s -globalopt -S | grep {@X.f0} +; RUN: opt < %s -globalopt -S | grep {@X.f1} 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" target triple = "i386-apple-darwin7" diff --git a/test/Transforms/GlobalOpt/heap-sra-2.ll b/test/Transforms/GlobalOpt/heap-sra-2.ll index 98f4a50..5a3c3cd1 100644 --- a/test/Transforms/GlobalOpt/heap-sra-2.ll +++ b/test/Transforms/GlobalOpt/heap-sra-2.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f0} -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {@X.f1} +; RUN: opt < %s -globalopt -S | grep {@X.f0} +; RUN: opt < %s -globalopt -S | grep {@X.f1} 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" target triple = "i386-apple-darwin7" diff --git a/test/Transforms/GlobalOpt/heap-sra-phi.ll b/test/Transforms/GlobalOpt/heap-sra-phi.ll index 5f46a77..2eba944 100644 --- a/test/Transforms/GlobalOpt/heap-sra-phi.ll +++ b/test/Transforms/GlobalOpt/heap-sra-phi.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {tmp.f1 = phi i32. } -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {tmp.f0 = phi i32. } +; RUN: opt < %s -globalopt -S | grep {tmp.f1 = phi i32. } +; RUN: opt < %s -globalopt -S | grep {tmp.f0 = phi i32. } 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" target triple = "i386-apple-darwin7" diff --git a/test/Transforms/GlobalOpt/integer-bool.ll b/test/Transforms/GlobalOpt/integer-bool.ll index 9fbbe35..59403b1 100644 --- a/test/Transforms/GlobalOpt/integer-bool.ll +++ b/test/Transforms/GlobalOpt/integer-bool.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt -instcombine | \ +; RUN: opt < %s -globalopt -instcombine | \ ; RUN: llvm-dis | grep {ret i1 true} ;; check that global opt turns integers that only hold 0 or 1 into bools. diff --git a/test/Transforms/GlobalOpt/iterate.ll b/test/Transforms/GlobalOpt/iterate.ll index d764c5d..7466874 100644 --- a/test/Transforms/GlobalOpt/iterate.ll +++ b/test/Transforms/GlobalOpt/iterate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep %G +; RUN: opt < %s -globalopt -S | not grep %G @G = internal global i32 0 ; <i32*> [#uses=1] @H = internal global { i32* } { i32* @G } ; <{ i32* }*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/load-store-global.ll b/test/Transforms/GlobalOpt/load-store-global.ll index d89d226..f824b2c 100644 --- a/test/Transforms/GlobalOpt/load-store-global.ll +++ b/test/Transforms/GlobalOpt/load-store-global.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G +; RUN: opt < %s -globalopt -S | not grep G @G = internal global i32 17 ; <i32*> [#uses=3] diff --git a/test/Transforms/GlobalOpt/malloc-promote-1.ll b/test/Transforms/GlobalOpt/malloc-promote-1.ll index fea4dbd..5d4696f 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-1.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global +; RUN: opt < %s -globalopt -S | not grep global @G = internal global i32* null ; <i32**> [#uses=3] diff --git a/test/Transforms/GlobalOpt/malloc-promote-2.ll b/test/Transforms/GlobalOpt/malloc-promote-2.ll index 1b33632..0d03835 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-2.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc +; RUN: opt < %s -globalopt -S | not grep malloc @G = internal global i32* null ; <i32**> [#uses=3] diff --git a/test/Transforms/GlobalOpt/malloc-promote-3.ll b/test/Transforms/GlobalOpt/malloc-promote-3.ll index 26ce8fd..d4ee4e8 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-3.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc +; RUN: opt < %s -globalopt -S | not grep malloc @G = internal global i32* null ; <i32**> [#uses=4] diff --git a/test/Transforms/GlobalOpt/memcpy.ll b/test/Transforms/GlobalOpt/memcpy.ll index b51aedb..335f5ec 100644 --- a/test/Transforms/GlobalOpt/memcpy.ll +++ b/test/Transforms/GlobalOpt/memcpy.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \ +; RUN: opt < %s -globalopt -S | \ ; RUN: grep {G1 = internal constant} @G1 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/memset.ll b/test/Transforms/GlobalOpt/memset.ll index 0ee851f..a9b9d5e 100644 --- a/test/Transforms/GlobalOpt/memset.ll +++ b/test/Transforms/GlobalOpt/memset.ll @@ -1,6 +1,6 @@ ; both globals are write only, delete them. -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \ +; RUN: opt < %s -globalopt -S | \ ; RUN: not grep internal @G0 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/phi-select.ll b/test/Transforms/GlobalOpt/phi-select.ll index da1314f7..cd8a7dc 100644 --- a/test/Transforms/GlobalOpt/phi-select.ll +++ b/test/Transforms/GlobalOpt/phi-select.ll @@ -1,7 +1,7 @@ ; Test that PHI nodes and select instructions do not necessarily make stuff ; non-constant. -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global +; RUN: opt < %s -globalopt -S | not grep global @X = internal global i32 4 ; <i32*> [#uses=2] @Y = internal global i32 5 ; <i32*> [#uses=2] diff --git a/test/Transforms/GlobalOpt/storepointer-compare.ll b/test/Transforms/GlobalOpt/storepointer-compare.ll index 86eff51..2f5ae86 100644 --- a/test/Transforms/GlobalOpt/storepointer-compare.ll +++ b/test/Transforms/GlobalOpt/storepointer-compare.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \ +; RUN: opt < %s -globalopt -S | \ ; RUN: grep {call void @Actual} ; Check that a comparison does not prevent an indirect call from being made diff --git a/test/Transforms/GlobalOpt/storepointer.ll b/test/Transforms/GlobalOpt/storepointer.ll index d57a6ac..8019076 100644 --- a/test/Transforms/GlobalOpt/storepointer.ll +++ b/test/Transforms/GlobalOpt/storepointer.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global +; RUN: opt < %s -globalopt -S | not grep global @G = internal global void ()* null ; <void ()**> [#uses=2] diff --git a/test/Transforms/GlobalOpt/trivialstore.ll b/test/Transforms/GlobalOpt/trivialstore.ll index a662565..21437f3 100644 --- a/test/Transforms/GlobalOpt/trivialstore.ll +++ b/test/Transforms/GlobalOpt/trivialstore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep G +; RUN: opt < %s -globalopt -S | not grep G @G = internal global i32 17 ; <i32*> [#uses=3] diff --git a/test/Transforms/GlobalOpt/undef-init.ll b/test/Transforms/GlobalOpt/undef-init.ll index bb483fc..c149497 100644 --- a/test/Transforms/GlobalOpt/undef-init.ll +++ b/test/Transforms/GlobalOpt/undef-init.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep store +; RUN: opt < %s -globalopt -S | not grep store @llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z3foov } ] ; <[1 x { i32, void ()* }]*> [#uses=0] @X.0 = internal global i32 undef ; <i32*> [#uses=2] diff --git a/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll b/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll index fc7e3bb..6640336 100644 --- a/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll +++ b/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipconstprop | llvm-dis | grep {ret i32 %r} +; RUN: opt < %s -ipconstprop -S | grep {ret i32 %r} ; Should not propagate the result of a weak function. ; PR2411 diff --git a/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll b/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll new file mode 100644 index 0000000..f4bab35 --- /dev/null +++ b/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll @@ -0,0 +1,40 @@ +; RUN: llvm-as <%s | opt -ipsccp | llvm-dis | FileCheck %s +; Don't constant-propagate byval pointers, since they are not pointers! +; PR5038 +%struct.MYstr = type { i8, i32 } +@mystr = internal global %struct.MYstr zeroinitializer ; <%struct.MYstr*> [#uses=3] +define internal void @vfu1(%struct.MYstr* byval align 4 %u) nounwind { +entry: + %0 = getelementptr %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1] + store i32 99, i32* %0, align 4 +; CHECK: %struct.MYstr* %u + %1 = getelementptr %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1] + store i8 97, i8* %1, align 4 +; CHECK: %struct.MYstr* %u + br label %return + +return: ; preds = %entry + ret void +} + +define internal i32 @vfu2(%struct.MYstr* byval align 4 %u) nounwind readonly { +entry: + %0 = getelementptr %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1] + %1 = load i32* %0 +; CHECK: load i32* getelementptr inbounds (%struct.MYstr* @mystr, i32 0, i32 1) ; <i32> [#uses=1] + %2 = getelementptr %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1] + %3 = load i8* %2 +; CHECK: load i8* getelementptr inbounds (%struct.MYstr* @mystr, i32 0, i32 0) ; <i8> [#uses=1] + %4 = zext i8 %3 to i32 + %5 = add i32 %4, %1 + ret i32 %5 +} + +define i32 @unions() nounwind { +entry: + call void @vfu1(%struct.MYstr* byval align 4 @mystr) nounwind + %result = call i32 @vfu2(%struct.MYstr* byval align 4 @mystr) nounwind + + ret i32 %result +} + diff --git a/test/Transforms/IPConstantProp/deadarg.ll b/test/Transforms/IPConstantProp/deadarg.ll index 18b8f7d..4b9938e 100644 --- a/test/Transforms/IPConstantProp/deadarg.ll +++ b/test/Transforms/IPConstantProp/deadarg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipconstprop -disable-output +; RUN: opt < %s -ipconstprop -disable-output define internal void @foo(i32 %X) { call void @foo( i32 %X ) ret void diff --git a/test/Transforms/IPConstantProp/recursion.ll b/test/Transforms/IPConstantProp/recursion.ll index 27c381a..b25a6c0 100644 --- a/test/Transforms/IPConstantProp/recursion.ll +++ b/test/Transforms/IPConstantProp/recursion.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipconstprop -deadargelim | llvm-dis | not grep %X +; RUN: opt < %s -ipconstprop -deadargelim -S | not grep %X define internal i32 @foo(i32 %X) { %Y = call i32 @foo( i32 %X ) ; <i32> [#uses=1] %Z = add i32 %Y, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/IPConstantProp/return-argument.ll b/test/Transforms/IPConstantProp/return-argument.ll index f860510..0223453 100644 --- a/test/Transforms/IPConstantProp/return-argument.ll +++ b/test/Transforms/IPConstantProp/return-argument.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipconstprop | llvm-dis > %t +; RUN: opt < %s -ipconstprop -S > %t ; RUN: cat %t | grep {store i32 %Z, i32\\* %Q} ; RUN: cat %t | grep {add i32 1, 3} diff --git a/test/Transforms/IPConstantProp/return-constant.ll b/test/Transforms/IPConstantProp/return-constant.ll index 381ef63..b255859 100644 --- a/test/Transforms/IPConstantProp/return-constant.ll +++ b/test/Transforms/IPConstantProp/return-constant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipconstprop -instcombine | \ +; RUN: opt < %s -ipconstprop -instcombine | \ ; RUN: llvm-dis | grep {ret i1 true} | count 2 define internal i32 @foo(i1 %C) { br i1 %C, label %T, label %F diff --git a/test/Transforms/IPConstantProp/return-constants.ll b/test/Transforms/IPConstantProp/return-constants.ll index 7205c28..79220dd 100644 --- a/test/Transforms/IPConstantProp/return-constants.ll +++ b/test/Transforms/IPConstantProp/return-constants.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipconstprop | llvm-dis > %t +; RUN: opt < %s -ipconstprop -S > %t ;; Check that the 21 constants got propagated properly ; RUN: cat %t | grep {%M = add i32 21, 21} ;; Check that the second return values didn't get propagated diff --git a/test/Transforms/IndMemRem/2009-01-24-Noalias.ll b/test/Transforms/IndMemRem/2009-01-24-Noalias.ll index bc3d0bf..b6d9803 100644 --- a/test/Transforms/IndMemRem/2009-01-24-Noalias.ll +++ b/test/Transforms/IndMemRem/2009-01-24-Noalias.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indmemrem | llvm-dis | grep bounce | grep noalias +; RUN: opt < %s -indmemrem -S | grep bounce | grep noalias declare i8* @malloc(i32) diff --git a/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll b/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll index 228772e..92911ae 100644 --- a/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll +++ b/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll @@ -1,7 +1,7 @@ ; Induction variable pass is doing bad things with pointer induction vars, ; trying to do arithmetic on them directly. ; -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; define void @test(i32 %A, i32 %S, i8* %S.upgrd.1) { ; <label>:0 diff --git a/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll b/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll index 2487ea9..38fa112 100644 --- a/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll +++ b/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll @@ -1,7 +1,7 @@ ; This is a test case for the expression analysis code, not really indvars. ; It was assuming any constant of int type was a ConstantInteger. ; -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars @X = global i32 7 ; <i32*> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2003-09-12-MultiplePred.ll b/test/Transforms/IndVarSimplify/2003-09-12-MultiplePred.ll index 9619099..36d5006 100644 --- a/test/Transforms/IndVarSimplify/2003-09-12-MultiplePred.ll +++ b/test/Transforms/IndVarSimplify/2003-09-12-MultiplePred.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar +; RUN: opt < %s -indvars -S | grep indvar define i32 @test() { ; <label>:0 diff --git a/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll b/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll index b4a2c50..150ae70 100644 --- a/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll +++ b/test/Transforms/IndVarSimplify/2003-09-23-NotAtTop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | %prcontext ^Loop: 1 | grep %Canonical +; RUN: opt -S -indvars %s | FileCheck %s ; The indvar simplification code should ensure that the first PHI in the block ; is the canonical one! @@ -8,6 +8,8 @@ define i32 @test() { br label %Loop Loop: ; preds = %Loop, %0 +; CHECK: Loop: +; CHECK-NEXT: Canonical %NonIndvar = phi i32 [ 200, %0 ], [ %NonIndvarNext, %Loop ] ; <i32> [#uses=1] %Canonical = phi i32 [ 0, %0 ], [ %CanonicalNext, %Loop ] ; <i32> [#uses=2] store i32 %Canonical, i32* null diff --git a/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll b/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll index bd9d1ef..c8f97e3 100644 --- a/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll +++ b/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll @@ -1,7 +1,7 @@ ; The induction variable canonicalization pass shouldn't leave dead ; instructions laying around! ; -; RUN: llvm-as < %s | opt -indvars | llvm-dis | \ +; RUN: opt < %s -indvars -S | \ ; RUN: not grep {#uses=0} define i32 @mul(i32 %x, i32 %y) { diff --git a/test/Transforms/IndVarSimplify/2003-12-10-RemoveInstrCrash.ll b/test/Transforms/IndVarSimplify/2003-12-10-RemoveInstrCrash.ll index 11af997..70ea11e 100644 --- a/test/Transforms/IndVarSimplify/2003-12-10-RemoveInstrCrash.ll +++ b/test/Transforms/IndVarSimplify/2003-12-10-RemoveInstrCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output define void @test() { entry: diff --git a/test/Transforms/IndVarSimplify/2003-12-15-Crash.ll b/test/Transforms/IndVarSimplify/2003-12-15-Crash.ll index b964d78..5aa2d90 100644 --- a/test/Transforms/IndVarSimplify/2003-12-15-Crash.ll +++ b/test/Transforms/IndVarSimplify/2003-12-15-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output define void @_ZN17CoinFactorization7cleanupEv() { entry: br i1 false, label %loopexit.14, label %cond_continue.3 diff --git a/test/Transforms/IndVarSimplify/2003-12-21-IndVarSize.ll b/test/Transforms/IndVarSimplify/2003-12-21-IndVarSize.ll index cf8c8047..0fc9c85 100644 --- a/test/Transforms/IndVarSimplify/2003-12-21-IndVarSize.ll +++ b/test/Transforms/IndVarSimplify/2003-12-21-IndVarSize.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar | not grep i32 +; RUN: opt < %s -indvars -S | grep indvar | not grep i32 @G = global i64 0 ; <i64*> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2004-03-10-PHIInsertionBug.ll b/test/Transforms/IndVarSimplify/2004-03-10-PHIInsertionBug.ll index 248b29b..c49819e 100644 --- a/test/Transforms/IndVarSimplify/2004-03-10-PHIInsertionBug.ll +++ b/test/Transforms/IndVarSimplify/2004-03-10-PHIInsertionBug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output define void @test() { br label %endif.0.i diff --git a/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll b/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll index 54d8547..1ed4c44 100644 --- a/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll +++ b/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; ModuleID = '2004-04-05-InvokeCastCrash.ll' %struct.__false_type = type { i8 } %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>" = type { %"struct.__gnu_cxx::_Hashtable_node<const llvm::Constant*>"*, %"struct.llvm::Constant"* } diff --git a/test/Transforms/IndVarSimplify/2004-04-07-ScalarEvolutionCrash.ll b/test/Transforms/IndVarSimplify/2004-04-07-ScalarEvolutionCrash.ll index b4eb3db..ec1218b 100644 --- a/test/Transforms/IndVarSimplify/2004-04-07-ScalarEvolutionCrash.ll +++ b/test/Transforms/IndVarSimplify/2004-04-07-ScalarEvolutionCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output define void @.outPlank_21() { entry: diff --git a/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll b/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll index afee7e1..aee67cc 100644 --- a/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll +++ b/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output define void @_ZN5ArrayISt7complexIdEEC2ERK10dim_vector() { entry: diff --git a/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll b/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll index a1beec6..70a7a9d 100644 --- a/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll +++ b/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output declare void @q_atomic_increment() diff --git a/test/Transforms/IndVarSimplify/2005-02-26-ExitValueCompute.ll b/test/Transforms/IndVarSimplify/2005-02-26-ExitValueCompute.ll index 853d5ad..1ba6982 100644 --- a/test/Transforms/IndVarSimplify/2005-02-26-ExitValueCompute.ll +++ b/test/Transforms/IndVarSimplify/2005-02-26-ExitValueCompute.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | \ +; RUN: opt < %s -indvars -S | \ ; RUN: grep {ret i32 152} define i32 @main() { diff --git a/test/Transforms/IndVarSimplify/2005-06-15-InstMoveCrash.ll b/test/Transforms/IndVarSimplify/2005-06-15-InstMoveCrash.ll index ba4db9f..0862f11 100644 --- a/test/Transforms/IndVarSimplify/2005-06-15-InstMoveCrash.ll +++ b/test/Transforms/IndVarSimplify/2005-06-15-InstMoveCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output define void @main() { entry: diff --git a/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll b/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll index 5ee8cea..f9a3fe6 100644 --- a/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll +++ b/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output @fixtab = external global [29 x [29 x [2 x i32]]] ; <[29 x [29 x [2 x i32]]]*> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2006-03-31-NegativeStride.ll b/test/Transforms/IndVarSimplify/2006-03-31-NegativeStride.ll index 32abee9..1bbc631 100644 --- a/test/Transforms/IndVarSimplify/2006-03-31-NegativeStride.ll +++ b/test/Transforms/IndVarSimplify/2006-03-31-NegativeStride.ll @@ -1,5 +1,5 @@ ; PR726 -; RUN: llvm-as < %s | opt -indvars | llvm-dis | \ +; RUN: opt < %s -indvars -S | \ ; RUN: grep {ret i32 27} ; Make sure to compute the right exit value based on negative strides. diff --git a/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll b/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll index 986831b..36ec2b8 100644 --- a/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll +++ b/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output define void @get_block() { endif.0: diff --git a/test/Transforms/IndVarSimplify/2006-09-20-LFTR-Crash.ll b/test/Transforms/IndVarSimplify/2006-09-20-LFTR-Crash.ll index 6a478ab..787c9b0 100644 --- a/test/Transforms/IndVarSimplify/2006-09-20-LFTR-Crash.ll +++ b/test/Transforms/IndVarSimplify/2006-09-20-LFTR-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; ModuleID = '2006-09-20-LFTR-Crash.ll' %struct.p7prior_s = type { i32, i32, [200 x float], [200 x [7 x float]], i32, [200 x float], [200 x [20 x float]], i32, [200 x float], [200 x [20 x float]] } diff --git a/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll b/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll index b2f8258..79ac1f0 100644 --- a/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll +++ b/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output target datalayout = "e-p:32:32" target triple = "i686-apple-darwin8" %struct.vorbis_dsp_state = type { i32, %struct.vorbis_info*, float**, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* } diff --git a/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll b/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll index dd151e8..268b8d1 100644 --- a/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll +++ b/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll @@ -1,5 +1,5 @@ ; PR1015 -; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep {ret i32 0} +; RUN: opt < %s -indvars -S | not grep {ret i32 0} target datalayout = "e-p:32:32" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/IndVarSimplify/2007-01-08-X86-64-Pointer.ll b/test/Transforms/IndVarSimplify/2007-01-08-X86-64-Pointer.ll index 7078494..de226a1 100644 --- a/test/Transforms/IndVarSimplify/2007-01-08-X86-64-Pointer.ll +++ b/test/Transforms/IndVarSimplify/2007-01-08-X86-64-Pointer.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86-64 | grep {(%rdi,%rax,8)} -; RUN: llvm-as < %s | llc -march=x86-64 | not grep {addq.*8} +; RUN: llc %s -o - -march=x86-64 | grep {(%rdi,%rax,8)} +; RUN: llc %s -o - -march=x86-64 | not grep {addq.*8} define void @foo(double* %y) nounwind { entry: diff --git a/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll b/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll index 363c98c..fc7d633 100644 --- a/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll +++ b/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; PR1487 %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* } diff --git a/test/Transforms/IndVarSimplify/2007-11-23-BitcastCrash.ll b/test/Transforms/IndVarSimplify/2007-11-23-BitcastCrash.ll index 555cadd..cad4eb1 100644 --- a/test/Transforms/IndVarSimplify/2007-11-23-BitcastCrash.ll +++ b/test/Transforms/IndVarSimplify/2007-11-23-BitcastCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; PR1814 target datalayout = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32" diff --git a/test/Transforms/IndVarSimplify/2008-06-15-SCEVExpanderBug.ll b/test/Transforms/IndVarSimplify/2008-06-15-SCEVExpanderBug.ll index aac8d97..77235d2 100644 --- a/test/Transforms/IndVarSimplify/2008-06-15-SCEVExpanderBug.ll +++ b/test/Transforms/IndVarSimplify/2008-06-15-SCEVExpanderBug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; PR2434 define fastcc void @regcppop() nounwind { diff --git a/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll b/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll index 8111cbe..288431a 100644 --- a/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll +++ b/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep sext | count 1 +; RUN: opt < %s -indvars -S | grep sext | count 1 ; ModuleID = '<stdin>' %struct.App1Marker = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }> diff --git a/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll b/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll index c78188d..23e7884 100644 --- a/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll +++ b/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; PR2857 @foo = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2008-11-03-Floating.ll b/test/Transforms/IndVarSimplify/2008-11-03-Floating.ll index be8b36f..7b4032b 100644 --- a/test/Transforms/IndVarSimplify/2008-11-03-Floating.ll +++ b/test/Transforms/IndVarSimplify/2008-11-03-Floating.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep icmp | count 4 +; RUN: opt < %s -indvars -S | grep icmp | count 4 define void @bar() nounwind { entry: br label %bb diff --git a/test/Transforms/IndVarSimplify/2008-11-17-Floating.ll b/test/Transforms/IndVarSimplify/2008-11-17-Floating.ll index c947d3b..311d3da 100644 --- a/test/Transforms/IndVarSimplify/2008-11-17-Floating.ll +++ b/test/Transforms/IndVarSimplify/2008-11-17-Floating.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep icmp | count 2 -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep sitofp | count 1 -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep uitofp | count 1 +; RUN: opt < %s -indvars -S | grep icmp | count 2 +; RUN: opt < %s -indvars -S | grep sitofp | count 1 +; RUN: opt < %s -indvars -S | grep uitofp | count 1 define void @bar() nounwind { entry: diff --git a/test/Transforms/IndVarSimplify/2008-11-25-APFloatAssert.ll b/test/Transforms/IndVarSimplify/2008-11-25-APFloatAssert.ll index e611b1f..39b97af 100644 --- a/test/Transforms/IndVarSimplify/2008-11-25-APFloatAssert.ll +++ b/test/Transforms/IndVarSimplify/2008-11-25-APFloatAssert.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars define void @t() nounwind { entry: diff --git a/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll b/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll index 134c9c7..37ad63a 100644 --- a/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll +++ b/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep {sext} +; RUN: opt < %s -indvars -S | not grep {sext} ; ModuleID = '<stdin>' 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" target triple = "x86_64-apple-darwin9.6" diff --git a/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll b/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll index 4d26803..803b540 100644 --- a/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll +++ b/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -instcombine | llvm-dis | not grep {\[sz\]ext} +; RUN: opt < %s -indvars -instcombine -S | not grep {\[sz\]ext} ; ModuleID = '<stdin>' ;extern int *a, *b, *c, *d, *e, *f; /* 64 bit */ ;extern int K[256]; diff --git a/test/Transforms/IndVarSimplify/2009-04-22-IndvarCrash.ll b/test/Transforms/IndVarSimplify/2009-04-22-IndvarCrash.ll index f39458f..24074bf 100644 --- a/test/Transforms/IndVarSimplify/2009-04-22-IndvarCrash.ll +++ b/test/Transforms/IndVarSimplify/2009-04-22-IndvarCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; rdar://6817574 define i32 @t1() nounwind ssp { diff --git a/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll b/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll index e70d577..9fd2d2f 100644 --- a/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll +++ b/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep icmp | grep next +; RUN: opt < %s -indvars -S | grep icmp | grep next ; PR4086 declare void @foo() diff --git a/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll b/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll index ecbb231..9ad8691 100644 --- a/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll +++ b/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; PR4258 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" target triple = "i386-linux-gnu" diff --git a/test/Transforms/IndVarSimplify/ada-loops.ll b/test/Transforms/IndVarSimplify/ada-loops.ll index 56325b3..436840a 100644 --- a/test/Transforms/IndVarSimplify/ada-loops.ll +++ b/test/Transforms/IndVarSimplify/ada-loops.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: grep phi %t | count 4 ; RUN: grep {= phi i32} %t | count 4 ; RUN: not grep {sext i} %t diff --git a/test/Transforms/IndVarSimplify/addrec-gep.ll b/test/Transforms/IndVarSimplify/addrec-gep.ll index 132d4f8..9e42734 100644 --- a/test/Transforms/IndVarSimplify/addrec-gep.ll +++ b/test/Transforms/IndVarSimplify/addrec-gep.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: grep getelementptr %t | count 1 ; RUN: grep {mul .*, 37} %t | count 1 ; RUN: grep {add .*, 5203} %t | count 1 diff --git a/test/Transforms/IndVarSimplify/ashr-tripcount.ll b/test/Transforms/IndVarSimplify/ashr-tripcount.ll index 7b2cad2..baaefdc 100644 --- a/test/Transforms/IndVarSimplify/ashr-tripcount.ll +++ b/test/Transforms/IndVarSimplify/ashr-tripcount.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: grep sext %t | count 1 ; Indvars should be able to eliminate all of the sign extensions diff --git a/test/Transforms/IndVarSimplify/avoid-i0.ll b/test/Transforms/IndVarSimplify/avoid-i0.ll index 3456bd3..d110a8a 100644 --- a/test/Transforms/IndVarSimplify/avoid-i0.ll +++ b/test/Transforms/IndVarSimplify/avoid-i0.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; PR4052 ; PR4054 diff --git a/test/Transforms/IndVarSimplify/casted-argument.ll b/test/Transforms/IndVarSimplify/casted-argument.ll index 6d7aaa9..dfefe1d 100644 --- a/test/Transforms/IndVarSimplify/casted-argument.ll +++ b/test/Transforms/IndVarSimplify/casted-argument.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; PR4009 ; PR4038 diff --git a/test/Transforms/IndVarSimplify/complex-scev.ll b/test/Transforms/IndVarSimplify/complex-scev.ll index 4bfc4e9..434c4ec 100644 --- a/test/Transforms/IndVarSimplify/complex-scev.ll +++ b/test/Transforms/IndVarSimplify/complex-scev.ll @@ -1,7 +1,7 @@ ; The i induction variable looks like a wrap-around, but it really is just ; a simple affine IV. Make sure that indvars eliminates it. -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep phi | count 1 +; RUN: opt < %s -indvars -S | grep phi | count 1 define void @foo() { entry: diff --git a/test/Transforms/IndVarSimplify/divide-pointer.ll b/test/Transforms/IndVarSimplify/divide-pointer.ll index 747d47e..16608ee 100644 --- a/test/Transforms/IndVarSimplify/divide-pointer.ll +++ b/test/Transforms/IndVarSimplify/divide-pointer.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; PR4271 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" diff --git a/test/Transforms/IndVarSimplify/exit_value_tests.ll b/test/Transforms/IndVarSimplify/exit_value_tests.ll index b39f40f..737e733 100644 --- a/test/Transforms/IndVarSimplify/exit_value_tests.ll +++ b/test/Transforms/IndVarSimplify/exit_value_tests.ll @@ -2,7 +2,7 @@ ; these loops all have predictable exit values we can replace the use outside ; of the loop with a closed-form computation, making the loop dead. ; -; RUN: llvm-as < %s | opt -indvars -loop-deletion -simplifycfg | \ +; RUN: opt < %s -indvars -loop-deletion -simplifycfg | \ ; RUN: llvm-dis | not grep br define i32 @polynomial_constant() { diff --git a/test/Transforms/IndVarSimplify/gep-with-mul-base.ll b/test/Transforms/IndVarSimplify/gep-with-mul-base.ll index e63c88c..7809594 100644 --- a/test/Transforms/IndVarSimplify/gep-with-mul-base.ll +++ b/test/Transforms/IndVarSimplify/gep-with-mul-base.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: grep add %t | count 8 ; RUN: grep mul %t | count 7 diff --git a/test/Transforms/IndVarSimplify/interesting-invoke-use.ll b/test/Transforms/IndVarSimplify/interesting-invoke-use.ll index b90d1e0..8adc0e5 100644 --- a/test/Transforms/IndVarSimplify/interesting-invoke-use.ll +++ b/test/Transforms/IndVarSimplify/interesting-invoke-use.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; An invoke has a result value which is used in an "Interesting" ; expression inside the loop. IndVars should be able to rewrite diff --git a/test/Transforms/IndVarSimplify/iterationCount_zext_or_trunc.ll b/test/Transforms/IndVarSimplify/iterationCount_zext_or_trunc.ll index 747c781..02145d1 100644 --- a/test/Transforms/IndVarSimplify/iterationCount_zext_or_trunc.ll +++ b/test/Transforms/IndVarSimplify/iterationCount_zext_or_trunc.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; ModuleID = 'testcase.bc' 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" diff --git a/test/Transforms/IndVarSimplify/iv-sext.ll b/test/Transforms/IndVarSimplify/iv-sext.ll new file mode 100644 index 0000000..5516502 --- /dev/null +++ b/test/Transforms/IndVarSimplify/iv-sext.ll @@ -0,0 +1,143 @@ +; RUN: opt < %s -indvars -S > %t +; RUN: grep {= sext} %t | count 4 +; RUN: grep {phi i64} %t | count 2 + +; Indvars should be able to promote the hiPart induction variable in the +; inner loop to i64. +; TODO: it should promote hiPart to i64 in the outer loop too. + +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" + +define void @t(float* %pTmp1, float* %peakWeight, float* %nrgReducePeakrate, i32 %bandEdgeIndex, float %tmp1) nounwind { +entry: + %tmp = load float* %peakWeight, align 4 ; <float> [#uses=1] + %tmp2 = icmp sgt i32 %bandEdgeIndex, 0 ; <i1> [#uses=1] + br i1 %tmp2, label %bb.nph22, label %return + +bb.nph22: ; preds = %entry + %tmp3 = add i32 %bandEdgeIndex, -1 ; <i32> [#uses=2] + br label %bb + +bb: ; preds = %bb8, %bb.nph22 + %distERBhi.121 = phi float [ %distERBhi.2.lcssa, %bb8 ], [ 0.000000e+00, %bb.nph22 ] ; <float> [#uses=2] + %distERBlo.120 = phi float [ %distERBlo.0.lcssa, %bb8 ], [ 0.000000e+00, %bb.nph22 ] ; <float> [#uses=2] + %hiPart.119 = phi i32 [ %hiPart.0.lcssa, %bb8 ], [ 0, %bb.nph22 ] ; <i32> [#uses=3] + %loPart.118 = phi i32 [ %loPart.0.lcssa, %bb8 ], [ 0, %bb.nph22 ] ; <i32> [#uses=2] + %peakCount.117 = phi float [ %peakCount.2.lcssa, %bb8 ], [ %tmp, %bb.nph22 ] ; <float> [#uses=2] + %part.016 = phi i32 [ %tmp46, %bb8 ], [ 0, %bb.nph22 ] ; <i32> [#uses=5] + %tmp4 = icmp sgt i32 %part.016, 0 ; <i1> [#uses=1] + br i1 %tmp4, label %bb1, label %bb3.preheader + +bb1: ; preds = %bb + %tmp5 = add i32 %part.016, -1 ; <i32> [#uses=1] + %tmp6 = sext i32 %tmp5 to i64 ; <i64> [#uses=1] + %tmp7 = getelementptr float* %pTmp1, i64 %tmp6 ; <float*> [#uses=1] + %tmp8 = load float* %tmp7, align 4 ; <float> [#uses=1] + %tmp9 = fadd float %tmp8, %distERBlo.120 ; <float> [#uses=1] + %tmp10 = add i32 %part.016, -1 ; <i32> [#uses=1] + %tmp11 = sext i32 %tmp10 to i64 ; <i64> [#uses=1] + %tmp12 = getelementptr float* %pTmp1, i64 %tmp11 ; <float*> [#uses=1] + %tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1] + %tmp14 = fsub float %distERBhi.121, %tmp13 ; <float> [#uses=1] + br label %bb3.preheader + +bb3.preheader: ; preds = %bb1, %bb + %distERBlo.0.ph = phi float [ %distERBlo.120, %bb ], [ %tmp9, %bb1 ] ; <float> [#uses=3] + %distERBhi.0.ph = phi float [ %distERBhi.121, %bb ], [ %tmp14, %bb1 ] ; <float> [#uses=3] + %tmp15 = fcmp ogt float %distERBlo.0.ph, 2.500000e+00 ; <i1> [#uses=1] + br i1 %tmp15, label %bb.nph, label %bb5.preheader + +bb.nph: ; preds = %bb3.preheader + br label %bb2 + +bb2: ; preds = %bb3, %bb.nph + %distERBlo.03 = phi float [ %tmp19, %bb3 ], [ %distERBlo.0.ph, %bb.nph ] ; <float> [#uses=1] + %loPart.02 = phi i32 [ %tmp24, %bb3 ], [ %loPart.118, %bb.nph ] ; <i32> [#uses=3] + %peakCount.01 = phi float [ %tmp23, %bb3 ], [ %peakCount.117, %bb.nph ] ; <float> [#uses=1] + %tmp16 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1] + %tmp17 = getelementptr float* %pTmp1, i64 %tmp16 ; <float*> [#uses=1] + %tmp18 = load float* %tmp17, align 4 ; <float> [#uses=1] + %tmp19 = fsub float %distERBlo.03, %tmp18 ; <float> [#uses=3] + %tmp20 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1] + %tmp21 = getelementptr float* %peakWeight, i64 %tmp20 ; <float*> [#uses=1] + %tmp22 = load float* %tmp21, align 4 ; <float> [#uses=1] + %tmp23 = fsub float %peakCount.01, %tmp22 ; <float> [#uses=2] + %tmp24 = add i32 %loPart.02, 1 ; <i32> [#uses=2] + br label %bb3 + +bb3: ; preds = %bb2 + %tmp25 = fcmp ogt float %tmp19, 2.500000e+00 ; <i1> [#uses=1] + br i1 %tmp25, label %bb2, label %bb3.bb5.preheader_crit_edge + +bb3.bb5.preheader_crit_edge: ; preds = %bb3 + %tmp24.lcssa = phi i32 [ %tmp24, %bb3 ] ; <i32> [#uses=1] + %tmp23.lcssa = phi float [ %tmp23, %bb3 ] ; <float> [#uses=1] + %tmp19.lcssa = phi float [ %tmp19, %bb3 ] ; <float> [#uses=1] + br label %bb5.preheader + +bb5.preheader: ; preds = %bb3.bb5.preheader_crit_edge, %bb3.preheader + %distERBlo.0.lcssa = phi float [ %tmp19.lcssa, %bb3.bb5.preheader_crit_edge ], [ %distERBlo.0.ph, %bb3.preheader ] ; <float> [#uses=2] + %loPart.0.lcssa = phi i32 [ %tmp24.lcssa, %bb3.bb5.preheader_crit_edge ], [ %loPart.118, %bb3.preheader ] ; <i32> [#uses=1] + %peakCount.0.lcssa = phi float [ %tmp23.lcssa, %bb3.bb5.preheader_crit_edge ], [ %peakCount.117, %bb3.preheader ] ; <float> [#uses=2] + %.not10 = fcmp olt float %distERBhi.0.ph, 2.500000e+00 ; <i1> [#uses=1] + %tmp26 = icmp sgt i32 %tmp3, %hiPart.119 ; <i1> [#uses=1] + %or.cond11 = and i1 %tmp26, %.not10 ; <i1> [#uses=1] + br i1 %or.cond11, label %bb.nph12, label %bb7 + +bb.nph12: ; preds = %bb5.preheader + br label %bb4 + +bb4: ; preds = %bb5, %bb.nph12 + %distERBhi.29 = phi float [ %tmp30, %bb5 ], [ %distERBhi.0.ph, %bb.nph12 ] ; <float> [#uses=1] + %hiPart.08 = phi i32 [ %tmp31, %bb5 ], [ %hiPart.119, %bb.nph12 ] ; <i32> [#uses=2] + %peakCount.27 = phi float [ %tmp35, %bb5 ], [ %peakCount.0.lcssa, %bb.nph12 ] ; <float> [#uses=1] + %tmp27 = sext i32 %hiPart.08 to i64 ; <i64> [#uses=1] + %tmp28 = getelementptr float* %pTmp1, i64 %tmp27 ; <float*> [#uses=1] + %tmp29 = load float* %tmp28, align 4 ; <float> [#uses=1] + %tmp30 = fadd float %tmp29, %distERBhi.29 ; <float> [#uses=3] + %tmp31 = add i32 %hiPart.08, 1 ; <i32> [#uses=4] + %tmp32 = sext i32 %tmp31 to i64 ; <i64> [#uses=1] + %tmp33 = getelementptr float* %peakWeight, i64 %tmp32 ; <float*> [#uses=1] + %tmp34 = load float* %tmp33, align 4 ; <float> [#uses=1] + %tmp35 = fadd float %tmp34, %peakCount.27 ; <float> [#uses=2] + br label %bb5 + +bb5: ; preds = %bb4 + %.not = fcmp olt float %tmp30, 2.500000e+00 ; <i1> [#uses=1] + %tmp36 = icmp sgt i32 %tmp3, %tmp31 ; <i1> [#uses=1] + %or.cond = and i1 %tmp36, %.not ; <i1> [#uses=1] + br i1 %or.cond, label %bb4, label %bb5.bb7_crit_edge + +bb5.bb7_crit_edge: ; preds = %bb5 + %tmp35.lcssa = phi float [ %tmp35, %bb5 ] ; <float> [#uses=1] + %tmp31.lcssa = phi i32 [ %tmp31, %bb5 ] ; <i32> [#uses=1] + %tmp30.lcssa = phi float [ %tmp30, %bb5 ] ; <float> [#uses=1] + br label %bb7 + +bb7: ; preds = %bb5.bb7_crit_edge, %bb5.preheader + %distERBhi.2.lcssa = phi float [ %tmp30.lcssa, %bb5.bb7_crit_edge ], [ %distERBhi.0.ph, %bb5.preheader ] ; <float> [#uses=2] + %hiPart.0.lcssa = phi i32 [ %tmp31.lcssa, %bb5.bb7_crit_edge ], [ %hiPart.119, %bb5.preheader ] ; <i32> [#uses=1] + %peakCount.2.lcssa = phi float [ %tmp35.lcssa, %bb5.bb7_crit_edge ], [ %peakCount.0.lcssa, %bb5.preheader ] ; <float> [#uses=2] + %tmp37 = fadd float %distERBlo.0.lcssa, %distERBhi.2.lcssa ; <float> [#uses=1] + %tmp38 = fdiv float %peakCount.2.lcssa, %tmp37 ; <float> [#uses=1] + %tmp39 = fmul float %tmp38, %tmp1 ; <float> [#uses=2] + %tmp40 = fmul float %tmp39, %tmp39 ; <float> [#uses=2] + %tmp41 = fmul float %tmp40, %tmp40 ; <float> [#uses=1] + %tmp42 = fadd float %tmp41, 1.000000e+00 ; <float> [#uses=1] + %tmp43 = fdiv float 1.000000e+00, %tmp42 ; <float> [#uses=1] + %tmp44 = sext i32 %part.016 to i64 ; <i64> [#uses=1] + %tmp45 = getelementptr float* %nrgReducePeakrate, i64 %tmp44 ; <float*> [#uses=1] + store float %tmp43, float* %tmp45, align 4 + %tmp46 = add i32 %part.016, 1 ; <i32> [#uses=2] + br label %bb8 + +bb8: ; preds = %bb7 + %tmp47 = icmp slt i32 %tmp46, %bandEdgeIndex ; <i1> [#uses=1] + br i1 %tmp47, label %bb, label %bb8.return_crit_edge + +bb8.return_crit_edge: ; preds = %bb8 + br label %return + +return: ; preds = %bb8.return_crit_edge, %entry + ret void +} diff --git a/test/Transforms/IndVarSimplify/iv-zext.ll b/test/Transforms/IndVarSimplify/iv-zext.ll index d7eb7bd..1cc559f 100644 --- a/test/Transforms/IndVarSimplify/iv-zext.ll +++ b/test/Transforms/IndVarSimplify/iv-zext.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: not grep and %t ; RUN: not grep zext %t diff --git a/test/Transforms/IndVarSimplify/lftr-other-uses.ll b/test/Transforms/IndVarSimplify/lftr-other-uses.ll index c8f1e95..09ec237 100644 --- a/test/Transforms/IndVarSimplify/lftr-other-uses.ll +++ b/test/Transforms/IndVarSimplify/lftr-other-uses.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt < %s -indvars -disable-output ; Don't RAUW the loop's original comparison instruction if it has ; other uses which aren't dominated by the new comparison instruction. diff --git a/test/Transforms/IndVarSimplify/lftr-promote.ll b/test/Transforms/IndVarSimplify/lftr-promote.ll new file mode 100644 index 0000000..c4ecc84 --- /dev/null +++ b/test/Transforms/IndVarSimplify/lftr-promote.ll @@ -0,0 +1,38 @@ +; RUN: opt < %s -indvars -S | grep add | count 1 + +; Indvars should be able to compute the exit value of this loop +; without any additional arithmetic. The only add needed should +; be the canonical IV increment. + +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" + +define void @foo(double* %p, i32 %n) nounwind { +entry: + %0 = icmp sgt i32 %n, 0 ; <i1> [#uses=1] + br i1 %0, label %bb.nph, label %return + +bb.nph: ; preds = %entry + br label %bb2 + +bb2: ; preds = %bb3, %bb.nph + %i.01 = phi i32 [ %7, %bb3 ], [ 0, %bb.nph ] ; <i32> [#uses=3] + %1 = sext i32 %i.01 to i64 ; <i64> [#uses=1] + %2 = getelementptr double* %p, i64 %1 ; <double*> [#uses=1] + %3 = load double* %2, align 8 ; <double> [#uses=1] + %4 = fmul double %3, 1.100000e+00 ; <double> [#uses=1] + %5 = sext i32 %i.01 to i64 ; <i64> [#uses=1] + %6 = getelementptr double* %p, i64 %5 ; <double*> [#uses=1] + store double %4, double* %6, align 8 + %7 = add i32 %i.01, 1 ; <i32> [#uses=2] + br label %bb3 + +bb3: ; preds = %bb2 + %8 = icmp slt i32 %7, %n ; <i1> [#uses=1] + br i1 %8, label %bb2, label %bb3.return_crit_edge + +bb3.return_crit_edge: ; preds = %bb3 + br label %return + +return: ; preds = %bb3.return_crit_edge, %entry + ret void +} diff --git a/test/Transforms/IndVarSimplify/lftr_simple.ll b/test/Transforms/IndVarSimplify/lftr_simple.ll index 3f7c289..e373013 100644 --- a/test/Transforms/IndVarSimplify/lftr_simple.ll +++ b/test/Transforms/IndVarSimplify/lftr_simple.ll @@ -1,6 +1,6 @@ ; LFTR should eliminate the need for the computation of i*i completely. It ; is only used to compute the exit value. -; RUN: llvm-as < %s | opt -indvars -dce | llvm-dis | not grep mul +; RUN: opt < %s -indvars -dce -S | not grep mul @A = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/loop-invariant-step.ll b/test/Transforms/IndVarSimplify/loop-invariant-step.ll index 40156ea..2d2d1fe 100644 --- a/test/Transforms/IndVarSimplify/loop-invariant-step.ll +++ b/test/Transforms/IndVarSimplify/loop-invariant-step.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -instcombine -indvars -disable-output +; RUN: opt < %s -loop-index-split -instcombine -indvars -disable-output ; PR4455 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" diff --git a/test/Transforms/IndVarSimplify/loop_evaluate10.ll b/test/Transforms/IndVarSimplify/loop_evaluate10.ll new file mode 100644 index 0000000..4ec4aca --- /dev/null +++ b/test/Transforms/IndVarSimplify/loop_evaluate10.ll @@ -0,0 +1,47 @@ +; RUN: opt < %s -indvars -S \ +; RUN: | grep {%b.1 = phi i32 \\\[ 2, %bb \\\], \\\[ 1, %bb2 \\\]} + +; This loop has multiple exits, and the value of %b1 depends on which +; exit is taken. Indvars should correctly compute the exit values. + +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" +target triple = "x86_64-linux-gnu" + %struct..0anon = type <{ i8, [3 x i8] }> + +define i32 @main() nounwind { +entry: + br label %bb2 + +bb2: ; preds = %bb, %entry + %sdata.0 = phi i32 [ 1, %entry ], [ %ins10, %bb ] ; <i32> [#uses=2] + %b.0 = phi i32 [ 0, %entry ], [ %t0, %bb ] ; <i32> [#uses=2] + %tmp6 = trunc i32 %sdata.0 to i8 ; <i8> [#uses=2] + %t2 = and i8 %tmp6, 1 ; <i8> [#uses=1] + %t3 = icmp eq i8 %t2, 0 ; <i1> [#uses=1] + %t4 = xor i8 %tmp6, 1 ; <i8> [#uses=1] + %tmp8 = zext i8 %t4 to i32 ; <i32> [#uses=1] + %mask9 = and i32 %sdata.0, -256 ; <i32> [#uses=1] + %ins10 = or i32 %tmp8, %mask9 ; <i32> [#uses=1] + br i1 %t3, label %bb3, label %bb + +bb: ; preds = %bb2 + %t0 = add i32 %b.0, 1 ; <i32> [#uses=3] + %t1 = icmp sgt i32 %t0, 100 ; <i1> [#uses=1] + br i1 %t1, label %bb3, label %bb2 + +bb3: ; preds = %bb, %bb2 + %b.1 = phi i32 [ %t0, %bb ], [ %b.0, %bb2 ] ; <i32> [#uses=1] + %t5 = icmp eq i32 %b.1, 1 ; <i1> [#uses=1] + br i1 %t5, label %bb5, label %bb4 + +bb4: ; preds = %bb3 + tail call void @abort() noreturn nounwind + unreachable + +bb5: ; preds = %bb3 + ret i32 0 +} + +declare void @llvm.memset.i64(i8* nocapture, i8, i64, i32) nounwind + +declare void @abort() noreturn nounwind diff --git a/test/Transforms/IndVarSimplify/loop_evaluate11.ll b/test/Transforms/IndVarSimplify/loop_evaluate11.ll new file mode 100644 index 0000000..40b785e --- /dev/null +++ b/test/Transforms/IndVarSimplify/loop_evaluate11.ll @@ -0,0 +1,36 @@ +; RUN: opt < %s -domfrontier -indvars -loop-deletion + +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" + +define void @slap_sl_mem_create() nounwind { +entry: + br label %bb15 + +bb15: ; preds = %bb15, %entry + %order_end.0 = phi i32 [ 0, %entry ], [ %tmp, %bb15 ] ; <i32> [#uses=1] + %tmp = add i32 %order_end.0, 1 ; <i32> [#uses=2] + br i1 undef, label %bb17, label %bb15 + +bb17: ; preds = %bb17, %bb15 + %order_start.0 = phi i32 [ %tmp1, %bb17 ], [ 0, %bb15 ] ; <i32> [#uses=2] + %tmp1 = add i32 %order_start.0, 1 ; <i32> [#uses=2] + %tmp2 = icmp eq i32 undef, 0 ; <i1> [#uses=1] + br i1 %tmp2, label %bb18, label %bb17 + +bb18: ; preds = %bb17 + %tmp3 = sub i32 %tmp, %tmp1 ; <i32> [#uses=0] + br label %bb59 + +bb51: ; preds = %bb59 + %tmp4 = add i32 %order_start.0, 2 ; <i32> [#uses=1] + %tmp5 = add i32 %tmp4, undef ; <i32> [#uses=1] + %tmp6 = lshr i32 undef, %tmp5 ; <i32> [#uses=1] + %tmp7 = icmp eq i32 %tmp6, 0 ; <i1> [#uses=1] + br i1 %tmp7, label %bb52, label %bb59 + +bb59: ; preds = %bb51, %bb18 + br label %bb51 + +bb52: ; preds = %bb51 + unreachable +} diff --git a/test/Transforms/IndVarSimplify/loop_evaluate7.ll b/test/Transforms/IndVarSimplify/loop_evaluate7.ll index 6e31c55..b9c0b12 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate7.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate7.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; PR4436 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" diff --git a/test/Transforms/IndVarSimplify/loop_evaluate8.ll b/test/Transforms/IndVarSimplify/loop_evaluate8.ll index fa2f9e5..2a9d205 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate8.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate8.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep select +; RUN: opt < %s -indvars -S | not grep select ; This loop has backedge-taken-count zero. Indvars shouldn't expand any ; instructions to compute a trip count. diff --git a/test/Transforms/IndVarSimplify/loop_evaluate9.ll b/test/Transforms/IndVarSimplify/loop_evaluate9.ll index 5a7a859..8184a73 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate9.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate9.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t -; RUN: grep {\[%\]tmp5.lcssa = phi i8 \\\[ 63, \[%\]cc70a02__complex_integers__Oadd.153.exit.i \\\]} %t -; RUN: grep {\[%\]tmp4.lcssa = phi i8 \\\[ -28, \[%\]cc70a02__complex_integers__Oadd.153.exit.i \\\]} %t +; RUN: opt < %s -indvars -S > %t +; RUN: grep {\[%\]tmp7 = icmp eq i8 -28, -28} %t +; RUN: grep {\[%\]tmp8 = icmp eq i8 63, 63} %t ; PR4477 ; Indvars should compute the exit values in loop. diff --git a/test/Transforms/IndVarSimplify/loop_evaluate_1.ll b/test/Transforms/IndVarSimplify/loop_evaluate_1.ll index dfb42e4..abf1bc3 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate_1.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate_1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -loop-deletion -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | not grep br ; ; Testcase distilled from 256.bzip2 diff --git a/test/Transforms/IndVarSimplify/loop_evaluate_2.ll b/test/Transforms/IndVarSimplify/loop_evaluate_2.ll index efcf20a..c0099a8 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate_2.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate_2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -loop-deletion -simplifycfg | opt \ +; RUN: opt < %s -indvars -loop-deletion -simplifycfg | opt \ ; RUN: -analyze -loops | not grep "^Loop Containing" ; PR1179 diff --git a/test/Transforms/IndVarSimplify/loop_evaluate_3.ll b/test/Transforms/IndVarSimplify/loop_evaluate_3.ll index 2a2f69d..65c66f7 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate_3.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate_3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep {ret i32 600000} +; RUN: opt < %s -indvars -S | grep {ret i32 600000} ; PR1179 define i32 @foo() { diff --git a/test/Transforms/IndVarSimplify/loop_evaluate_4.ll b/test/Transforms/IndVarSimplify/loop_evaluate_4.ll index 6c6a362..e4b642c 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate_4.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate_4.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep {ret i32 9900} +; RUN: opt < %s -indvars -S | grep {ret i32 9900} ; PR1179 define i32 @test4() { diff --git a/test/Transforms/IndVarSimplify/loop_evaluate_5.ll b/test/Transforms/IndVarSimplify/loop_evaluate_5.ll index c6ce4a2..80b961a 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate_5.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate_5.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep {120, %bb2.bb3_crit_edge} +; RUN: opt < %s -indvars -S | grep {120, %bb2.bb3_crit_edge} 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/IndVarSimplify/loop_evaluate_6.ll b/test/Transforms/IndVarSimplify/loop_evaluate_6.ll index 0d17a80..da38de5 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate_6.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate_6.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -loop-deletion | llvm-dis | grep phi | count 1 +; RUN: opt < %s -indvars -loop-deletion -S | grep phi | count 1 ; XFAIL: * ; Indvars can't evaluate this loop, because ScalarEvolution can't compute diff --git a/test/Transforms/IndVarSimplify/masked-iv.ll b/test/Transforms/IndVarSimplify/masked-iv.ll index f77b935..f1f5af9 100644 --- a/test/Transforms/IndVarSimplify/masked-iv.ll +++ b/test/Transforms/IndVarSimplify/masked-iv.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: not grep trunc %t ; RUN: grep and %t | count 1 diff --git a/test/Transforms/IndVarSimplify/max-pointer.ll b/test/Transforms/IndVarSimplify/max-pointer.ll new file mode 100644 index 0000000..71bc720 --- /dev/null +++ b/test/Transforms/IndVarSimplify/max-pointer.ll @@ -0,0 +1,39 @@ +; RUN: opt < %s -indvars -S > %t +; RUN: grep {icmp ugt i8\\\*} %t | count 1 +; RUN: grep {icmp sgt i8\\\*} %t | count 1 + +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" + + %struct.CKenCodeCodec = type <{ i8 }> + +define void @foo(i8* %str1Ptr, i8* %str2Ptr, i8* %inLastBytePtr) nounwind { +entry: + %0 = icmp ult i8* %str2Ptr, %str1Ptr ; <i1> [#uses=1] + %str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr ; <i8*> [#uses=1] + br label %bb2 + +bb2: ; preds = %bb2, %entry + %str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ] ; <i8*> [#uses=1] + %1 = getelementptr i8* %str2Ptr_addr.1, i64 1 ; <i8*> [#uses=2] + %2 = icmp ult i8* %1, %inLastBytePtr ; <i1> [#uses=0] + br i1 false, label %bb2, label %return + +return: ; preds = %bb2 + ret void +} + +define void @sfoo(i8* %str1Ptr, i8* %str2Ptr, i8* %inLastBytePtr) nounwind { +entry: + %0 = icmp slt i8* %str2Ptr, %str1Ptr ; <i1> [#uses=1] + %str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr ; <i8*> [#uses=1] + br label %bb2 + +bb2: ; preds = %bb2, %entry + %str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ] ; <i8*> [#uses=1] + %1 = getelementptr i8* %str2Ptr_addr.1, i64 1 ; <i8*> [#uses=2] + %2 = icmp slt i8* %1, %inLastBytePtr ; <i1> [#uses=0] + br i1 false, label %bb2, label %return + +return: ; preds = %bb2 + ret void +} diff --git a/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll b/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll index 7119cbb..34d432b 100644 --- a/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll +++ b/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars 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" @ue = external global i64 diff --git a/test/Transforms/IndVarSimplify/pointer-indvars.ll b/test/Transforms/IndVarSimplify/pointer-indvars.ll index c9da1579..6d25f90 100644 --- a/test/Transforms/IndVarSimplify/pointer-indvars.ll +++ b/test/Transforms/IndVarSimplify/pointer-indvars.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar +; RUN: opt < %s -indvars -S | grep indvar @G = global i32* null ; <i32**> [#uses=1] @Array = external global [40 x i32] ; <[40 x i32]*> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/pointer.ll b/test/Transforms/IndVarSimplify/pointer.ll index 7ad1161..5eee655 100644 --- a/test/Transforms/IndVarSimplify/pointer.ll +++ b/test/Transforms/IndVarSimplify/pointer.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: grep {%exitcond = icmp eq i64 %indvar.next, %n} %t ; RUN: grep {getelementptr i8\\* %A, i64 %indvar} %t ; RUN: grep getelementptr %t | count 1 diff --git a/test/Transforms/IndVarSimplify/polynomial-expand.ll b/test/Transforms/IndVarSimplify/polynomial-expand.ll new file mode 100644 index 0000000..2087f6a --- /dev/null +++ b/test/Transforms/IndVarSimplify/polynomial-expand.ll @@ -0,0 +1,38 @@ +; RUN: opt < %s -indvars -disable-output +; PR5073 + +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" +target triple = "x86_64-unknown-linux-gnu" + +define void @ctpmv_(float* noalias nocapture %tmp4, i32 %tmp21) nounwind { +bb20: ; preds = %bb19 + br label %bb24 + +bb24: ; preds = %bb40, %bb23 + %tmp25 = phi i32 [ %tmp43, %bb40 ], [ %tmp21, %bb20 ] ; <i32> [#uses=4] + %tmp26 = phi i32 [ %tmp41, %bb40 ], [ undef, %bb20 ] ; <i32> [#uses=2] + %tmp27 = add nsw i32 %tmp26, -1 ; <i32> [#uses=1] + %tmp28 = add nsw i32 %tmp25, -1 ; <i32> [#uses=2] + %tmp29 = icmp sgt i32 %tmp28, 0 ; <i1> [#uses=1] + br i1 %tmp29, label %bb30, label %bb40 + +bb30: ; preds = %bb30, %bb24 + %tmp31 = phi i32 [ %tmp39, %bb30 ], [ %tmp28, %bb24 ] ; <i32> [#uses=2] + %tmp32 = phi i32 [ %tmp37, %bb30 ], [ %tmp27, %bb24 ] ; <i32> [#uses=2] + %tmp33 = sext i32 %tmp32 to i64 ; <i64> [#uses=1] + %tmp35 = getelementptr float* %tmp4, i64 %tmp33 ; <%0*> [#uses=1] + %tmp36 = load float* %tmp35, align 4 ; <%0> [#uses=0] + %tmp37 = add nsw i32 %tmp32, -1 ; <i32> [#uses=1] + %tmp39 = add nsw i32 %tmp31, -1 ; <i32> [#uses=1] + %tmp38 = icmp eq i32 %tmp31, 1 ; <i1> [#uses=1] + br i1 %tmp38, label %bb40, label %bb30 + +bb40: ; preds = %bb30, %bb24 + %tmp41 = sub i32 %tmp26, %tmp25 ; <i32> [#uses=1] + %tmp43 = add nsw i32 %tmp25, -1 ; <i32> [#uses=1] + %tmp42 = icmp eq i32 %tmp25, 1 ; <i1> [#uses=1] + br i1 %tmp42, label %bb46, label %bb24 + +bb46: ; preds = %bb40, %bb23, %bb19 + ret void +} diff --git a/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll b/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll new file mode 100644 index 0000000..86e90c7 --- /dev/null +++ b/test/Transforms/IndVarSimplify/preserve-gep-loop-variant.ll @@ -0,0 +1,41 @@ +; RUN: opt < %s -indvars -S > %t +; RUN: not grep inttoptr %t +; RUN: not grep ptrtoint %t +; RUN: grep scevgep %t + +; Indvars shouldn't need inttoptr/ptrtoint to expand an address here. + +define void @foo(i8* %p) nounwind { +entry: + br i1 true, label %bb.nph, label %for.end + +for.cond: + %phitmp = icmp slt i64 %inc, 20 + br i1 %phitmp, label %for.body, label %for.cond.for.end_crit_edge + +for.cond.for.end_crit_edge: + br label %for.end + +bb.nph: + br label %for.body + +for.body: + %storemerge1 = phi i64 [ %inc, %for.cond ], [ 0, %bb.nph ] + %call = tail call i64 @bar() nounwind + %call2 = tail call i64 @car() nounwind + %conv = trunc i64 %call2 to i8 + %conv3 = sext i8 %conv to i64 + %add = add nsw i64 %call, %storemerge1 + %add4 = add nsw i64 %add, %conv3 + %arrayidx = getelementptr inbounds i8* %p, i64 %add4 + store i8 0, i8* %arrayidx + %inc = add nsw i64 %storemerge1, 1 + br label %for.cond + +for.end: + ret void +} + +declare i64 @bar() + +declare i64 @car() diff --git a/test/Transforms/IndVarSimplify/preserve-gep-nested.ll b/test/Transforms/IndVarSimplify/preserve-gep-nested.ll new file mode 100644 index 0000000..bb0993c --- /dev/null +++ b/test/Transforms/IndVarSimplify/preserve-gep-nested.ll @@ -0,0 +1,75 @@ +; RUN: opt < %s -indvars -S > %t +; Exactly one getelementptr for each load+store. +; RUN: grep getelementptr %t | count 6 +; Each getelementptr using %struct.Q* %s as a base and not i8*. +; RUN: grep {getelementptr \[%\]struct\\.Q\\* \[%\]s,} %t | count 6 +; No explicit integer multiplications! +; RUN: not grep {= mul} %t +; No i8* arithmetic or pointer casting anywhere! +; RUN: not grep {i8\\*} %t +; RUN: not grep bitcast %t +; RUN: not grep inttoptr %t +; RUN: not grep ptrtoint %t + +; FIXME: This test should pass with or without TargetData. Until opt +; supports running tests without targetdata, just hardware this in. +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" + +%struct.Q = type { [10 x %struct.N] } +%struct.N = type { %struct.S } +%struct.S = type { [100 x double], [100 x double] } + +define void @foo(%struct.Q* %s, i64 %n) nounwind { +entry: + br label %bb1 + +bb1: + %i = phi i64 [ 2, %entry ], [ %i.next, %bb ] + %j = phi i64 [ 0, %entry ], [ %j.next, %bb ] + %t5 = icmp slt i64 %i, %n + br i1 %t5, label %bb, label %return + +bb: + %t0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %i + %t1 = load double* %t0, align 8 + %t2 = fmul double %t1, 3.200000e+00 + %t3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %i + store double %t2, double* %t3, align 8 + + %s0 = getelementptr inbounds %struct.Q* %s, i64 13, i32 0, i64 7, i32 0, i32 1, i64 %i + %s1 = load double* %s0, align 8 + %s2 = fmul double %s1, 3.200000e+00 + %s3 = getelementptr inbounds %struct.Q* %s, i64 13, i32 0, i64 7, i32 0, i32 1, i64 %i + store double %s2, double* %s3, align 8 + + %u0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 7, i32 0, i32 1, i64 %j + %u1 = load double* %u0, align 8 + %u2 = fmul double %u1, 3.200000e+00 + %u3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 7, i32 0, i32 1, i64 %j + store double %u2, double* %u3, align 8 + + %v0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 1, i64 %i + %v1 = load double* %v0, align 8 + %v2 = fmul double %v1, 3.200000e+00 + %v3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 1, i64 %i + store double %v2, double* %v3, align 8 + + %w0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %j + %w1 = load double* %w0, align 8 + %w2 = fmul double %w1, 3.200000e+00 + %w3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 0, i32 0, i32 0, i64 %j + store double %w2, double* %w3, align 8 + + %x0 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 3, i32 0, i32 0, i64 %i + %x1 = load double* %x0, align 8 + %x2 = fmul double %x1, 3.200000e+00 + %x3 = getelementptr inbounds %struct.Q* %s, i64 0, i32 0, i64 3, i32 0, i32 0, i64 %i + store double %x2, double* %x3, align 8 + + %i.next = add i64 %i, 1 + %j.next = add i64 %j, 1 + br label %bb1 + +return: + ret void +} diff --git a/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll b/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll index 95726ea..d249432 100644 --- a/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll +++ b/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis \ +; RUN: opt < %s -indvars -S \ ; RUN: | grep {\[%\]p.2.ip.1 = getelementptr \\\[3 x \\\[3 x double\\\]\\\]\\* \[%\]p, i64 2, i64 \[%\]tmp, i64 1} ; Indvars shouldn't expand this to diff --git a/test/Transforms/IndVarSimplify/preserve-gep.ll b/test/Transforms/IndVarSimplify/preserve-gep.ll index 2c8c224..a27d20d 100644 --- a/test/Transforms/IndVarSimplify/preserve-gep.ll +++ b/test/Transforms/IndVarSimplify/preserve-gep.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: not grep ptrtoint %t ; RUN: not grep inttoptr %t ; RUN: grep getelementptr %t | count 1 diff --git a/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll b/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll index 0a91ec8..9e46a78 100644 --- a/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll +++ b/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: grep sext %t | count 1 ; RUN: grep phi %t | count 1 ; RUN: grep {phi i64} %t diff --git a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll index 48c060c..a007ca6 100644 --- a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll +++ b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: not grep sext %t define i64 @test(i64* nocapture %first, i32 %count) nounwind readonly { diff --git a/test/Transforms/IndVarSimplify/shrunk-constant.ll b/test/Transforms/IndVarSimplify/shrunk-constant.ll index 0b2ecaf..623c528 100644 --- a/test/Transforms/IndVarSimplify/shrunk-constant.ll +++ b/test/Transforms/IndVarSimplify/shrunk-constant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output \ +; RUN: opt < %s -scalar-evolution -analyze -disable-output \ ; RUN: | grep {\\--> (zext i4 {-7,+,-8}<loop> to i32)} define fastcc void @foo() nounwind { diff --git a/test/Transforms/IndVarSimplify/signed-trip-count.ll b/test/Transforms/IndVarSimplify/signed-trip-count.ll index cd61d11..1a5e64d 100644 --- a/test/Transforms/IndVarSimplify/signed-trip-count.ll +++ b/test/Transforms/IndVarSimplify/signed-trip-count.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt < %s -indvars -S > %t ; RUN: not grep sext %t ; RUN: grep phi %t | count 1 diff --git a/test/Transforms/IndVarSimplify/single-element-range.ll b/test/Transforms/IndVarSimplify/single-element-range.ll new file mode 100644 index 0000000..60a9eef --- /dev/null +++ b/test/Transforms/IndVarSimplify/single-element-range.ll @@ -0,0 +1,27 @@ +; RUN: opt < %s -indvars + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "armv6-apple-darwin10" + +define arm_apcscc void @sqlite3_free_table(i8** %azResult) nounwind { +entry: + br i1 undef, label %return, label %bb + +bb: ; preds = %entry + %0 = load i8** undef, align 4 ; <i8*> [#uses=2] + %1 = ptrtoint i8* %0 to i32 ; <i32> [#uses=1] + %2 = icmp sgt i8* %0, inttoptr (i32 1 to i8*) ; <i1> [#uses=1] + br i1 %2, label %bb1, label %bb5 + +bb1: ; preds = %bb1, %bb + %i.01 = phi i32 [ %3, %bb1 ], [ 1, %bb ] ; <i32> [#uses=1] + %3 = add i32 %i.01, 1 ; <i32> [#uses=2] + %4 = icmp slt i32 %3, %1 ; <i1> [#uses=1] + br i1 %4, label %bb1, label %bb5 + +bb5: ; preds = %bb1, %bb + ret void + +return: ; preds = %entry + ret void +} diff --git a/test/Transforms/IndVarSimplify/sink-alloca.ll b/test/Transforms/IndVarSimplify/sink-alloca.ll new file mode 100644 index 0000000..3a6c683 --- /dev/null +++ b/test/Transforms/IndVarSimplify/sink-alloca.ll @@ -0,0 +1,31 @@ +; RUN: opt < %s -indvars -S | FileCheck %s +; PR4775 + +; Indvars shouldn't sink the alloca out of the entry block, even though +; it's not used until after the loop. + +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" +target triple = "i386-apple-darwin10.0" + +@llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @main to i8*)], +section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] + +define i32 @main() nounwind { +; CHECK: entry: +; CHECK-NEXT: %result.i = alloca i32, align 4 +entry: + %result.i = alloca i32, align 4 ; <i32*> [#uses=2] + br label %while.cond + +while.cond: ; preds = %while.cond, %entry + %call = call i32 @bar() nounwind ; <i32> [#uses=1] + %tobool = icmp eq i32 %call, 0 ; <i1> [#uses=1] + br i1 %tobool, label %while.end, label %while.cond + +while.end: ; preds = %while.cond + volatile store i32 0, i32* %result.i + %tmp.i = volatile load i32* %result.i ; <i32> [#uses=0] + ret i32 0 +} + +declare i32 @bar() diff --git a/test/Transforms/IndVarSimplify/sink-trapping.ll b/test/Transforms/IndVarSimplify/sink-trapping.ll new file mode 100644 index 0000000..a18000c --- /dev/null +++ b/test/Transforms/IndVarSimplify/sink-trapping.ll @@ -0,0 +1,19 @@ +; RUN: opt < %s -indvars -S | FileCheck %s --check-prefix=CHECK + +declare i1 @b() + +define i32 @a(i32 %x) nounwind { +for.body.preheader: + %y = sdiv i32 10, %x + br label %for.body + +for.body: + %cmp = call i1 @b() + br i1 %cmp, label %for.body, label %for.end.loopexit + +for.end.loopexit: + ret i32 %y +} +; CHECK: for.end.loopexit: +; CHECK: sdiv +; CHECK: ret diff --git a/test/Transforms/IndVarSimplify/subtract.ll b/test/Transforms/IndVarSimplify/subtract.ll index 51065cc..f45bdab 100644 --- a/test/Transforms/IndVarSimplify/subtract.ll +++ b/test/Transforms/IndVarSimplify/subtract.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar +; RUN: opt < %s -indvars -S | grep indvar @G = global i64 0 ; <i64*> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/tripcount_compute.ll b/test/Transforms/IndVarSimplify/tripcount_compute.ll index 9ffce81..6eaa4c5 100644 --- a/test/Transforms/IndVarSimplify/tripcount_compute.ll +++ b/test/Transforms/IndVarSimplify/tripcount_compute.ll @@ -3,7 +3,7 @@ ; the exit value of the loop will be for some value, allowing us to substitute ; it directly into users outside of the loop, making the loop dead. ; -; RUN: llvm-as < %s | opt -indvars -loop-deletion -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | not grep br define i32 @linear_setne() { entry: diff --git a/test/Transforms/IndVarSimplify/tripcount_infinite.ll b/test/Transforms/IndVarSimplify/tripcount_infinite.ll index d5965f4..0495b50 100644 --- a/test/Transforms/IndVarSimplify/tripcount_infinite.ll +++ b/test/Transforms/IndVarSimplify/tripcount_infinite.ll @@ -1,7 +1,7 @@ ; These tests have an infinite trip count. We obviously shouldn't remove the ; loops! :) ; -; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep icmp | wc -l > %t2 +; RUN: opt < %s -indvars -adce -simplifycfg -S | grep icmp | wc -l > %t2 ; RUN: llvm-as < %s | llvm-dis | grep icmp | wc -l > %t1 ; RUN: diff %t1 %t2 diff --git a/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll b/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll index 759ba8e..0c8857f 100644 --- a/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll +++ b/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -instcombine | llvm-dis | \ +; RUN: opt < %s -indvars -instcombine -S | \ ; RUN: grep {store i32 0} ; Test that -indvars can reduce variable stride IVs. If it can reduce variable ; stride iv's, it will make %iv. and %m.0.0 isomorphic to each other without diff --git a/test/Transforms/IndVarSimplify/variable-stride-ivs-1.ll b/test/Transforms/IndVarSimplify/variable-stride-ivs-1.ll index 075e899..98cfa34 100644 --- a/test/Transforms/IndVarSimplify/variable-stride-ivs-1.ll +++ b/test/Transforms/IndVarSimplify/variable-stride-ivs-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars +; RUN: opt < %s -indvars ; PR4315 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-f80:128:128" diff --git a/test/Transforms/Inline/2003-09-14-InlineValue.ll b/test/Transforms/Inline/2003-09-14-InlineValue.ll index edc9b47..49a27e1 100644 --- a/test/Transforms/Inline/2003-09-14-InlineValue.ll +++ b/test/Transforms/Inline/2003-09-14-InlineValue.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output declare i32 @External() diff --git a/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll b/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll index d57aee0..5ced3b8 100644 --- a/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll +++ b/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output define i32 @main() { entry: diff --git a/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll b/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll index d75999b..4418f77 100644 --- a/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll +++ b/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output define i32 @main() { entry: diff --git a/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll b/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll index 09d516f..1bd5529 100644 --- a/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll +++ b/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output define i32 @main() { entry: diff --git a/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll b/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll index 6b6cf06..4a80d37 100644 --- a/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll +++ b/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output define i32 @reload() { reloadentry: diff --git a/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll b/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll index 675454e..9afd450 100644 --- a/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll +++ b/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll @@ -2,7 +2,7 @@ ; node in the exception destination, and the inlined function contains an ; unwind instruction. -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output define linkonce void @foo() { unwind diff --git a/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll b/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll index 8a2f8e2..3899451 100644 --- a/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll +++ b/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output ; Inlining the first call caused the inliner function to delete the second ; call. Then the inliner tries to inline the second call, which no longer diff --git a/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll b/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll index d9f09a0..fabad30 100644 --- a/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll +++ b/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output +; RUN: opt < %s -inline -prune-eh -disable-output define linkonce void @caller() { call void @callee( ) diff --git a/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll b/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll index 09666ec..733cbb9 100644 --- a/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll +++ b/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output define i32 @test() { unwind diff --git a/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll b/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll index acdf6ab..415495e 100644 --- a/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll +++ b/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output +; RUN: opt < %s -inline -prune-eh -disable-output %"struct.std::__codecvt_abstract_base<char,char,__mbstate_t>" = type { %"struct.std::locale::facet" } %"struct.std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >" = type { i32 (...)**, i32*, i32*, i32*, i32*, i32*, i32*, %"struct.std::locale" } diff --git a/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll b/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll index 5215bec..6934562 100644 --- a/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll +++ b/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output +; RUN: opt < %s -inline -prune-eh -disable-output ; PR827 @_ZTV8CRjii = internal global [1 x i32 (...)*] [ i32 (...)* @_ZN8CRjii12NlFeeEPN5Jr7sE ] ; <[1 x i32 (...)*]*> [#uses=0] diff --git a/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll b/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll index bd2885d..37cba98 100644 --- a/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll +++ b/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output +; RUN: opt < %s -inline -prune-eh -disable-output ; PR993 target datalayout = "e-p:32:32" target triple = "i386-unknown-openbsd3.9" diff --git a/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll b/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll index 05096f4..279823a 100644 --- a/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll +++ b/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output +; RUN: opt < %s -inline -prune-eh -disable-output ; PR992 target datalayout = "e-p:32:32" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/Inline/2007-04-15-InlineEH.ll b/test/Transforms/Inline/2007-04-15-InlineEH.ll index 083a328..635f93e 100644 --- a/test/Transforms/Inline/2007-04-15-InlineEH.ll +++ b/test/Transforms/Inline/2007-04-15-InlineEH.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep {invoke void asm} +; RUN: opt < %s -inline -S | not grep {invoke void asm} ; PR1335 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" diff --git a/test/Transforms/Inline/2007-06-06-NoInline.ll b/test/Transforms/Inline/2007-06-06-NoInline.ll index 51bba07..d5a7953 100644 --- a/test/Transforms/Inline/2007-06-06-NoInline.ll +++ b/test/Transforms/Inline/2007-06-06-NoInline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -f - | llvm-dis | grep "define internal i32 @bar" +; RUN: opt < %s -inline -S | grep "define internal i32 @bar" @llvm.noinline = appending global [1 x i8*] [ i8* bitcast (i32 (i32, i32)* @bar to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] define internal i32 @bar(i32 %x, i32 %y) { diff --git a/test/Transforms/Inline/2007-06-25-WeakInline.ll b/test/Transforms/Inline/2007-06-25-WeakInline.ll index 3cf758c..929891a 100644 --- a/test/Transforms/Inline/2007-06-25-WeakInline.ll +++ b/test/Transforms/Inline/2007-06-25-WeakInline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep call +; RUN: opt < %s -inline -S | grep call ; 'bar' can be overridden at link-time, don't inline it. diff --git a/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll b/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll index 5f7da15..08d4dc6 100644 --- a/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll +++ b/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as %s -o - | opt -inline | llvm-dis | grep nounwind -; RUN: llvm-as %s -o - | opt -inline | llvm-dis | grep unreachable +; RUN: opt < %s -inline -S | grep nounwind +; RUN: opt < %s -inline -S | grep unreachable declare i1 @extern() diff --git a/test/Transforms/Inline/2008-03-04-StructRet.ll b/test/Transforms/Inline/2008-03-04-StructRet.ll index fc7ebc4..3311d56 100644 --- a/test/Transforms/Inline/2008-03-04-StructRet.ll +++ b/test/Transforms/Inline/2008-03-04-StructRet.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output %struct.Benchmark = type { i32 (...)** } %struct.Complex = type { double, double } %struct.ComplexBenchmark = type { %struct.Benchmark } diff --git a/test/Transforms/Inline/2008-03-07-Inline-2.ll b/test/Transforms/Inline/2008-03-07-Inline-2.ll index 0c25690..0c968e6 100644 --- a/test/Transforms/Inline/2008-03-07-Inline-2.ll +++ b/test/Transforms/Inline/2008-03-07-Inline-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output %struct.Demand = type { double, double } %struct.branch = type { %struct.Demand, double, double, double, double, %struct.branch*, [12 x %struct.leaf*] } %struct.leaf = type { %struct.Demand, double, double } diff --git a/test/Transforms/Inline/2008-03-07-Inline.ll b/test/Transforms/Inline/2008-03-07-Inline.ll index 09d14f0..86afb2d 100644 --- a/test/Transforms/Inline/2008-03-07-Inline.ll +++ b/test/Transforms/Inline/2008-03-07-Inline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output %struct.Demand = type { double, double } %struct.branch = type { %struct.Demand, double, double, double, double, %struct.branch*, [12 x %struct.leaf*] } %struct.leaf = type { %struct.Demand, double, double } diff --git a/test/Transforms/Inline/2008-09-02-AlwaysInline.ll b/test/Transforms/Inline/2008-09-02-AlwaysInline.ll index b42e559..39095c4 100644 --- a/test/Transforms/Inline/2008-09-02-AlwaysInline.ll +++ b/test/Transforms/Inline/2008-09-02-AlwaysInline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline-threshold=0 -inline | llvm-dis | not grep call +; RUN: opt < %s -inline-threshold=0 -inline -S | not grep call define i32 @fn2() alwaysinline { ret i32 1 diff --git a/test/Transforms/Inline/2008-09-02-NoInline.ll b/test/Transforms/Inline/2008-09-02-NoInline.ll index 35b4b46..33c8949 100644 --- a/test/Transforms/Inline/2008-09-02-NoInline.ll +++ b/test/Transforms/Inline/2008-09-02-NoInline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep call | count 1 +; RUN: opt < %s -inline -S | grep call | count 1 define i32 @fn2() noinline { ret i32 1 diff --git a/test/Transforms/Inline/2008-10-30-AlwaysInline.ll b/test/Transforms/Inline/2008-10-30-AlwaysInline.ll index 765fc75..11e5012 100644 --- a/test/Transforms/Inline/2008-10-30-AlwaysInline.ll +++ b/test/Transforms/Inline/2008-10-30-AlwaysInline.ll @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | opt -always-inline | llvm-dis | not grep call +; RUN: opt < %s -always-inline -S | not grep call ; Ensure that threshold doesn't disrupt always inline. -; RUN: llvm-as < %s | opt -inline-threshold=-2000000001 -always-inline | llvm-dis | not grep call +; RUN: opt < %s -inline-threshold=-2000000001 -always-inline -S | not grep call define internal i32 @if0() alwaysinline { diff --git a/test/Transforms/Inline/2008-11-04-AlwaysInline.ll b/test/Transforms/Inline/2008-11-04-AlwaysInline.ll index 7539852..bc9787b 100644 --- a/test/Transforms/Inline/2008-11-04-AlwaysInline.ll +++ b/test/Transforms/Inline/2008-11-04-AlwaysInline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -always-inline | llvm-dis | grep {@foo} +; RUN: opt < %s -always-inline -S | grep {@foo} ; Ensure that foo is not removed by always inliner ; PR 2945 diff --git a/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll b/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll index 14840ba..db2a799 100644 --- a/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll +++ b/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep call +; RUN: opt < %s -inline -S | grep call ; Do not inline calls to variable-sized alloca. @q = common global i8* null ; <i8**> [#uses=1] diff --git a/test/Transforms/Inline/2009-01-12-RecursiveInline.ll b/test/Transforms/Inline/2009-01-12-RecursiveInline.ll index 8a4b2e0..1a3325a 100644 --- a/test/Transforms/Inline/2009-01-12-RecursiveInline.ll +++ b/test/Transforms/Inline/2009-01-12-RecursiveInline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {call.*fib} | count 4 +; RUN: opt < %s -inline -S | grep {call.*fib} | count 4 ; First call to fib from fib is inlined, producing 2 instead of 1, total 3. ; Second call to fib from fib is not inlined because new body of fib exceeds ; inlining limit of 200. Plus call in main = 4 total. diff --git a/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll b/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll index 3702afa..7d8d16b 100644 --- a/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll +++ b/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -argpromotion -disable-output +; RUN: opt < %s -inline -argpromotion -disable-output ; ModuleID = '<stdin>' 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" target triple = "i386-apple-darwin9.6" diff --git a/test/Transforms/Inline/2009-05-07-CallUsingSelfCrash.ll b/test/Transforms/Inline/2009-05-07-CallUsingSelfCrash.ll index 067fd72e..c8629ea 100644 --- a/test/Transforms/Inline/2009-05-07-CallUsingSelfCrash.ll +++ b/test/Transforms/Inline/2009-05-07-CallUsingSelfCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output +; RUN: opt < %s -inline -disable-output ; PR4123 %struct.S0 = type <{ i32 }> %struct.S1 = type <{ i8, i8, i8, i8, %struct.S0 }> diff --git a/test/Transforms/Inline/PR4909.ll b/test/Transforms/Inline/PR4909.ll new file mode 100644 index 0000000..24545f9 --- /dev/null +++ b/test/Transforms/Inline/PR4909.ll @@ -0,0 +1,15 @@ +; RUN: opt < %s -partial-inliner -disable-output + +define i32 @f() { +entry: + br label %return + +return: ; preds = %entry + ret i32 undef +} + +define i32 @g() { +entry: + %0 = call i32 @f() + ret i32 %0 +} diff --git a/test/Transforms/Inline/alloca-in-scc.ll b/test/Transforms/Inline/alloca-in-scc.ll new file mode 100644 index 0000000..d539255 --- /dev/null +++ b/test/Transforms/Inline/alloca-in-scc.ll @@ -0,0 +1,31 @@ +; RUN: opt < %s -inline | llvm-dis + +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" +target triple = "i386-apple-darwin10.0" + +define i32 @main(i32 %argc, i8** %argv) nounwind ssp { +entry: + call fastcc void @c() nounwind + unreachable +} + +define internal fastcc void @a() nounwind ssp { +entry: + %al = alloca [3 x i32], align 4 + %0 = getelementptr inbounds [3 x i32]* %al, i32 0, i32 2 + + call fastcc void @c() nounwind + unreachable +} + +define internal fastcc void @b() nounwind ssp { +entry: + tail call fastcc void @a() nounwind ssp + unreachable +} + +define internal fastcc void @c() nounwind ssp { +entry: + call fastcc void @b() nounwind + unreachable +} diff --git a/test/Transforms/Inline/alloca_test.ll b/test/Transforms/Inline/alloca_test.ll index 1fbd095..e5791d5 100644 --- a/test/Transforms/Inline/alloca_test.ll +++ b/test/Transforms/Inline/alloca_test.ll @@ -1,7 +1,7 @@ ; This test ensures that alloca instructions in the entry block for an inlined ; function are moved to the top of the function they are inlined into. ; -; RUN: llvm-as < %s | opt -inline | llvm-dis | %prcontext alloca 1 | grep Entry: +; RUN: opt -S -inline %s | FileCheck %s define i32 @func(i32 %i) { %X = alloca i32 ; <i32*> [#uses=1] @@ -13,6 +13,8 @@ declare void @bar() define i32 @main(i32 %argc) { Entry: +; CHECK: Entry +; CHECK-NEXT: alloca call void @bar( ) %X = call i32 @func( i32 7 ) ; <i32> [#uses=1] %Y = add i32 %X, %argc ; <i32> [#uses=1] diff --git a/test/Transforms/Inline/always_inline_dyn_alloca.ll b/test/Transforms/Inline/always_inline_dyn_alloca.ll index 933925e..25cfc49 100644 --- a/test/Transforms/Inline/always_inline_dyn_alloca.ll +++ b/test/Transforms/Inline/always_inline_dyn_alloca.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep callee +; RUN: opt < %s -inline -S | not grep callee ; rdar://6655932 ; If callee is marked alwaysinline, inline it! Even if callee has dynamic diff --git a/test/Transforms/Inline/array_merge.ll b/test/Transforms/Inline/array_merge.ll new file mode 100644 index 0000000..0d176b8 --- /dev/null +++ b/test/Transforms/Inline/array_merge.ll @@ -0,0 +1,26 @@ +; RUN: opt < %s -inline -S | FileCheck %s +; rdar://7173846 +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" +target triple = "i386-apple-darwin10.0" + +define internal void @foo() nounwind ssp { +entry: + %A = alloca [100 x i32] + %B = alloca [100 x i32] + call void @bar([100 x i32]* %A, [100 x i32]* %B) nounwind + ret void +} + +declare void @bar([100 x i32]*, [100 x i32]*) + +define void @test() nounwind ssp { +entry: +; CHECK: @test() +; CHECK-NEXT: entry: +; CHECK-NEXT: %A.i = alloca +; CHECK-NEXT: %B.i = alloca +; CHECK-NEXT: call void + call void @foo() nounwind + call void @foo() nounwind + ret void +} diff --git a/test/Transforms/Inline/basictest.ll b/test/Transforms/Inline/basictest.ll index d954238..71e00cb 100644 --- a/test/Transforms/Inline/basictest.ll +++ b/test/Transforms/Inline/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -disable-output -print-function 2> /dev/null +; RUN: opt < %s -inline -disable-output -print-function 2> /dev/null define i32 @func(i32 %i) { ret i32 %i diff --git a/test/Transforms/Inline/byval.ll b/test/Transforms/Inline/byval.ll index ea8c357..c3552f6 100644 --- a/test/Transforms/Inline/byval.ll +++ b/test/Transforms/Inline/byval.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {llvm.memcpy} +; RUN: opt < %s -inline -S | grep {llvm.memcpy} ; Inlining a byval struct should cause an explicit copy into an alloca. diff --git a/test/Transforms/Inline/byval2.ll b/test/Transforms/Inline/byval2.ll index e949d01..a7ab77c 100644 --- a/test/Transforms/Inline/byval2.ll +++ b/test/Transforms/Inline/byval2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep {llvm.memcpy} +; RUN: opt < %s -inline -S | not grep {llvm.memcpy} ; Inlining a byval struct should NOT cause an explicit copy ; into an alloca if the function is readonly diff --git a/test/Transforms/Inline/callgraph-update.ll b/test/Transforms/Inline/callgraph-update.ll new file mode 100644 index 0000000..528e9af --- /dev/null +++ b/test/Transforms/Inline/callgraph-update.ll @@ -0,0 +1,33 @@ +; RUN: opt < %s -inline -loop-rotate | llvm-dis +; PR3601 +declare void @solve() + +define internal fastcc void @read() { + br label %bb4 + +bb3: + br label %bb4 + +bb4: + call void @solve() + br i1 false, label %bb5, label %bb3 + +bb5: + unreachable +} + +define internal fastcc void @parse() { + call fastcc void @read() + ret void +} + +define void @main() { + invoke fastcc void @parse() + to label %invcont unwind label %lpad + +invcont: + unreachable + +lpad: + unreachable +} diff --git a/test/Transforms/Inline/casts.ll b/test/Transforms/Inline/casts.ll index 029d309..166185a 100644 --- a/test/Transforms/Inline/casts.ll +++ b/test/Transforms/Inline/casts.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {ret i32 1} +; RUN: opt < %s -inline -S | grep {ret i32 1} ; ModuleID = 'short.opt.bc' define i32 @testBool(i1 %X) { diff --git a/test/Transforms/Inline/cfg_preserve_test.ll b/test/Transforms/Inline/cfg_preserve_test.ll index 6b6ff18..9597109 100644 --- a/test/Transforms/Inline/cfg_preserve_test.ll +++ b/test/Transforms/Inline/cfg_preserve_test.ll @@ -1,6 +1,6 @@ ; This test ensures that inlining an "empty" function does not destroy the CFG ; -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep br +; RUN: opt < %s -inline -S | not grep br define i32 @func(i32 %i) { ret i32 %i diff --git a/test/Transforms/Inline/crash.ll b/test/Transforms/Inline/crash.ll new file mode 100644 index 0000000..30eae7a --- /dev/null +++ b/test/Transforms/Inline/crash.ll @@ -0,0 +1,57 @@ +; RUN: opt < %s -inline -argpromotion -instcombine -disable-output + +; This test was failing because the inliner would inline @list_DeleteElement +; into @list_DeleteDuplicates and then into @inf_GetBackwardPartnerLits, +; turning the indirect call into a direct one. This allowed instcombine to see +; the bitcast and eliminate it, deleting the original call and introducing +; another one. This crashed the inliner because the new call was not in the +; callgraph. + +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" +target triple = "i386-apple-darwin10.0" + + +define void @list_DeleteElement(i32 (i8*, i8*)* nocapture %Test) nounwind ssp { +entry: + %0 = call i32 %Test(i8* null, i8* undef) nounwind + ret void +} + + +define void @list_DeleteDuplicates(i32 (i8*, i8*)* nocapture %Test) nounwind ssp { +foo: + call void @list_DeleteElement(i32 (i8*, i8*)* %Test) nounwind ssp + call fastcc void @list_Rplacd1284() nounwind ssp + unreachable + +} + +define internal i32 @inf_LiteralsHaveSameSubtermAndAreFromSameClause(i32* nocapture %L1, i32* nocapture %L2) nounwind readonly ssp { +entry: + unreachable +} + + +define internal fastcc void @inf_GetBackwardPartnerLits(i32* nocapture %Flags) nounwind ssp { +test: + call void @list_DeleteDuplicates(i32 (i8*, i8*)* bitcast (i32 (i32*, i32*)* @inf_LiteralsHaveSameSubtermAndAreFromSameClause to i32 (i8*, i8*)*)) nounwind + ret void +} + + +define void @inf_BackwardEmptySortPlusPlus() nounwind ssp { +entry: + call fastcc void @inf_GetBackwardPartnerLits(i32* null) nounwind ssp + unreachable +} + +define void @inf_BackwardWeakening() nounwind ssp { +entry: + call fastcc void @inf_GetBackwardPartnerLits(i32* null) nounwind ssp + unreachable +} + + + + +declare fastcc void @list_Rplacd1284() nounwind ssp diff --git a/test/Transforms/Inline/dynamic_alloca_test.ll b/test/Transforms/Inline/dynamic_alloca_test.ll index b8ff7de..0286535 100644 --- a/test/Transforms/Inline/dynamic_alloca_test.ll +++ b/test/Transforms/Inline/dynamic_alloca_test.ll @@ -3,9 +3,9 @@ ; Functions with dynamic allocas can only be inlined into functions that ; already have dynamic allocas. -; RUN: llvm-as < %s | opt -inline | llvm-dis | \ +; RUN: opt < %s -inline -S | \ ; RUN: grep llvm.stacksave -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep callee +; RUN: opt < %s -inline -S | not grep callee declare void @ext(i32*) diff --git a/test/Transforms/Inline/externally_available.ll b/test/Transforms/Inline/externally_available.ll index 68f7d65..43fe5d3 100644 --- a/test/Transforms/Inline/externally_available.ll +++ b/test/Transforms/Inline/externally_available.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -constprop | llvm-dis > %t +; RUN: opt < %s -inline -constprop -S > %t ; RUN: not grep test_function %t ; RUN: grep {ret i32 5} %t diff --git a/test/Transforms/Inline/indirect_resolve.ll b/test/Transforms/Inline/indirect_resolve.ll new file mode 100644 index 0000000..76182e2 --- /dev/null +++ b/test/Transforms/Inline/indirect_resolve.ll @@ -0,0 +1,16 @@ +; RUN: opt < %s -inline | llvm-dis +; PR4834 + +define i32 @main() { + %funcall1_ = call fastcc i32 ()* ()* @f1() + %executecommandptr1_ = call i32 %funcall1_() + ret i32 %executecommandptr1_ +} + +define internal fastcc i32 ()* @f1() nounwind readnone { + ret i32 ()* @f2 +} + +define internal i32 @f2() nounwind readnone { + ret i32 1 +} diff --git a/test/Transforms/Inline/inline-invoke-tail.ll b/test/Transforms/Inline/inline-invoke-tail.ll index 53f755e..961f678 100644 --- a/test/Transforms/Inline/inline-invoke-tail.ll +++ b/test/Transforms/Inline/inline-invoke-tail.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep {tail call void @llvm.memcpy.i32} +; RUN: opt < %s -inline -S | not grep {tail call void @llvm.memcpy.i32} ; PR3550 define internal void @foo(i32* %p, i32* %q) { diff --git a/test/Transforms/Inline/inline-tail.ll b/test/Transforms/Inline/inline-tail.ll index 5921655..8bb059d 100644 --- a/test/Transforms/Inline/inline-tail.ll +++ b/test/Transforms/Inline/inline-tail.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep tail +; RUN: opt < %s -inline -S | not grep tail declare void @bar(i32*) diff --git a/test/Transforms/Inline/inline_cleanup.ll b/test/Transforms/Inline/inline_cleanup.ll index 89b3a82..4c64721 100644 --- a/test/Transforms/Inline/inline_cleanup.ll +++ b/test/Transforms/Inline/inline_cleanup.ll @@ -1,9 +1,9 @@ ; Test that the inliner doesn't leave around dead allocas, and that it folds ; uncond branches away after it is done specializing. -; RUN: llvm-as < %s | opt -inline | llvm-dis | \ +; RUN: opt < %s -inline -S | \ ; RUN: not grep {alloca.*uses=0} -; RUN: llvm-as < %s | opt -inline | llvm-dis | \ +; RUN: opt < %s -inline -S | \ ; RUN: not grep {br label} @A = weak global i32 0 ; <i32*> [#uses=1] @B = weak global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/Inline/inline_constprop.ll b/test/Transforms/Inline/inline_constprop.ll index 4744c86..537c69b 100644 --- a/test/Transforms/Inline/inline_constprop.ll +++ b/test/Transforms/Inline/inline_constprop.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep callee -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep div +; RUN: opt < %s -inline -S | not grep callee +; RUN: opt < %s -inline -S | not grep div define internal i32 @callee(i32 %A, i32 %B) { diff --git a/test/Transforms/Inline/inline_dce.ll b/test/Transforms/Inline/inline_dce.ll index dd971be..5143d02 100644 --- a/test/Transforms/Inline/inline_dce.ll +++ b/test/Transforms/Inline/inline_dce.ll @@ -1,7 +1,7 @@ ; This checks to ensure that the inline pass deletes functions if they get ; inlined into all of their callers. -; RUN: llvm-as < %s | opt -inline | llvm-dis | \ +; RUN: opt < %s -inline -S | \ ; RUN: not grep @reallysmall define internal i32 @reallysmall(i32 %A) { diff --git a/test/Transforms/Inline/inline_prune.ll b/test/Transforms/Inline/inline_prune.ll index fcd8321..658a422 100644 --- a/test/Transforms/Inline/inline_prune.ll +++ b/test/Transforms/Inline/inline_prune.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | \ +; RUN: opt < %s -inline -S | \ ; RUN: not grep {callee\[12\](} -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep mul +; RUN: opt < %s -inline -S | not grep mul define internal i32 @callee1(i32 %A, i32 %B) { %cond = icmp eq i32 %A, 123 ; <i1> [#uses=1] diff --git a/test/Transforms/Inline/invoke_test-1.ll b/test/Transforms/Inline/invoke_test-1.ll index 1fd3317..0d27e2a 100644 --- a/test/Transforms/Inline/invoke_test-1.ll +++ b/test/Transforms/Inline/invoke_test-1.ll @@ -1,7 +1,7 @@ ; Test that we can inline a simple function, turning the calls in it into invoke ; instructions -; RUN: llvm-as < %s | opt -inline | llvm-dis | \ +; RUN: opt < %s -inline -S | \ ; RUN: not grep {call\[^e\]} declare void @might_throw() diff --git a/test/Transforms/Inline/invoke_test-2.ll b/test/Transforms/Inline/invoke_test-2.ll index 68b8bd8..bbb9ab0 100644 --- a/test/Transforms/Inline/invoke_test-2.ll +++ b/test/Transforms/Inline/invoke_test-2.ll @@ -1,7 +1,7 @@ ; Test that if an invoked function is inlined, and if that function cannot ; throw, that the dead handler is now unreachable. -; RUN: llvm-as < %s | opt -inline -simplifycfg | llvm-dis | \ +; RUN: opt < %s -inline -simplifycfg -S | \ ; RUN: not grep UnreachableExceptionHandler declare void @might_throw() diff --git a/test/Transforms/Inline/invoke_test-3.ll b/test/Transforms/Inline/invoke_test-3.ll index a5deec6..b360526 100644 --- a/test/Transforms/Inline/invoke_test-3.ll +++ b/test/Transforms/Inline/invoke_test-3.ll @@ -1,7 +1,7 @@ ; Test that any rethrown exceptions in an inlined function are automatically ; turned into branches to the invoke destination. -; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep unwind$ +; RUN: opt < %s -inline -S | not grep unwind$ declare void @might_throw() diff --git a/test/Transforms/Inline/nested-inline.ll b/test/Transforms/Inline/nested-inline.ll new file mode 100644 index 0000000..1292667 --- /dev/null +++ b/test/Transforms/Inline/nested-inline.ll @@ -0,0 +1,111 @@ +; RUN: opt < %s -inline -S | FileCheck %s +; Test that bar and bar2 are both inlined throughout and removed. +@A = weak global i32 0 ; <i32*> [#uses=1] +@B = weak global i32 0 ; <i32*> [#uses=1] +@C = weak global i32 0 ; <i32*> [#uses=1] + +define fastcc void @foo(i32 %X) { +entry: +; CHECK: @foo + %ALL = alloca i32, align 4 ; <i32*> [#uses=1] + %tmp1 = and i32 %X, 1 ; <i32> [#uses=1] + %tmp1.upgrd.1 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1] + br i1 %tmp1.upgrd.1, label %cond_next, label %cond_true + +cond_true: ; preds = %entry + store i32 1, i32* @A + br label %cond_next + +cond_next: ; preds = %cond_true, %entry + %tmp4 = and i32 %X, 2 ; <i32> [#uses=1] + %tmp4.upgrd.2 = icmp eq i32 %tmp4, 0 ; <i1> [#uses=1] + br i1 %tmp4.upgrd.2, label %cond_next7, label %cond_true5 + +cond_true5: ; preds = %cond_next + store i32 1, i32* @B + br label %cond_next7 + +cond_next7: ; preds = %cond_true5, %cond_next + %tmp10 = and i32 %X, 4 ; <i32> [#uses=1] + %tmp10.upgrd.3 = icmp eq i32 %tmp10, 0 ; <i1> [#uses=1] + br i1 %tmp10.upgrd.3, label %cond_next13, label %cond_true11 + +cond_true11: ; preds = %cond_next7 + store i32 1, i32* @C + br label %cond_next13 + +cond_next13: ; preds = %cond_true11, %cond_next7 + %tmp16 = and i32 %X, 8 ; <i32> [#uses=1] + %tmp16.upgrd.4 = icmp eq i32 %tmp16, 0 ; <i1> [#uses=1] + br i1 %tmp16.upgrd.4, label %UnifiedReturnBlock, label %cond_true17 + +cond_true17: ; preds = %cond_next13 + call void @ext( i32* %ALL ) + ret void + +UnifiedReturnBlock: ; preds = %cond_next13 + ret void +} + +; CHECK-NOT: @bar +define internal fastcc void @bar(i32 %X) { +entry: + %ALL = alloca i32, align 4 ; <i32*> [#uses=1] + %tmp1 = and i32 %X, 1 ; <i32> [#uses=1] + %tmp1.upgrd.1 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1] + br i1 %tmp1.upgrd.1, label %cond_next, label %cond_true + +cond_true: ; preds = %entry + store i32 1, i32* @A + br label %cond_next + +cond_next: ; preds = %cond_true, %entry + %tmp4 = and i32 %X, 2 ; <i32> [#uses=1] + %tmp4.upgrd.2 = icmp eq i32 %tmp4, 0 ; <i1> [#uses=1] + br i1 %tmp4.upgrd.2, label %cond_next7, label %cond_true5 + +cond_true5: ; preds = %cond_next + store i32 1, i32* @B + br label %cond_next7 + +cond_next7: ; preds = %cond_true5, %cond_next + %tmp10 = and i32 %X, 4 ; <i32> [#uses=1] + %tmp10.upgrd.3 = icmp eq i32 %tmp10, 0 ; <i1> [#uses=1] + br i1 %tmp10.upgrd.3, label %cond_next13, label %cond_true11 + +cond_true11: ; preds = %cond_next7 + store i32 1, i32* @C + br label %cond_next13 + +cond_next13: ; preds = %cond_true11, %cond_next7 + %tmp16 = and i32 %X, 8 ; <i32> [#uses=1] + %tmp16.upgrd.4 = icmp eq i32 %tmp16, 0 ; <i1> [#uses=1] + br i1 %tmp16.upgrd.4, label %UnifiedReturnBlock, label %cond_true17 + +cond_true17: ; preds = %cond_next13 + call void @foo( i32 %X ) + ret void + +UnifiedReturnBlock: ; preds = %cond_next13 + ret void +} + +define internal fastcc void @bar2(i32 %X) { +entry: + call void @foo( i32 %X ) + ret void +} + +declare void @ext(i32*) + +define void @test(i32 %X) { +entry: +; CHECK: test +; CHECK-NOT: @bar + tail call fastcc void @bar( i32 %X ) + tail call fastcc void @bar( i32 %X ) + tail call fastcc void @bar2( i32 %X ) + tail call fastcc void @bar2( i32 %X ) + ret void +; CHECK: ret +} diff --git a/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll b/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll index 94ce68e..5d027a7 100644 --- a/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll +++ b/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll @@ -1,6 +1,6 @@ ; This testcase causes instcombine to hang. ; -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine define void @test(i32 %X) { %reg117 = add i32 %X, 0 ; <i32> [#uses=0] diff --git a/test/Transforms/InstCombine/2002-05-14-SubFailure.ll b/test/Transforms/InstCombine/2002-05-14-SubFailure.ll index 34c2df6..d2b2b00 100644 --- a/test/Transforms/InstCombine/2002-05-14-SubFailure.ll +++ b/test/Transforms/InstCombine/2002-05-14-SubFailure.ll @@ -1,6 +1,6 @@ ; Instcombine was missing a test that caused it to make illegal transformations ; sometimes. In this case, it transforms the sub into an add: -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub +; RUN: opt < %s -instcombine -S | grep sub ; define i32 @test(i32 %i, i32 %j) { %A = mul i32 %i, %j diff --git a/test/Transforms/InstCombine/2002-08-02-CastTest.ll b/test/Transforms/InstCombine/2002-08-02-CastTest.ll index 54c836c..363cb21 100644 --- a/test/Transforms/InstCombine/2002-08-02-CastTest.ll +++ b/test/Transforms/InstCombine/2002-08-02-CastTest.ll @@ -1,7 +1,7 @@ ; This testcase is incorrectly getting completely eliminated. There should be ; SOME instruction named %c here, even if it's a bitwise and. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep %c +; RUN: opt < %s -instcombine -S | grep %c ; define i64 @test3(i64 %A) { %c1 = trunc i64 %A to i8 ; <i8> [#uses=1] diff --git a/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll b/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll index e7bd6a8..22574f7 100644 --- a/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll +++ b/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add +; RUN: opt < %s -instcombine -S | not grep add define i32 @test(i32 %A) { %A.neg = sub i32 0, %A ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll b/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll index e7e7848..19010d2 100644 --- a/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll +++ b/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 4294967295 +; RUN: opt < %s -instcombine -S | grep 4294967295 define i64 @test(i64 %Val) { %tmp.3 = trunc i64 %Val to i32 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll b/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll index 214fa4d..8645249 100644 --- a/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll +++ b/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output @X = global i32 5 ; <i32*> [#uses=1] diff --git a/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll b/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll index 724f30f..154f3ba 100644 --- a/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll +++ b/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll @@ -2,7 +2,7 @@ ; because it things that the constant value is a not expression... and ; constantly inverts the branch back and forth. ; -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define i8 @test19(i1 %c) { br i1 true, label %True, label %False diff --git a/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll b/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll index 09732d3..f550c83 100644 --- a/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll +++ b/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll @@ -10,7 +10,7 @@ ; should pass through the optimizer without failure. ; ; Extra code: -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine ; END. target datalayout = "e-p:32:32" diff --git a/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll index 209ab1b..6d22754 100644 --- a/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll +++ b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll @@ -1,6 +1,6 @@ ; This testcase can be simplified by "realizing" that alloca can never return ; null. -; RUN: llvm-as < %s | opt -instcombine -simplifycfg | \ +; RUN: opt < %s -instcombine -simplifycfg | \ ; RUN: llvm-dis | not grep br declare i32 @bitmap_clear(...) diff --git a/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll b/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll index 9779f21..3297919 100644 --- a/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll +++ b/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep load +; RUN: opt < %s -instcombine -S | grep load define void @test(i32* %P) { ; Dead but not deletable! diff --git a/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll b/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll index 7d219cb..cfe5df6 100644 --- a/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll +++ b/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output declare i32* @bar() diff --git a/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll b/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll index 71585d4..c1692f7 100644 --- a/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll +++ b/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll @@ -1,5 +1,5 @@ ; The cast in this testcase is not eliminable on a 32-bit target! -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep inttoptr +; RUN: opt < %s -instcombine -S | grep inttoptr target datalayout = "e-p:32:32" diff --git a/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll b/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll index b6930b5..4d3d48e 100644 --- a/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll +++ b/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll @@ -1,8 +1,11 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep call | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s declare void @free(i8*) define void @test(i32* %X) { call void (...)* bitcast (void (i8*)* @free to void (...)*)( i32* %X ) ; <i32>:1 [#uses=0] +; CHECK: %tmp = bitcast i32* %X to i8* +; CHECK: call void @free(i8* %tmp) ret void +; CHECK: ret void } diff --git a/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll b/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll index c6a6b6a..bec0b9e 100644 --- a/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll +++ b/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll @@ -5,7 +5,7 @@ ; invoke instruction, we really cannot perform this transformation at all at ; least without splitting the critical edge. ; -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output declare i8* @test() diff --git a/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll b/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll index 3a4b661..a08e3a8 100644 --- a/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll +++ b/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 34 +; RUN: opt < %s -instcombine -S | not grep 34 define i32 @test(i32 %X) { ; Do not fold into shr X, 34, as this uses undefined behavior! diff --git a/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll b/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll index 2b5481b..ff20d7d 100644 --- a/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll +++ b/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll @@ -1,7 +1,7 @@ ; This testcase caused the combiner to go into an infinite loop, moving the ; cast back and forth, changing the seteq to operate on int vs uint and back. -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define i1 @test(i32 %A, i32 %B) { %C = sub i32 0, %A ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll b/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll index 0b93eb2..84f9bad 100644 --- a/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll +++ b/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define i32 @test() { ret i32 0 diff --git a/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll b/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll index 66a5a4d..8b54937 100644 --- a/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll +++ b/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output %Ty = type opaque diff --git a/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll b/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll index 82eecbb..819260b 100644 --- a/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll +++ b/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output @p = weak global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll b/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll index 9fc48de..f3e5d77 100644 --- a/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll +++ b/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine ; This testcase should not send the instcombiner into an infinite loop! diff --git a/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll b/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll index 5d2ed0b..1154bb4 100644 --- a/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll +++ b/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {ret i1 false} define i1 @test(i1 %V) { diff --git a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll index e56c390..8169d21 100644 --- a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll +++ b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \ +; RUN: opt < %s -instcombine -mem2reg -S | \ ; RUN: not grep {i32 1} ; When propagating the load through the select, make sure that the load is diff --git a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll index b89bd22..e646edf 100644 --- a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll +++ b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -mem2reg -simplifycfg | \ +; RUN: opt < %s -instcombine -mem2reg -simplifycfg | \ ; RUN: llvm-dis | grep -v store | not grep {i32 1} ; Test to make sure that instcombine does not accidentally propagate the load diff --git a/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll b/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll index ee4f62c..27c823b 100644 --- a/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll +++ b/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep -- -65536 +; RUN: opt < %s -instcombine -S | not grep -- -65536 define i1 @test(i32 %tmp.124) { %tmp.125 = shl i32 %tmp.124, 8 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll b/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll index 766ba48..730fdc2 100644 --- a/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll +++ b/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and +; RUN: opt < %s -instcombine -S | not grep and define i8 @test21(i8 %A) { ;; sign extend diff --git a/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll b/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll index 53bb496..187e2f5 100644 --- a/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll +++ b/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll @@ -9,124 +9,152 @@ ; be eliminated. In many cases the setCC is also eliminated based on the ; constant value and the range of the casted value. ; -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \ -; RUN: notcast .*int +; RUN: opt < %s -instcombine -S | FileCheck %s ; END. define i1 @lt_signed_to_large_unsigned(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp ult i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C1 = icmp sgt i8 %SB, -1 +; CHECK: ret i1 %C1 } define i1 @lt_signed_to_large_signed(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp slt i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 true } define i1 @lt_signed_to_large_negative(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp slt i32 %Y, -1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 false } define i1 @lt_signed_to_small_signed(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp slt i32 %Y, 17 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp slt i8 %SB, 17 +; CHECK: ret i1 %C } define i1 @lt_signed_to_small_negative(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp slt i32 %Y, -17 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp slt i8 %SB, -17 +; CHECK: ret i1 %C } define i1 @lt_unsigned_to_large_unsigned(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp ult i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 true } define i1 @lt_unsigned_to_large_signed(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp slt i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 true } define i1 @lt_unsigned_to_large_negative(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp slt i32 %Y, -1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 false } define i1 @lt_unsigned_to_small_unsigned(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp ult i32 %Y, 17 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp ult i8 %SB, 17 +; CHECK: ret i1 %C } define i1 @lt_unsigned_to_small_negative(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp slt i32 %Y, -17 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 false } define i1 @gt_signed_to_large_unsigned(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp ugt i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp slt i8 %SB, 0 +; CHECK: ret i1 %C } define i1 @gt_signed_to_large_signed(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp sgt i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 false } define i1 @gt_signed_to_large_negative(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp sgt i32 %Y, -1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 true } + define i1 @gt_signed_to_small_signed(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp sgt i32 %Y, 17 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp sgt i8 %SB, 17 +; CHECK: ret i1 %C } define i1 @gt_signed_to_small_negative(i8 %SB) { %Y = sext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp sgt i32 %Y, -17 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp sgt i8 %SB, -17 +; CHECK: ret i1 %C } define i1 @gt_unsigned_to_large_unsigned(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp ugt i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 false } define i1 @gt_unsigned_to_large_signed(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp sgt i32 %Y, 1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 false } define i1 @gt_unsigned_to_large_negative(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp sgt i32 %Y, -1024 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 true } define i1 @gt_unsigned_to_small_unsigned(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp ugt i32 %Y, 17 ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp ugt i8 %SB, 17 +; CHECK: ret i1 %C } define i1 @gt_unsigned_to_small_negative(i8 %SB) { %Y = zext i8 %SB to i32 ; <i32> [#uses=1] %C = icmp sgt i32 %Y, -17 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 true } diff --git a/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll b/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll index 4ea0b5c..008afa8 100644 --- a/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll +++ b/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine define i32 @test(i32 %X) { %Y = srem i32 %X, undef ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll b/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll index ffaa0051e..38553d7 100644 --- a/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll +++ b/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {ret i1 false} define i1 @test(i64 %tmp.169) { diff --git a/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll b/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll index 8b2aa35..1ec1180 100644 --- a/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll +++ b/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define i32 @test(i1 %C, i32 %tmp.15) { %tmp.16 = select i1 %C, i32 8, i32 1 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll b/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll index 53585f9..9846ee7 100644 --- a/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll +++ b/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define i32 @_Z13func_31585107li(i32 %l_39521025, i32 %l_59244666) { %shortcirc_val = select i1 false, i32 1, i32 0 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll b/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll index 64bfec1..e2d0618 100644 --- a/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll +++ b/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR577 define i1 @test() { diff --git a/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll b/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll index 10dbfec..f0e60ac 100644 --- a/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll +++ b/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR585 define i1 @test() { diff --git a/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll b/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll index 010087b..3d887dd 100644 --- a/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll +++ b/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {ret i1 true} ; PR586 diff --git a/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll b/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll index c58234a..caee951 100644 --- a/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll +++ b/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; This example caused instcombine to spin into an infinite loop. diff --git a/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll b/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll index c89b0d5..10541ef 100644 --- a/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll +++ b/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep undef define i32 @test(i8 %A) { diff --git a/test/Transforms/InstCombine/2006-02-28-Crash.ll b/test/Transforms/InstCombine/2006-02-28-Crash.ll index 1f3c9e8..9bea14c 100644 --- a/test/Transforms/InstCombine/2006-02-28-Crash.ll +++ b/test/Transforms/InstCombine/2006-02-28-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define i32 @test() { %tmp203 = icmp eq i32 1, 2 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll b/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll index e4b2b39..aa7d587 100644 --- a/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll +++ b/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define float @test(<4 x float> %V) { %V2 = insertelement <4 x float> %V, float 1.000000e+00, i32 3 ; <<4 x float>> [#uses=1] diff --git a/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll b/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll index 2541eb7..c337ea7 100644 --- a/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll +++ b/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll @@ -1,11 +1,13 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shl -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s ; This cannot be turned into a sign extending cast! define i64 @test(i64 %X) { %Y = shl i64 %X, 16 ; <i64> [#uses=1] +; CHECK: %Y = shl i64 %X, 16 %Z = ashr i64 %Y, 16 ; <i64> [#uses=1] +; CHECK: %Z = ashr i64 %Y, 16 ret i64 %Z +; CHECK: ret i64 %Z } diff --git a/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll b/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll index 1b9df40..e22395f 100644 --- a/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll +++ b/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; END. define void @test() { diff --git a/test/Transforms/InstCombine/2006-09-15-CastToBool.ll b/test/Transforms/InstCombine/2006-09-15-CastToBool.ll index 043b598..ee261ce 100644 --- a/test/Transforms/InstCombine/2006-09-15-CastToBool.ll +++ b/test/Transforms/InstCombine/2006-09-15-CastToBool.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and +; RUN: opt < %s -instcombine -S | grep and ; PR913 define i32 @test(i32* %tmp1) { diff --git a/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll b/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll index 4ca3dc1..889bbcf 100644 --- a/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll +++ b/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll @@ -1,5 +1,5 @@ ; The optimizer should be able to remove cast operation here. -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep sext.*i32 define i1 @eq_signed_to_small_unsigned(i8 %SB) { diff --git a/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll b/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll index 8678a85..4d1a9ef 100644 --- a/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll +++ b/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll @@ -1,6 +1,6 @@ ; This test case is reduced from llvmAsmParser.cpp ; The optimizer should not remove the cast here. -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep sext.*i32 diff --git a/test/Transforms/InstCombine/2006-10-20-mask.ll b/test/Transforms/InstCombine/2006-10-20-mask.ll index a5864f1..0aaa5e8 100644 --- a/test/Transforms/InstCombine/2006-10-20-mask.ll +++ b/test/Transforms/InstCombine/2006-10-20-mask.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep and define i64 @foo(i64 %tmp, i64 %tmp2) { diff --git a/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll b/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll index c7cf0dd..d3ba1e2 100644 --- a/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll +++ b/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep mul | count 2 define <4 x float> @test(<4 x float> %V) { diff --git a/test/Transforms/InstCombine/2006-11-03-Memmove64.ll b/test/Transforms/InstCombine/2006-11-03-Memmove64.ll index 23e805a..35bb45e 100644 --- a/test/Transforms/InstCombine/2006-11-03-Memmove64.ll +++ b/test/Transforms/InstCombine/2006-11-03-Memmove64.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep memmove.i32 ; Instcombine was trying to turn this into a memmove.i32 diff --git a/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll b/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll index 8c48d43..7799423 100644 --- a/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll +++ b/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep lshr +; RUN: opt < %s -instcombine -S | grep lshr ; Verify this is not turned into -1. define i32 @test(i8 %amt) { diff --git a/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll b/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll index eaf10a3..7adeb9f 100644 --- a/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll +++ b/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep add +; RUN: opt < %s -instcombine -S | grep sub +; RUN: opt < %s -instcombine -S | grep add define <4 x float> @test(<4 x float> %tmp26, <4 x float> %tmp53) { ; (X+Y)-Y != X for fp vectors. diff --git a/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll b/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll index 2c3313e..74483c1 100644 --- a/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll +++ b/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zext +; RUN: opt < %s -instcombine -S | grep zext ; Never merge these two conversions, even though it's possible: this is ; significantly more expensive than the two conversions on some targets diff --git a/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll b/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll index ddfb88c..80ee3e2 100644 --- a/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll +++ b/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {%bothcond =} define i1 @Doit_bb(i32 %i.0) { diff --git a/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll b/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll index 1508a52..5a74bd2 100644 --- a/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll +++ b/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {icmp sgt} ; END. target datalayout = "e-p:32:32" diff --git a/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll b/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll index e4aade7..2665791 100644 --- a/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll +++ b/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select +; RUN: opt < %s -instcombine -S | grep select ; END. target datalayout = "e-p:32:32" diff --git a/test/Transforms/InstCombine/2006-12-15-Range-Test.ll b/test/Transforms/InstCombine/2006-12-15-Range-Test.ll index 67bc84c..c3700a0 100644 --- a/test/Transforms/InstCombine/2006-12-15-Range-Test.ll +++ b/test/Transforms/InstCombine/2006-12-15-Range-Test.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep icmp | count 1 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {icmp ugt} | count 1 ; END. diff --git a/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll b/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll index 695aea4..eba1ac1 100644 --- a/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll +++ b/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll @@ -1,6 +1,6 @@ ; For PR1065. This causes an assertion in instcombine if a select with two cmp ; operands is encountered. -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; END. target datalayout = "e-p:32:32" diff --git a/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll b/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll index edbcfee..e5238a5 100644 --- a/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll +++ b/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp ugt} +; RUN: opt < %s -instcombine -S | grep {icmp ugt} ; PR1107 ; PR1940 diff --git a/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll b/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll index 073d3a1..d2d215f 100644 --- a/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll +++ b/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {fcmp uno.*0.0} +; RUN: opt < %s -instcombine -S | grep {fcmp uno.*0.0} ; PR1111 define i1 @test(double %X) { %tmp = fcmp une double %X, %X diff --git a/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll b/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll index 83d05d9..fed2255 100644 --- a/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll +++ b/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define <4 x i32> @test(<4 x i32> %A) { %B = xor <4 x i32> %A, < i32 -1, i32 -1, i32 -1, i32 -1 > diff --git a/test/Transforms/InstCombine/2007-01-27-AndICmp.ll b/test/Transforms/InstCombine/2007-01-27-AndICmp.ll index 0e8c5b1..bd15dce 100644 --- a/test/Transforms/InstCombine/2007-01-27-AndICmp.ll +++ b/test/Transforms/InstCombine/2007-01-27-AndICmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ugt.*, 1} +; RUN: opt < %s -instcombine -S | grep {ugt.*, 1} define i1 @test(i32 %tmp1030) { %tmp1037 = icmp ne i32 %tmp1030, 40 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll b/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll index e559cdd..05891a2 100644 --- a/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll +++ b/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | grep {%A = alloca} -; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \ +; RUN: opt < %s -instcombine -mem2reg -S | grep {%A = alloca} +; RUN: opt < %s -instcombine -mem2reg -S | \ ; RUN: not grep {%B = alloca} ; END. diff --git a/test/Transforms/InstCombine/2007-02-07-PointerCast.ll b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll index ce9eb3c..bf60991 100644 --- a/test/Transforms/InstCombine/2007-02-07-PointerCast.ll +++ b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll @@ -1,4 +1,4 @@ -;RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zext +;RUN: opt < %s -instcombine -S | grep zext ; Make sure the uint isn't removed. Instcombine in llvm 1.9 was dropping the ; uint cast which was causing a sign extend. This only affected code with diff --git a/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll b/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll index d60da44..f31c280 100644 --- a/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll +++ b/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret +; RUN: opt < %s -instcombine -S | grep ret ; PR1217 target datalayout = "e-p:32:32" diff --git a/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll b/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll index d101050..109e4a2 100644 --- a/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll +++ b/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp sle} +; RUN: opt < %s -instcombine -S | grep {icmp sle} ; PR1244 define i1 @test(i32 %c.3.i, i32 %d.292.2.i) { diff --git a/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll b/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll index da58dec..589bd80 100644 --- a/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll +++ b/test/Transforms/InstCombine/2007-03-19-BadTruncChangePR1261.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep zext +; RUN: opt < %s -instcombine -S | grep zext ; PR1261. define i16 @test(i31 %zzz) { diff --git a/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll b/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll index c8dafd1..ca93af3 100644 --- a/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll +++ b/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll @@ -1,5 +1,5 @@ ; For PR1248 -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep {ugt i32 .*, 11} +; RUN: opt < %s -instcombine -S | grep {ugt i32 .*, 11} define i1 @test(i32 %tmp6) { %tmp7 = sdiv i32 %tmp6, 12 ; <i32> [#uses=1] icmp ne i32 %tmp7, -6 ; <i1>:1 [#uses=1] diff --git a/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll b/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll index 0b05f7c..c794004 100644 --- a/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll +++ b/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll @@ -1,5 +1,5 @@ ; PR1271 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {icmp eq i32 .tmp.*, 2146435072} %struct..0anon = type { i32, i32 } %struct..1anon = type { double } diff --git a/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll b/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll index d67e1a1..0d4aac2 100644 --- a/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll +++ b/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll @@ -1,5 +1,5 @@ ; PR1271 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and +; RUN: opt < %s -instcombine -S | grep and define i1 @test(i32 %tmp13) { entry: %tmp14 = shl i32 %tmp13, 12 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll b/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll index 4a2e60e..5bcb543 100644 --- a/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll +++ b/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll @@ -1,5 +1,5 @@ ; PR1271 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {ashr i32 %.mp137, 2} ; END. diff --git a/test/Transforms/InstCombine/2007-03-27-PR1280.ll b/test/Transforms/InstCombine/2007-03-27-PR1280.ll index 6cb9aae..7700c7d 100644 --- a/test/Transforms/InstCombine/2007-03-27-PR1280.ll +++ b/test/Transforms/InstCombine/2007-03-27-PR1280.ll @@ -4,7 +4,7 @@ ; is not done. It should be removed when code gen supports "funny" ; bit widths. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i49.*-8388608} +; RUN: opt < %s -instcombine -S | grep {add i49.*-8388608} define i49 @test5(i49 %x) { ;; If we have ADD(XOR(AND(X, 0xFF), 0x80), 0xF..F80), it's a sext. diff --git a/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll b/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll index e738635..b59d3c8 100644 --- a/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll +++ b/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll @@ -2,7 +2,7 @@ ; a malloc messes up the element count, causing an extra 4GB to be allocated on ; 64-bit targets. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {= add } +; RUN: opt < %s -instcombine -S | not grep {= add } target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" target triple = "x86_64-unknown-freebsd6.2" diff --git a/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll b/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll index 34322a2..22eb2c2 100644 --- a/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll +++ b/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR1304 define i64 @bork(<1 x i64> %vec) { diff --git a/test/Transforms/InstCombine/2007-05-04-Crash.ll b/test/Transforms/InstCombine/2007-05-04-Crash.ll index 5ad7919..9f50d8a 100644 --- a/test/Transforms/InstCombine/2007-05-04-Crash.ll +++ b/test/Transforms/InstCombine/2007-05-04-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR1384 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" diff --git a/test/Transforms/InstCombine/2007-05-10-icmp-or.ll b/test/Transforms/InstCombine/2007-05-10-icmp-or.ll index 8769ded..4af5dfe 100644 --- a/test/Transforms/InstCombine/2007-05-10-icmp-or.ll +++ b/test/Transforms/InstCombine/2007-05-10-icmp-or.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define i1 @test(i32 %tmp9) { %tmp20 = icmp ugt i32 %tmp9, 255 ; <i1> [#uses=1] %tmp11.not = icmp sgt i32 %tmp9, 255 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-05-14-Crash.ll b/test/Transforms/InstCombine/2007-05-14-Crash.ll index ececd35..a3c010d 100644 --- a/test/Transforms/InstCombine/2007-05-14-Crash.ll +++ b/test/Transforms/InstCombine/2007-05-14-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output 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" target triple = "powerpc-apple-darwin8.8.0" diff --git a/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll b/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll index 55bfac5..40818d4 100644 --- a/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll +++ b/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call.*sret} +; RUN: opt < %s -instcombine -S | grep {call.*sret} ; Make sure instcombine doesn't drop the sret attribute. define void @blah(i16* %tmp10) { diff --git a/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll b/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll index 482c608..62b9351 100644 --- a/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll +++ b/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ashr} +; RUN: opt < %s -instcombine -S | grep {ashr} ; PR1499 define void @av_cmp_q_cond_true(i32* %retval, i32* %tmp9, i64* %tmp10) { diff --git a/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll b/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll index ffc4026..af539c1 100644 --- a/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll +++ b/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 true} +; RUN: opt < %s -instcombine -S | grep {ret i1 true} ; rdar://5278853 define i1 @test(i32 %tmp468) { diff --git a/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll b/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll index 988599b..3f76187 100644 --- a/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll +++ b/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR1594 define i64 @test(i16 %tmp510, i16 %tmp512) { diff --git a/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll b/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll index 2dcb439..c27fe0a 100644 --- a/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll +++ b/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp +; RUN: opt < %s -instcombine -S | grep icmp ; PR1646 @__gthrw_pthread_cancel = alias weak i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-09-11-Trampoline.ll b/test/Transforms/InstCombine/2007-09-11-Trampoline.ll index c022e57..d8f3d97 100644 --- a/test/Transforms/InstCombine/2007-09-11-Trampoline.ll +++ b/test/Transforms/InstCombine/2007-09-11-Trampoline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call i32 @f} +; RUN: opt < %s -instcombine -S | grep {call i32 @f} %struct.FRAME.nest = type { i32, i32 (i32)* } %struct.__builtin_trampoline = type { [10 x i8] } diff --git a/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll b/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll index 300edd5..23ee12b 100644 --- a/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll +++ b/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp +; RUN: opt < %s -instcombine -S | grep icmp ; PR1678 @A = alias weak void ()* @B ; <void ()*> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll b/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll index 6d251b1..3862de4 100644 --- a/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll +++ b/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep call -; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | not grep xyz +; RUN: opt < %s -instcombine -S | not grep call +; RUN: opt < %s -std-compile-opts -S | not grep xyz @.str = internal constant [4 x i8] c"xyz\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-10-12-Crash.ll b/test/Transforms/InstCombine/2007-10-12-Crash.ll index ed98fcd..b3d9f02 100644 --- a/test/Transforms/InstCombine/2007-10-12-Crash.ll +++ b/test/Transforms/InstCombine/2007-10-12-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output %struct.Ray = type { %struct.Vec, %struct.Vec } %struct.Scene = type { i32 (...)** } diff --git a/test/Transforms/InstCombine/2007-10-28-stacksave.ll b/test/Transforms/InstCombine/2007-10-28-stacksave.ll index 5f884d4..76bceb6 100644 --- a/test/Transforms/InstCombine/2007-10-28-stacksave.ll +++ b/test/Transforms/InstCombine/2007-10-28-stacksave.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call.*stacksave} +; RUN: opt < %s -instcombine -S | grep {call.*stacksave} ; PR1745 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll b/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll index 15e54b1..8105b4b 100644 --- a/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll +++ b/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output 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" target triple = "powerpc-apple-darwin8" diff --git a/test/Transforms/InstCombine/2007-10-31-StringCrash.ll b/test/Transforms/InstCombine/2007-10-31-StringCrash.ll index 6ba07e8..220f3e2 100644 --- a/test/Transforms/InstCombine/2007-10-31-StringCrash.ll +++ b/test/Transforms/InstCombine/2007-10-31-StringCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll b/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll index f3caf07..e1549a0 100644 --- a/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll +++ b/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR1780 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" diff --git a/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll b/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll index d7ac211..5282739 100644 --- a/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll +++ b/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i32 %In, 1} +; RUN: opt < %s -instcombine -S | grep {icmp eq i32 %In, 1} ; PR1800 define i1 @test(i32 %In) { diff --git a/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll b/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll index 1f211b6..f71b99c 100644 --- a/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll +++ b/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR1817 define i1 @test1(i32 %X) { diff --git a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll index 60a4b3b..24394c6 100644 --- a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll +++ b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast +; RUN: opt < %s -instcombine -S | not grep bitcast ; PR1716 @.str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll b/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll index 80df6fb..6420537b 100644 --- a/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll +++ b/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll @@ -1,6 +1,6 @@ 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" target triple = "i686-pc-linux-gnu" -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {ret i1 0} +; RUN: opt < %s -instcombine -S | not grep {ret i1 0} ; PR1850 define i1 @test() { diff --git a/test/Transforms/InstCombine/2007-12-12-GEPScale.ll b/test/Transforms/InstCombine/2007-12-12-GEPScale.ll index 6580f90..cea87f2 100644 --- a/test/Transforms/InstCombine/2007-12-12-GEPScale.ll +++ b/test/Transforms/InstCombine/2007-12-12-GEPScale.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 1431655764 +; RUN: opt < %s -instcombine -S | not grep 1431655764 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" diff --git a/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll b/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll index 336c6d5..85cf9b6 100644 --- a/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll +++ b/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep nounwind +; RUN: opt < %s -instcombine -S | grep nounwind define void @bar() { entry: diff --git a/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll b/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll index e44fc6f..cc89f6d 100644 --- a/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll +++ b/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add} | count 1 +; RUN: opt < %s -instcombine -S | grep {add} | count 1 define i32 @foo(i32 %a) { entry: diff --git a/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll b/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll index 5e95993..b59548f 100644 --- a/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll +++ b/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mem2reg -instcombine | llvm-dis | grep "ret i32 1" | count 8 +; RUN: opt < %s -mem2reg -instcombine -S | grep "ret i32 1" | count 8 define i32 @test1() { entry: diff --git a/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll b/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll index 277b4f0..5f4fa47 100644 --- a/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll +++ b/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll @@ -1,5 +1,5 @@ ; Ignore stderr, we expect warnings there -; RUN: llvm-as < %s 2> /dev/null | opt -instcombine | llvm-dis | not grep bitcast +; RUN: opt < %s -instcombine 2> /dev/null -S | not grep bitcast define void @a() { ret void diff --git a/test/Transforms/InstCombine/2008-01-06-CastCrash.ll b/test/Transforms/InstCombine/2008-01-06-CastCrash.ll index 1d816d4..097a0ce 100644 --- a/test/Transforms/InstCombine/2008-01-06-CastCrash.ll +++ b/test/Transforms/InstCombine/2008-01-06-CastCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define <2 x i32> @f() { ret <2 x i32> undef diff --git a/test/Transforms/InstCombine/2008-01-06-VoidCast.ll b/test/Transforms/InstCombine/2008-01-06-VoidCast.ll index 015210a..407ff4d 100644 --- a/test/Transforms/InstCombine/2008-01-06-VoidCast.ll +++ b/test/Transforms/InstCombine/2008-01-06-VoidCast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast +; RUN: opt < %s -instcombine -S | not grep bitcast define void @f(i16 %y) { ret void diff --git a/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll b/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll index 71d5bf7..fbc8ba97 100644 --- a/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll +++ b/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and +; RUN: opt < %s -instcombine -S | grep and ; PR1907 define i1 @test(i32 %c84.17) { diff --git a/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll b/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll index d791d7b..7b3281f 100644 --- a/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll +++ b/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep bitcast | count 2 +; RUN: opt < %s -instcombine -S | grep bitcast | count 2 define i32 @b(i32* inreg %x) signext { ret i32 0 diff --git a/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll b/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll index 5381db2..6401dfd 100644 --- a/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll +++ b/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output %struct.FRAME.nest = type { i32, i32 (i32*)* } %struct.__builtin_trampoline = type { [10 x i8] } diff --git a/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll b/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll index e35794a..9bb9408 100644 --- a/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll +++ b/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zeroext +; RUN: opt < %s -instcombine -S | grep zeroext %struct.FRAME.nest = type { i32, i32 (...)* } %struct.__builtin_trampoline = type { [10 x i8] } diff --git a/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll b/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll index 0c2cf54..5ff23a3 100644 --- a/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll +++ b/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {icmp s} +; RUN: opt < %s -instcombine -S | FileCheck %s ; PR1940 define i1 @test1(i8 %A, i8 %B) { @@ -7,6 +6,8 @@ define i1 @test1(i8 %A, i8 %B) { %b = zext i8 %B to i32 %c = icmp sgt i32 %a, %b ret i1 %c +; CHECK: %c = icmp ugt i8 %A, %B +; CHECK: ret i1 %c } define i1 @test2(i8 %A, i8 %B) { @@ -14,4 +15,6 @@ define i1 @test2(i8 %A, i8 %B) { %b = sext i8 %B to i32 %c = icmp ugt i32 %a, %b ret i1 %c +; CHECK: %c = icmp ugt i8 %A, %B +; CHECK: ret i1 %c } diff --git a/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll b/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll index 8de0959..a49829a 100644 --- a/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll +++ b/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll @@ -1,11 +1,15 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s define i16 @test1(i16 %a) { %tmp = zext i16 %a to i32 ; <i32> [#uses=2] %tmp21 = lshr i32 %tmp, 8 ; <i32> [#uses=1] +; CHECK: %tmp21 = lshr i16 %a, 8 %tmp5 = mul i32 %tmp, 5 ; <i32> [#uses=1] +; CHECK: %tmp5 = mul i16 %a, 5 %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1] +; CHECK: %tmp.upgrd.32 = or i16 %tmp21, %tmp5 %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1] ret i16 %tmp.upgrd.3 +; CHECK: ret i16 %tmp.upgrd.32 } diff --git a/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll b/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll index 346f90f..c161bcc 100644 --- a/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll +++ b/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select +; RUN: opt < %s -instcombine -S | grep select define double @fold(i1 %a, double %b) { %s = select i1 %a, double 0., double 1. diff --git a/test/Transforms/InstCombine/2008-01-29-AddICmp.ll b/test/Transforms/InstCombine/2008-01-29-AddICmp.ll index d937f7b..28a94ce 100644 --- a/test/Transforms/InstCombine/2008-01-29-AddICmp.ll +++ b/test/Transforms/InstCombine/2008-01-29-AddICmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {a.off} +; RUN: opt < %s -instcombine -S | not grep {a.off} ; PR1949 define i1 @test1(i32 %a) { diff --git a/test/Transforms/InstCombine/2008-02-13-MulURem.ll b/test/Transforms/InstCombine/2008-02-13-MulURem.ll index 6697383..a88c510 100644 --- a/test/Transforms/InstCombine/2008-02-13-MulURem.ll +++ b/test/Transforms/InstCombine/2008-02-13-MulURem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep rem +; RUN: opt < %s -instcombine -S | grep rem ; PR1933 define i32 @fold(i32 %a) { diff --git a/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll b/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll index cd61a10..af61c15 100644 --- a/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll +++ b/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i.* 0} | count 2 +; RUN: opt < %s -instcombine -S | grep {ret i.* 0} | count 2 ; PR2048 define i32 @i(i32 %a) { diff --git a/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll b/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll index 0e260c4..d26dec1 100644 --- a/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll +++ b/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {sdiv i8 \%a, 9} +; RUN: opt < %s -instcombine -S | grep {sdiv i8 \%a, 9} ; PR2048 define i8 @i(i8 %a) { diff --git a/test/Transforms/InstCombine/2008-02-23-MulSub.ll b/test/Transforms/InstCombine/2008-02-23-MulSub.ll index a74e98d..bb21c4b 100644 --- a/test/Transforms/InstCombine/2008-02-23-MulSub.ll +++ b/test/Transforms/InstCombine/2008-02-23-MulSub.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; RUN: opt < %s -instcombine -S | not grep mul define i26 @test(i26 %a) nounwind { entry: diff --git a/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll b/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll index ea02403..7f8bd4f 100644 --- a/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll +++ b/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis ; rdar://5771353 define float @test(float %x, x86_fp80 %y) nounwind readonly { diff --git a/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll b/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll index 31e7e35..da7e49e 100644 --- a/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll +++ b/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {16} | count 1 +; RUN: opt < %s -instcombine -S | grep {16} | count 1 define i8* @bork(i8** %qux) { %tmp275 = load i8** %qux, align 1 diff --git a/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll b/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll index 0201213..aa38065 100644 --- a/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll +++ b/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll @@ -1,6 +1,6 @@ ;; The bitcast cannot be eliminated because byval arguments need ;; the correct type, or at least a type of the correct size. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep bitcast +; RUN: opt < %s -instcombine -S | grep bitcast 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" target triple = "i386-apple-darwin9" %struct.NSRect = type { [4 x float] } diff --git a/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll b/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll index 9bfe7aa..626564da 100644 --- a/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll +++ b/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile store} +; RUN: opt < %s -instcombine -S | grep {volatile store} define void @test() { %votf = alloca <4 x float> ; <<4 x float>*> [#uses=1] diff --git a/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll b/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll index e43c22d..f2cc725 100644 --- a/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll +++ b/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile load} | count 2 +; RUN: opt < %s -instcombine -S | grep {volatile load} | count 2 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" target triple = "i386-apple-darwin8" @g_1 = internal global i32 0 ; <i32*> [#uses=3] diff --git a/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll b/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll index 293052a..176162d 100644 --- a/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll +++ b/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile load} | count 2 +; RUN: opt < %s -instcombine -S | grep {volatile load} | count 2 ; PR2262 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" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll b/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll index e9cc97d..bbd0042 100644 --- a/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll +++ b/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {store i8} | count 3 +; RUN: opt < %s -instcombine -S | grep {store i8} | count 3 ; PR2297 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" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll b/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll index e81e828..1da2856 100644 --- a/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll +++ b/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext strlen 1 | not grep ret +; RUN: opt -S -instcombine %s | FileCheck %s ; PR2297 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" target triple = "i386-apple-darwin8" @@ -11,6 +11,10 @@ entry: store i8 0, i8* %tmp3, align 1 %tmp5 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1] store i8 1, i8* %tmp5, align 1 +; CHECK: store +; CHECK: store +; CHECK-NEXT: strlen +; CHECK-NEXT: store %tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1] %tmp9 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1] store i8 0, i8* %tmp9, align 1 diff --git a/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll b/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll index 4dd29a7..d56a1a0 100644 --- a/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll +++ b/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR2303 %"struct.std::ctype<char>" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 } %"struct.std::locale::facet" = type { i32 (...)**, i32 } diff --git a/test/Transforms/InstCombine/2008-05-17-InfLoop.ll b/test/Transforms/InstCombine/2008-05-17-InfLoop.ll index 9cfbd6f..2939a48 100644 --- a/test/Transforms/InstCombine/2008-05-17-InfLoop.ll +++ b/test/Transforms/InstCombine/2008-05-17-InfLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR2339 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-s0:0:64-f80:32:32" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll b/test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll index e994399..b34fc1e 100644 --- a/test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll +++ b/test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false} | count 2 +; RUN: opt < %s -instcombine -S | grep {ret i1 false} | count 2 ; PR2329 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" diff --git a/test/Transforms/InstCombine/2008-05-22-IDivVector.ll b/test/Transforms/InstCombine/2008-05-22-IDivVector.ll index ad70b65..f7ba99c 100644 --- a/test/Transforms/InstCombine/2008-05-22-IDivVector.ll +++ b/test/Transforms/InstCombine/2008-05-22-IDivVector.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output define <3 x i8> @f(<3 x i8> %i) { %A = sdiv <3 x i8> %i, %i diff --git a/test/Transforms/InstCombine/2008-05-22-NegValVector.ll b/test/Transforms/InstCombine/2008-05-22-NegValVector.ll index f2511b3..bf92faf 100644 --- a/test/Transforms/InstCombine/2008-05-22-NegValVector.ll +++ b/test/Transforms/InstCombine/2008-05-22-NegValVector.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sub +; RUN: opt < %s -instcombine -S | not grep sub define <3 x i8> @f(<3 x i8> %a) { %A = sub <3 x i8> zeroinitializer, %a diff --git a/test/Transforms/InstCombine/2008-05-23-CompareFold.ll b/test/Transforms/InstCombine/2008-05-23-CompareFold.ll index c0f34e6..2de5af7 100644 --- a/test/Transforms/InstCombine/2008-05-23-CompareFold.ll +++ b/test/Transforms/InstCombine/2008-05-23-CompareFold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false} +; RUN: opt < %s -instcombine -S | grep {ret i1 false} ; PR2359 define i1 @f(i8* %x) { entry: diff --git a/test/Transforms/InstCombine/2008-05-31-AddBool.ll b/test/Transforms/InstCombine/2008-05-31-AddBool.ll index 7008587..5416693 100644 --- a/test/Transforms/InstCombine/2008-05-31-AddBool.ll +++ b/test/Transforms/InstCombine/2008-05-31-AddBool.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {xor} +; RUN: opt < %s -instcombine -S | grep {xor} ; PR2389 define i1 @test(i1 %a, i1 %b) { diff --git a/test/Transforms/InstCombine/2008-05-31-Bools.ll b/test/Transforms/InstCombine/2008-05-31-Bools.ll index f3df49b..a0fe47a 100644 --- a/test/Transforms/InstCombine/2008-05-31-Bools.ll +++ b/test/Transforms/InstCombine/2008-05-31-Bools.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t ; RUN: grep {xor} %t ; RUN: grep {and} %t ; RUN: not grep {div} %t diff --git a/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll b/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll index ec13bbf..5e4a9d0 100644 --- a/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll +++ b/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine define i65 @foo(i65 %x) nounwind { entry: diff --git a/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll b/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll index da63dd6..917d3ae 100644 --- a/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll +++ b/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {phi i32} | count 2 +; RUN: opt < %s -instcombine -S | grep {phi i32} | count 2 define void @test() nounwind { entry: diff --git a/test/Transforms/InstCombine/2008-06-13-InfiniteLoopStore.ll b/test/Transforms/InstCombine/2008-06-13-InfiniteLoopStore.ll index c671eb8..08959c9 100644 --- a/test/Transforms/InstCombine/2008-06-13-InfiniteLoopStore.ll +++ b/test/Transforms/InstCombine/2008-06-13-InfiniteLoopStore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {store i32} | count 2 +; RUN: opt < %s -instcombine -S | grep {store i32} | count 2 @g_139 = global i32 0 ; <i32*> [#uses=2] diff --git a/test/Transforms/InstCombine/2008-06-13-ReadOnlyCallStore.ll b/test/Transforms/InstCombine/2008-06-13-ReadOnlyCallStore.ll index 3f23098..aed1b14 100644 --- a/test/Transforms/InstCombine/2008-06-13-ReadOnlyCallStore.ll +++ b/test/Transforms/InstCombine/2008-06-13-ReadOnlyCallStore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {store i8} | count 2 +; RUN: opt < %s -instcombine -S | grep {store i8} | count 2 define i32 @a(i8* %s) nounwind { entry: diff --git a/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll b/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll index fa3dc0a..05f1c52 100644 --- a/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll +++ b/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep load | count 3 +; RUN: opt < %s -instcombine -S | grep load | count 3 ; PR2471 declare i32 @x(i32*) diff --git a/test/Transforms/InstCombine/2008-06-21-CompareMiscomp.ll b/test/Transforms/InstCombine/2008-06-21-CompareMiscomp.ll index e2d7100..c3371c6 100644 --- a/test/Transforms/InstCombine/2008-06-21-CompareMiscomp.ll +++ b/test/Transforms/InstCombine/2008-06-21-CompareMiscomp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i32 %In, 15} +; RUN: opt < %s -instcombine -S | grep {icmp eq i32 %In, 15} ; PR2479 ; (See also PR1800.) diff --git a/test/Transforms/InstCombine/2008-06-24-StackRestore.ll b/test/Transforms/InstCombine/2008-06-24-StackRestore.ll index 9ed7be3..8307834 100644 --- a/test/Transforms/InstCombine/2008-06-24-StackRestore.ll +++ b/test/Transforms/InstCombine/2008-06-24-StackRestore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call.*llvm.stackrestore} +; RUN: opt < %s -instcombine -S | grep {call.*llvm.stackrestore} ; PR2488 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" target triple = "i386-pc-linux-gnu" diff --git a/test/Transforms/InstCombine/2008-07-08-AndICmp.ll b/test/Transforms/InstCombine/2008-07-08-AndICmp.ll index c600241..a12f4bd 100644 --- a/test/Transforms/InstCombine/2008-07-08-AndICmp.ll +++ b/test/Transforms/InstCombine/2008-07-08-AndICmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp | count 1 +; RUN: opt < %s -instcombine -S | grep icmp | count 1 ; PR2330 define i1 @foo(i32 %a, i32 %b) nounwind { diff --git a/test/Transforms/InstCombine/2008-07-08-ShiftOneAndOne.ll b/test/Transforms/InstCombine/2008-07-08-ShiftOneAndOne.ll index 956b9a6..8245b4d 100644 --- a/test/Transforms/InstCombine/2008-07-08-ShiftOneAndOne.ll +++ b/test/Transforms/InstCombine/2008-07-08-ShiftOneAndOne.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp ne i32 \%a} +; RUN: opt < %s -instcombine -S | grep {icmp ne i32 \%a} ; PR2330 define i1 @foo(i32 %a) nounwind { diff --git a/test/Transforms/InstCombine/2008-07-08-SubAnd.ll b/test/Transforms/InstCombine/2008-07-08-SubAnd.ll index bf3afb9..0091159 100644 --- a/test/Transforms/InstCombine/2008-07-08-SubAnd.ll +++ b/test/Transforms/InstCombine/2008-07-08-SubAnd.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v {i32 8} +; RUN: opt < %s -instcombine -S | grep -v {i32 8} ; PR2330 define i32 @a(i32 %a) nounwind { diff --git a/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll b/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll index af728eb..ccfb118 100644 --- a/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll +++ b/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile load} | count 2 +; RUN: opt < %s -instcombine -S | grep {volatile load} | count 2 ; PR2496 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" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/InstCombine/2008-07-09-SubAndError.ll b/test/Transforms/InstCombine/2008-07-09-SubAndError.ll index c5b9358..47a7590 100644 --- a/test/Transforms/InstCombine/2008-07-09-SubAndError.ll +++ b/test/Transforms/InstCombine/2008-07-09-SubAndError.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {sub i32 0} +; RUN: opt < %s -instcombine -S | not grep {sub i32 0} ; PR2330 define i32 @foo(i32 %a) nounwind { diff --git a/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll b/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll index 205e57d..e911532 100644 --- a/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll +++ b/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {%C = xor i1 %A, true} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false} +; RUN: opt < %s -instcombine -S | grep {%C = xor i1 %A, true} +; RUN: opt < %s -instcombine -S | grep {ret i1 false} ; PR2539 define i1 @test1(i1 %A) { diff --git a/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll b/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll index 50533db..76e3039 100644 --- a/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll +++ b/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; RUN: opt < %s -instcombine -S | not grep add +; RUN: opt < %s -instcombine -S | not grep mul ; PR2330 define i1 @f(i32 %x, i32 %y) nounwind { diff --git a/test/Transforms/InstCombine/2008-07-11-RemAnd.ll b/test/Transforms/InstCombine/2008-07-11-RemAnd.ll index 0bfd41d..bf53451 100644 --- a/test/Transforms/InstCombine/2008-07-11-RemAnd.ll +++ b/test/Transforms/InstCombine/2008-07-11-RemAnd.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem +; RUN: opt < %s -instcombine -S | not grep rem ; PR2330 define i32 @a(i32 %b) nounwind { diff --git a/test/Transforms/InstCombine/2008-07-13-DivZero.ll b/test/Transforms/InstCombine/2008-07-13-DivZero.ll index 85c3dbc..be1f8c2 100644 --- a/test/Transforms/InstCombine/2008-07-13-DivZero.ll +++ b/test/Transforms/InstCombine/2008-07-13-DivZero.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {lshr.*3} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call .*%cond} +; RUN: opt < %s -instcombine -S | grep {lshr.*3} +; RUN: opt < %s -instcombine -S | grep {call .*%cond} ; PR2506 ; We can simplify the operand of udiv to '8', but not the operand to the diff --git a/test/Transforms/InstCombine/2008-07-16-fsub.ll b/test/Transforms/InstCombine/2008-07-16-fsub.ll index ca4174d..672b4e9 100644 --- a/test/Transforms/InstCombine/2008-07-16-fsub.ll +++ b/test/Transforms/InstCombine/2008-07-16-fsub.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub +; RUN: opt < %s -instcombine -S | grep sub ; PR2553 define double @test(double %X) nounwind { diff --git a/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll b/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll index 49e6cdd..501d8a6 100644 --- a/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll +++ b/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {store } +; RUN: opt < %s -instcombine -S | not grep {store } ; PR2296 @G = common global double 0.000000e+00, align 16 diff --git a/test/Transforms/InstCombine/2008-08-05-And.ll b/test/Transforms/InstCombine/2008-08-05-And.ll index 939e6b8..9773c2d 100644 --- a/test/Transforms/InstCombine/2008-08-05-And.ll +++ b/test/Transforms/InstCombine/2008-08-05-And.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep or +; RUN: opt < %s -instcombine -S | not grep or ; PR2629 define void @f(i8* %x) nounwind { diff --git a/test/Transforms/InstCombine/2008-08-17-ICmpXorSignbit.ll b/test/Transforms/InstCombine/2008-08-17-ICmpXorSignbit.ll index 428a359..e9081f0 100644 --- a/test/Transforms/InstCombine/2008-08-17-ICmpXorSignbit.ll +++ b/test/Transforms/InstCombine/2008-08-17-ICmpXorSignbit.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep xor +; RUN: opt < %s -instcombine -S | not grep xor define i1 @test1(i8 %x, i8 %y) { %X = xor i8 %x, 128 diff --git a/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll b/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll index 4b5dc6a..7c50141 100644 --- a/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll +++ b/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine define void @entry(i32 %m_task_id, i32 %start_x, i32 %end_x, i32 %start_y, i32 %end_y) { br label %1 diff --git a/test/Transforms/InstCombine/2008-09-29-FoldingOr.ll b/test/Transforms/InstCombine/2008-09-29-FoldingOr.ll index e7a8ca9..31ea94a 100644 --- a/test/Transforms/InstCombine/2008-09-29-FoldingOr.ll +++ b/test/Transforms/InstCombine/2008-09-29-FoldingOr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {or i1} +; RUN: opt < %s -instcombine -S | grep {or i1} ; PR2844 define i32 @test(i32 %p_74) { diff --git a/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll b/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll index dfe9c4a..fd36d86 100644 --- a/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll +++ b/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false} +; RUN: opt < %s -instcombine -S | grep {ret i1 false} ; PR2697 define i1 @x(i32 %x) nounwind { diff --git a/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll b/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll index 8f35a85..d70d052 100644 --- a/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll +++ b/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine ; PR2940 define i32 @tstid() { diff --git a/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll b/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll index 46e98eb..aa077e2 100644 --- a/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll +++ b/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 true} +; RUN: opt < %s -instcombine -S | grep {ret i1 true} ; PR2993 define i1 @foo(i32 %x) { diff --git a/test/Transforms/InstCombine/2008-11-08-FCmp.ll b/test/Transforms/InstCombine/2008-11-08-FCmp.ll index c088f31..c636288 100644 --- a/test/Transforms/InstCombine/2008-11-08-FCmp.ll +++ b/test/Transforms/InstCombine/2008-11-08-FCmp.ll @@ -1,9 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t -; RUN: grep {icmp eq} %t -; RUN: grep {ret i1 false} %t | count 2 -; RUN: grep {ret i1 true} %t | count 2 -; RUN: grep {icmp ne} %t -; RUN: not grep {icmp slt} %t +; RUN: opt < %s -instcombine -S | FileCheck %s ; PR3021 ; When inst combining an FCMP with the LHS coming from a uitofp instruction, we @@ -12,6 +7,7 @@ define i1 @test1(i32 %val) { %1 = uitofp i32 %val to double %2 = fcmp ole double %1, 0.000000e+00 +; CHECK: icmp eq i32 %val, 0 ret i1 %2 } @@ -19,17 +15,20 @@ define i1 @test2(i32 %val) { %1 = uitofp i32 %val to double %2 = fcmp olt double %1, 0.000000e+00 ret i1 %2 +; CHECK: ret i1 false } define i1 @test3(i32 %val) { %1 = uitofp i32 %val to double %2 = fcmp oge double %1, 0.000000e+00 ret i1 %2 +; CHECK: ret i1 true } define i1 @test4(i32 %val) { %1 = uitofp i32 %val to double %2 = fcmp ogt double %1, 0.000000e+00 +; CHECK: icmp ne i32 %val, 0 ret i1 %2 } @@ -37,10 +36,12 @@ define i1 @test5(i32 %val) { %1 = uitofp i32 %val to double %2 = fcmp ogt double %1, -4.400000e+00 ret i1 %2 +; CHECK: ret i1 true } define i1 @test6(i32 %val) { %1 = uitofp i32 %val to double %2 = fcmp olt double %1, -4.400000e+00 ret i1 %2 +; CHECK: ret i1 false } diff --git a/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll b/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll index 8c58a2a..b2774d6 100644 --- a/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll +++ b/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t ; RUN: grep urem %t | count 3 ; RUN: grep srem %t | count 1 ; RUN: grep sub %t | count 2 diff --git a/test/Transforms/InstCombine/2008-11-27-IDivVector.ll b/test/Transforms/InstCombine/2008-11-27-IDivVector.ll index 4275e11..318a80c 100644 --- a/test/Transforms/InstCombine/2008-11-27-IDivVector.ll +++ b/test/Transforms/InstCombine/2008-11-27-IDivVector.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div +; RUN: opt < %s -instcombine -S | not grep div define <2 x i8> @f(<2 x i8> %x) { %A = udiv <2 x i8> %x, <i8 1, i8 1> diff --git a/test/Transforms/InstCombine/2008-11-27-MultiplyIntVec.ll b/test/Transforms/InstCombine/2008-11-27-MultiplyIntVec.ll index 544e9ab..d8c53fa 100644 --- a/test/Transforms/InstCombine/2008-11-27-MultiplyIntVec.ll +++ b/test/Transforms/InstCombine/2008-11-27-MultiplyIntVec.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; RUN: opt < %s -instcombine -S | not grep mul define <2 x i8> @f(<2 x i8> %x) { %A = mul <2 x i8> %x, <i8 1, i8 1> diff --git a/test/Transforms/InstCombine/2008-11-27-UDivNegative.ll b/test/Transforms/InstCombine/2008-11-27-UDivNegative.ll index 6a6b5f3..fc90bba 100644 --- a/test/Transforms/InstCombine/2008-11-27-UDivNegative.ll +++ b/test/Transforms/InstCombine/2008-11-27-UDivNegative.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div +; RUN: opt < %s -instcombine -S | not grep div define i8 @test(i8 %x) readnone nounwind { %A = udiv i8 %x, 250 diff --git a/test/Transforms/InstCombine/2008-12-17-SRemNegConstVec.ll b/test/Transforms/InstCombine/2008-12-17-SRemNegConstVec.ll index f970b96..e4c7ebc 100644 --- a/test/Transforms/InstCombine/2008-12-17-SRemNegConstVec.ll +++ b/test/Transforms/InstCombine/2008-12-17-SRemNegConstVec.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {i8 2, i8 2} +; RUN: opt < %s -instcombine -S | grep {i8 2, i8 2} ; PR2756 define <2 x i8> @foo(<2 x i8> %x) { diff --git a/test/Transforms/InstCombine/2009-01-05-i128-crash.ll b/test/Transforms/InstCombine/2009-01-05-i128-crash.ll index df3a760..d355e0a 100644 --- a/test/Transforms/InstCombine/2009-01-05-i128-crash.ll +++ b/test/Transforms/InstCombine/2009-01-05-i128-crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis ; PR3235 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" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll b/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll index 82b923a..a61a94e 100644 --- a/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll +++ b/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t ; RUN: grep {, align 4} %t | count 3 ; RUN: grep {, align 8} %t | count 3 ; rdar://6480438 diff --git a/test/Transforms/InstCombine/2009-01-16-PointerAddrSpace.ll b/test/Transforms/InstCombine/2009-01-16-PointerAddrSpace.ll index e0a2610..ce62f35 100644 --- a/test/Transforms/InstCombine/2009-01-16-PointerAddrSpace.ll +++ b/test/Transforms/InstCombine/2009-01-16-PointerAddrSpace.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {store.*addrspace(1)} +; RUN: opt < %s -instcombine -S | grep {store.*addrspace(1)} ; PR3335 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" target triple = "i386-apple-darwin9.6" diff --git a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll index cc001f0..79a2f1f 100644 --- a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll +++ b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0x7FF8000000000000 | count 7 -; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0x7FF00000FFFFFFFF | count 5 -; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep {0\\.0} | count 3 -; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep {3\\.5} | count 1 +; RUN: opt < %s -simplifycfg -instcombine -S | grep 0x7FF8000000000000 | count 7 +; RUN: opt < %s -simplifycfg -instcombine -S | grep 0x7FF00000FFFFFFFF | count 5 +; RUN: opt < %s -simplifycfg -instcombine -S | grep {0\\.0} | count 3 +; RUN: opt < %s -simplifycfg -instcombine -S | grep {3\\.5} | count 1 ; ; ModuleID = 'apf.c' diff --git a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll index 9cdb425..6bc7ce3 100644 --- a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll +++ b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0x3FB99999A0000000 | count 2 -; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0xBFB99999A0000000 | count 2 +; RUN: opt < %s -simplifycfg -instcombine -S | grep 0x3FB99999A0000000 | count 2 +; RUN: opt < %s -simplifycfg -instcombine -S | grep 0xBFB99999A0000000 | count 2 ; check constant folding for 'frem'. PR 3316. ; ModuleID = 'tt.c' diff --git a/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll b/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll index 313e76d..4b64b48 100644 --- a/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll +++ b/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine ; PR3381 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" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Transforms/InstCombine/2009-01-31-InfIterate.ll b/test/Transforms/InstCombine/2009-01-31-InfIterate.ll index 6620e4f..815c1a9 100644 --- a/test/Transforms/InstCombine/2009-01-31-InfIterate.ll +++ b/test/Transforms/InstCombine/2009-01-31-InfIterate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis ; PR3452 define i128 @test(i64 %A, i64 %B, i1 %C, i128 %Z, i128 %Y, i64* %P, i64* %Q) { entry: diff --git a/test/Transforms/InstCombine/2009-01-31-Pressure.ll b/test/Transforms/InstCombine/2009-01-31-Pressure.ll index 0c3066b..c3ee9a3 100644 --- a/test/Transforms/InstCombine/2009-01-31-Pressure.ll +++ b/test/Transforms/InstCombine/2009-01-31-Pressure.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {%B = add i8 %b, %x} +; RUN: opt < %s -instcombine -S | grep {%B = add i8 %b, %x} ; PR2698 declare void @use1(i1) diff --git a/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll b/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll index b08c962..bc6a204 100644 --- a/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll +++ b/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine ; PR3468 define x86_fp80 @cast() { diff --git a/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll b/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll index 52bcead..b29d8d2 100644 --- a/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll +++ b/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -scalarrepl | llvm-dis | not grep { = alloca} +; RUN: opt < %s -instcombine -scalarrepl -S | not grep { = alloca} ; rdar://6417724 ; Instcombine shouldn't do anything to this function that prevents promoting the allocas inside it. diff --git a/test/Transforms/InstCombine/2009-02-21-LoadCST.ll b/test/Transforms/InstCombine/2009-02-21-LoadCST.ll index 2c126df..f56fc38 100644 --- a/test/Transforms/InstCombine/2009-02-21-LoadCST.ll +++ b/test/Transforms/InstCombine/2009-02-21-LoadCST.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 3679669} +; RUN: opt < %s -instcombine -S | grep {ret i32 3679669} ; PR3595 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" diff --git a/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll b/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll index c59c5ed..a8349f0 100644 --- a/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll +++ b/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis ; PR3667 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" target triple = "i386-pc-linux-gnu" diff --git a/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll b/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll index ae690cf..c617ca4 100644 --- a/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll +++ b/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis ; PR3826 define void @0(<4 x i16>*, <4 x i16>*) { diff --git a/test/Transforms/InstCombine/2009-03-20-AShrOverShift.ll b/test/Transforms/InstCombine/2009-03-20-AShrOverShift.ll index 92ace11..0a07bf3 100644 --- a/test/Transforms/InstCombine/2009-03-20-AShrOverShift.ll +++ b/test/Transforms/InstCombine/2009-03-20-AShrOverShift.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ashr i32 %val, 31} +; RUN: opt < %s -instcombine -S | grep {ashr i32 %val, 31} ; PR3851 define i32 @foo2(i32 %val) nounwind { diff --git a/test/Transforms/InstCombine/2009-03-24-InfLoop.ll b/test/Transforms/InstCombine/2009-03-24-InfLoop.ll index 6d5a7bf..4ce04a1 100644 --- a/test/Transforms/InstCombine/2009-03-24-InfLoop.ll +++ b/test/Transforms/InstCombine/2009-03-24-InfLoop.ll @@ -1,5 +1,5 @@ ; PR3874 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis define i1 @test(i32 %x) { %A = lshr i32 3968, %x %B = and i32 %A, 1 diff --git a/test/Transforms/InstCombine/2009-04-07-MulPromoteToI96.ll b/test/Transforms/InstCombine/2009-04-07-MulPromoteToI96.ll index 82f8762..244b22a 100644 --- a/test/Transforms/InstCombine/2009-04-07-MulPromoteToI96.ll +++ b/test/Transforms/InstCombine/2009-04-07-MulPromoteToI96.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {mul i64} +; RUN: opt < %s -instcombine -S | grep {mul i64} ; rdar://6762288 ; Instcombine should not promote the mul to i96 because it is definitely diff --git a/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll b/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll index 1eda7df..dd14c6b 100644 --- a/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll +++ b/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep cmp +; RUN: opt < %s -instcombine -S | not grep cmp ; rdar://6903175 define i1 @f0(i32 *%a) nounwind { diff --git a/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll b/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll index ffb55a7..e5355b8 100644 --- a/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll +++ b/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {store i32 0,} +; RUN: opt < %s -instcombine -S | grep {store i32 0,} ; PR4366 define void @a() { diff --git a/test/Transforms/InstCombine/2009-06-16-SRemDemandedBits.ll b/test/Transforms/InstCombine/2009-06-16-SRemDemandedBits.ll index 82b223a..6beedf8 100644 --- a/test/Transforms/InstCombine/2009-06-16-SRemDemandedBits.ll +++ b/test/Transforms/InstCombine/2009-06-16-SRemDemandedBits.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep srem +; RUN: opt < %s -instcombine -S | grep srem ; PR3439 define i32 @a(i32 %x) nounwind { diff --git a/test/Transforms/InstCombine/2009-07-02-MaskedIntVector.ll b/test/Transforms/InstCombine/2009-07-02-MaskedIntVector.ll index 7505de1..41940fe 100644 --- a/test/Transforms/InstCombine/2009-07-02-MaskedIntVector.ll +++ b/test/Transforms/InstCombine/2009-07-02-MaskedIntVector.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis ; PR4495 define i32 @test(i64 %test) { diff --git a/test/Transforms/InstCombine/CPP_min_max.ll b/test/Transforms/InstCombine/CPP_min_max.ll index 785b91e..531ce2b 100644 --- a/test/Transforms/InstCombine/CPP_min_max.ll +++ b/test/Transforms/InstCombine/CPP_min_max.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep select | not grep {i32\\*} ; This testcase corresponds to PR362, which notices that this horrible code diff --git a/test/Transforms/InstCombine/IntPtrCast.ll b/test/Transforms/InstCombine/IntPtrCast.ll index e24d199..4ecbccd 100644 --- a/test/Transforms/InstCombine/IntPtrCast.ll +++ b/test/Transforms/InstCombine/IntPtrCast.ll @@ -1,9 +1,10 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32" define i32* @test(i32* %P) { %V = ptrtoint i32* %P to i32 ; <i32> [#uses=1] %P2 = inttoptr i32 %V to i32* ; <i32*> [#uses=1] ret i32* %P2 +; CHECK: ret i32* %P } diff --git a/test/Transforms/InstCombine/JavaCompare.ll b/test/Transforms/InstCombine/JavaCompare.ll index 72cab42..7d0edb8 100644 --- a/test/Transforms/InstCombine/JavaCompare.ll +++ b/test/Transforms/InstCombine/JavaCompare.ll @@ -1,7 +1,7 @@ ; This is the sequence of stuff that the Java front-end expands for a single ; <= comparison. Check to make sure we turn it into a <= (only) -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {%c3 = icmp sle i32 %A, %B} +; RUN: opt < %s -instcombine -S | grep {%c3 = icmp sle i32 %A, %B} define i1 @le(i32 %A, i32 %B) { %c1 = icmp sgt i32 %A, %B ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/add-shrink.ll b/test/Transforms/InstCombine/add-shrink.ll index 6dc02f3..52b8e32 100644 --- a/test/Transforms/InstCombine/add-shrink.ll +++ b/test/Transforms/InstCombine/add-shrink.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i32} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sext | count 1 +; RUN: opt < %s -instcombine -S | grep {add i32} +; RUN: opt < %s -instcombine -S | grep sext | count 1 ; Should only have one sext and the add should be i32 instead of i64. diff --git a/test/Transforms/InstCombine/add-sitofp.ll b/test/Transforms/InstCombine/add-sitofp.ll index 298b9a1..24319df 100644 --- a/test/Transforms/InstCombine/add-sitofp.ll +++ b/test/Transforms/InstCombine/add-sitofp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i32} +; RUN: opt < %s -instcombine -S | grep {add i32} define double @x(i32 %a, i32 %b) nounwind { %m = lshr i32 %a, 24 diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll index 6ff2187..4719809 100644 --- a/test/Transforms/InstCombine/add.ll +++ b/test/Transforms/InstCombine/add.ll @@ -1,6 +1,6 @@ ; This test makes sure that add instructions are properly eliminated. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v OK | not grep add define i32 @test1(i32 %A) { diff --git a/test/Transforms/InstCombine/add2.ll b/test/Transforms/InstCombine/add2.ll index 161d56b..1cbdd3a 100644 --- a/test/Transforms/InstCombine/add2.ll +++ b/test/Transforms/InstCombine/add2.ll @@ -1,9 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ -; RUN: grep -v OK | not grep add - -;; Target triple for gep raising case below. -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" -target triple = "i686-apple-darwin8" +; RUN: opt < %s -instcombine -S | not grep add define i64 @test1(i64 %A, i32 %B) { %tmp12 = zext i32 %B to i64 @@ -13,23 +8,6 @@ define i64 @test1(i64 %A, i32 %B) { ret i64 %tmp6 } -; PR1795 -define void @test2(i32 %.val24) { -EntryBlock: - add i32 %.val24, -12 - inttoptr i32 %0 to i32* - store i32 1, i32* %1 - add i32 %.val24, -16 - inttoptr i32 %2 to i32* - getelementptr i32* %3, i32 1 - load i32* %4 - tail call i32 @callee( i32 %5 ) - ret void -} - -declare i32 @callee(i32) - - define i32 @test3(i32 %A) { %B = and i32 %A, 7 %C = and i32 %A, 32 diff --git a/test/Transforms/InstCombine/add3.ll b/test/Transforms/InstCombine/add3.ll new file mode 100644 index 0000000..cde3e24 --- /dev/null +++ b/test/Transforms/InstCombine/add3.ll @@ -0,0 +1,21 @@ +; RUN: opt < %s -instcombine -S | grep inttoptr | count 2 + +;; Target triple for gep raising case below. +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" +target triple = "i686-apple-darwin8" + +; PR1795 +define void @test2(i32 %.val24) { +EntryBlock: + add i32 %.val24, -12 + inttoptr i32 %0 to i32* + store i32 1, i32* %1 + add i32 %.val24, -16 + inttoptr i32 %2 to i32* + getelementptr i32* %3, i32 1 + load i32* %4 + tail call i32 @callee( i32 %5 ) + ret void +} + +declare i32 @callee(i32) diff --git a/test/Transforms/InstCombine/addnegneg.ll b/test/Transforms/InstCombine/addnegneg.ll index f3b9565..a3a09f2 100644 --- a/test/Transforms/InstCombine/addnegneg.ll +++ b/test/Transforms/InstCombine/addnegneg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep { sub } | count 1 +; RUN: opt < %s -instcombine -S | grep { sub } | count 1 ; PR2047 define i32 @l(i32 %a, i32 %b, i32 %c, i32 %d) { diff --git a/test/Transforms/InstCombine/adjust-for-sminmax.ll b/test/Transforms/InstCombine/adjust-for-sminmax.ll index 9328ad3..b9b6f70 100644 --- a/test/Transforms/InstCombine/adjust-for-sminmax.ll +++ b/test/Transforms/InstCombine/adjust-for-sminmax.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp s\[lg\]t i32 %n, 0} | count 16 +; RUN: opt < %s -instcombine -S | grep {icmp s\[lg\]t i32 %n, 0} | count 16 ; Instcombine should recognize that this code can be adjusted ; to fit the canonical smax/smin pattern. diff --git a/test/Transforms/InstCombine/align-2d-gep.ll b/test/Transforms/InstCombine/align-2d-gep.ll index c826e31..80aacbc 100644 --- a/test/Transforms/InstCombine/align-2d-gep.ll +++ b/test/Transforms/InstCombine/align-2d-gep.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 16} | count 1 +; RUN: opt < %s -instcombine -S | grep {align 16} | count 1 ; A multi-dimensional array in a nested loop doing vector stores that ; aren't yet aligned. Instcombine can understand the addressing in the diff --git a/test/Transforms/InstCombine/align-addr.ll b/test/Transforms/InstCombine/align-addr.ll index a05c513..4253937 100644 --- a/test/Transforms/InstCombine/align-addr.ll +++ b/test/Transforms/InstCombine/align-addr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 16} | count 1 +; RUN: opt < %s -instcombine -S | grep {align 16} | count 1 ; Instcombine should be able to prove vector alignment in the ; presence of a few mild address computation tricks. diff --git a/test/Transforms/InstCombine/align-external.ll b/test/Transforms/InstCombine/align-external.ll new file mode 100644 index 0000000..6e8ad87 --- /dev/null +++ b/test/Transforms/InstCombine/align-external.ll @@ -0,0 +1,22 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +; Don't assume that external global variables have their preferred +; alignment. They may only have the ABI minimum alignment. + +; CHECK: %s = shl i64 %a, 3 +; CHECK: %r = or i64 %s, ptrtoint (i32* @A to i64) +; CHECK: %q = add i64 %r, 1 +; CHECK: ret i64 %q + +target datalayout = "-i32:8:32" + +@A = external global i32 +@B = external global i32 + +define i64 @foo(i64 %a) { + %t = ptrtoint i32* @A to i64 + %s = shl i64 %a, 3 + %r = or i64 %t, %s + %q = add i64 %r, 1 + ret i64 %q +} diff --git a/test/Transforms/InstCombine/align-inc.ll b/test/Transforms/InstCombine/align-inc.ll index 104d991..0260ca2 100644 --- a/test/Transforms/InstCombine/align-inc.ll +++ b/test/Transforms/InstCombine/align-inc.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {GLOBAL.*align 16} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {tmp = load} +; RUN: opt < %s -instcombine -S | grep {GLOBAL.*align 16} +; RUN: opt < %s -instcombine -S | grep {tmp = load} @GLOBAL = internal global [4 x i32] zeroinitializer diff --git a/test/Transforms/InstCombine/alloca.ll b/test/Transforms/InstCombine/alloca.ll index 95d0f09..13d664d 100644 --- a/test/Transforms/InstCombine/alloca.ll +++ b/test/Transforms/InstCombine/alloca.ll @@ -1,6 +1,6 @@ ; Zero byte allocas should be deleted. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep alloca ; END. diff --git a/test/Transforms/InstCombine/and-compare.ll b/test/Transforms/InstCombine/and-compare.ll index d2f2753..c30a245 100644 --- a/test/Transforms/InstCombine/and-compare.ll +++ b/test/Transforms/InstCombine/and-compare.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep and | count 1 ; Should be optimized to one and. diff --git a/test/Transforms/InstCombine/and-fcmp.ll b/test/Transforms/InstCombine/and-fcmp.ll index 55efffa..91868d1 100644 --- a/test/Transforms/InstCombine/and-fcmp.ll +++ b/test/Transforms/InstCombine/and-fcmp.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep fcmp | count 3 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret | grep 0 +; RUN: opt < %s -instcombine -S | grep fcmp | count 3 +; RUN: opt < %s -instcombine -S | grep ret | grep 0 define zeroext i8 @t1(float %x, float %y) nounwind { %a = fcmp ueq float %x, %y diff --git a/test/Transforms/InstCombine/and-not-or.ll b/test/Transforms/InstCombine/and-not-or.ll index 9e9f397..9dce7b4 100644 --- a/test/Transforms/InstCombine/and-not-or.ll +++ b/test/Transforms/InstCombine/and-not-or.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {and i32 %x, %y} | count 4 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {or} +; RUN: opt < %s -instcombine -S | grep {and i32 %x, %y} | count 4 +; RUN: opt < %s -instcombine -S | not grep {or} define i32 @func1(i32 %x, i32 %y) nounwind { entry: diff --git a/test/Transforms/InstCombine/and-or-and.ll b/test/Transforms/InstCombine/and-or-and.ll index 04d475c..216cd46 100644 --- a/test/Transforms/InstCombine/and-or-and.ll +++ b/test/Transforms/InstCombine/and-or-and.ll @@ -9,7 +9,7 @@ ; ; Which corresponds to test1. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {or } define i32 @test1(i32 %X, i32 %Y) { diff --git a/test/Transforms/InstCombine/and-or-not.ll b/test/Transforms/InstCombine/and-or-not.ll index 8fc53a7..37ec3bc 100644 --- a/test/Transforms/InstCombine/and-or-not.ll +++ b/test/Transforms/InstCombine/and-or-not.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 4 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep { or} +; RUN: opt < %s -instcombine -S | grep xor | count 4 +; RUN: opt < %s -instcombine -S | not grep and +; RUN: opt < %s -instcombine -S | not grep { or} ; PR1510 diff --git a/test/Transforms/InstCombine/and-or.ll b/test/Transforms/InstCombine/and-or.ll index 38ad842..b4224b3 100644 --- a/test/Transforms/InstCombine/and-or.ll +++ b/test/Transforms/InstCombine/and-or.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {and i32 %a, 1} | count 4 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {or i32 %0, %b} | count 4 +; RUN: opt < %s -instcombine -S | grep {and i32 %a, 1} | count 4 +; RUN: opt < %s -instcombine -S | grep {or i32 %0, %b} | count 4 define i32 @func1(i32 %a, i32 %b) nounwind readnone { diff --git a/test/Transforms/InstCombine/and-xor-merge.ll b/test/Transforms/InstCombine/and-xor-merge.ll index 85f8026..e432a9a 100644 --- a/test/Transforms/InstCombine/and-xor-merge.ll +++ b/test/Transforms/InstCombine/and-xor-merge.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 1 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 2 +; RUN: opt < %s -instcombine -S | grep and | count 1 +; RUN: opt < %s -instcombine -S | grep xor | count 2 ; (x&z) ^ (y&z) -> (x^y)&z define i32 @test1(i32 %x, i32 %y, i32 %z) { diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll index edab47e..8492df9 100644 --- a/test/Transforms/InstCombine/and.ll +++ b/test/Transforms/InstCombine/and.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and +; RUN: opt < %s -instcombine -S | not grep and define i32 @test1(i32 %A) { ; zero result diff --git a/test/Transforms/InstCombine/and2.ll b/test/Transforms/InstCombine/and2.ll index 3b80d94..0af9bfa 100644 --- a/test/Transforms/InstCombine/and2.ll +++ b/test/Transforms/InstCombine/and2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and +; RUN: opt < %s -instcombine -S | not grep and ; PR1738 diff --git a/test/Transforms/InstCombine/apint-add1.ll b/test/Transforms/InstCombine/apint-add1.ll index 74280ee..02f1baf 100644 --- a/test/Transforms/InstCombine/apint-add1.ll +++ b/test/Transforms/InstCombine/apint-add1.ll @@ -1,7 +1,7 @@ ; This test makes sure that add instructions are properly eliminated. ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v OK | not grep add diff --git a/test/Transforms/InstCombine/apint-add2.ll b/test/Transforms/InstCombine/apint-add2.ll index 0ddfcc0..913a70f 100644 --- a/test/Transforms/InstCombine/apint-add2.ll +++ b/test/Transforms/InstCombine/apint-add2.ll @@ -1,7 +1,7 @@ ; This test makes sure that add instructions are properly eliminated. ; This test is for Integer BitWidth > 64 && BitWidth <= 1024. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v OK | not grep add ; END. diff --git a/test/Transforms/InstCombine/apint-and-compare.ll b/test/Transforms/InstCombine/apint-and-compare.ll index ad2e41d..53e591e 100644 --- a/test/Transforms/InstCombine/apint-and-compare.ll +++ b/test/Transforms/InstCombine/apint-and-compare.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 2 +; RUN: opt < %s -instcombine -S | grep and | count 2 ; Should be optimized to one and. define i1 @test1(i33 %a, i33 %b) { diff --git a/test/Transforms/InstCombine/apint-and-or-and.ll b/test/Transforms/InstCombine/apint-and-or-and.ll index 4630f28..17d29b6 100644 --- a/test/Transforms/InstCombine/apint-and-or-and.ll +++ b/test/Transforms/InstCombine/apint-and-or-and.ll @@ -11,7 +11,7 @@ ; ; This tests arbitrary precision integers. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {or } +; RUN: opt < %s -instcombine -S | not grep {or } ; END. define i17 @test1(i17 %X, i17 %Y) { diff --git a/test/Transforms/InstCombine/apint-and-xor-merge.ll b/test/Transforms/InstCombine/apint-and-xor-merge.ll index e1e4e3c..8adffde 100644 --- a/test/Transforms/InstCombine/apint-and-xor-merge.ll +++ b/test/Transforms/InstCombine/apint-and-xor-merge.ll @@ -1,8 +1,8 @@ ; This test case checks that the merge of and/xor can work on arbitrary ; precision integers. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 1 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 2 +; RUN: opt < %s -instcombine -S | grep and | count 1 +; RUN: opt < %s -instcombine -S | grep xor | count 2 ; (x &z ) ^ (y & z) -> (x ^ y) & z define i57 @test1(i57 %x, i57 %y, i57 %z) { diff --git a/test/Transforms/InstCombine/apint-and1.ll b/test/Transforms/InstCombine/apint-and1.ll index eb3b1a6..cd4cbb9 100644 --- a/test/Transforms/InstCombine/apint-and1.ll +++ b/test/Transforms/InstCombine/apint-and1.ll @@ -1,7 +1,7 @@ ; This test makes sure that and instructions are properly eliminated. ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and } +; RUN: opt < %s -instcombine -S | not grep {and } ; END. define i39 @test0(i39 %A) { diff --git a/test/Transforms/InstCombine/apint-and2.ll b/test/Transforms/InstCombine/apint-and2.ll index f7b3934..ae74472 100644 --- a/test/Transforms/InstCombine/apint-and2.ll +++ b/test/Transforms/InstCombine/apint-and2.ll @@ -1,7 +1,7 @@ ; This test makes sure that and instructions are properly eliminated. ; This test is for Integer BitWidth > 64 && BitWidth <= 1024. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and } +; RUN: opt < %s -instcombine -S | not grep {and } ; END. diff --git a/test/Transforms/InstCombine/apint-call-cast-target.ll b/test/Transforms/InstCombine/apint-call-cast-target.ll index 3688fbe1..fe336de 100644 --- a/test/Transforms/InstCombine/apint-call-cast-target.ll +++ b/test/Transforms/InstCombine/apint-call-cast-target.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep call | not grep bitcast +; RUN: opt < %s -instcombine -S | grep call | not grep bitcast target datalayout = "e-p:32:32" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/InstCombine/apint-cast-and-cast.ll b/test/Transforms/InstCombine/apint-cast-and-cast.ll index 337fd7c..251d78f 100644 --- a/test/Transforms/InstCombine/apint-cast-and-cast.ll +++ b/test/Transforms/InstCombine/apint-cast-and-cast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast +; RUN: opt < %s -instcombine -S | not grep bitcast define i19 @test1(i43 %val) { %t1 = bitcast i43 %val to i43 diff --git a/test/Transforms/InstCombine/apint-cast-cast-to-and.ll b/test/Transforms/InstCombine/apint-cast-cast-to-and.ll index 29a8869..b2069a9 100644 --- a/test/Transforms/InstCombine/apint-cast-cast-to-and.ll +++ b/test/Transforms/InstCombine/apint-cast-cast-to-and.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep i41 +; RUN: opt < %s -instcombine -S | not grep i41 define i61 @test1(i61 %X) { %Y = trunc i61 %X to i41 ;; Turn i61o an AND diff --git a/test/Transforms/InstCombine/apint-cast.ll b/test/Transforms/InstCombine/apint-cast.ll index dd00146..9bc539e 100644 --- a/test/Transforms/InstCombine/apint-cast.ll +++ b/test/Transforms/InstCombine/apint-cast.ll @@ -1,20 +1,28 @@ ; Tests to make sure elimination of casts is working correctly -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s define i17 @test1(i17 %a) { %tmp = zext i17 %a to i37 ; <i37> [#uses=2] %tmp21 = lshr i37 %tmp, 8 ; <i37> [#uses=1] +; CHECK: %tmp21 = lshr i17 %a, 8 %tmp5 = shl i37 %tmp, 8 ; <i37> [#uses=1] +; CHECK: %tmp5 = shl i17 %a, 8 %tmp.upgrd.32 = or i37 %tmp21, %tmp5 ; <i37> [#uses=1] +; CHECK: %tmp.upgrd.32 = or i17 %tmp21, %tmp5 %tmp.upgrd.3 = trunc i37 %tmp.upgrd.32 to i17 ; <i17> [#uses=1] ret i17 %tmp.upgrd.3 +; CHECK: ret i17 %tmp.upgrd.32 } define i167 @test2(i167 %a) { %tmp = zext i167 %a to i577 ; <i577> [#uses=2] %tmp21 = lshr i577 %tmp, 9 ; <i577> [#uses=1] +; CHECK: %tmp21 = lshr i167 %a, 9 %tmp5 = shl i577 %tmp, 8 ; <i577> [#uses=1] +; CHECK: %tmp5 = shl i167 %a, 8 %tmp.upgrd.32 = or i577 %tmp21, %tmp5 ; <i577> [#uses=1] +; CHECK: %tmp.upgrd.32 = or i167 %tmp21, %tmp5 %tmp.upgrd.3 = trunc i577 %tmp.upgrd.32 to i167 ; <i167> [#uses=1] ret i167 %tmp.upgrd.3 +; CHECK: ret i167 %tmp.upgrd.32 } diff --git a/test/Transforms/InstCombine/apint-div1.ll b/test/Transforms/InstCombine/apint-div1.ll index e9aa579..68aadac 100644 --- a/test/Transforms/InstCombine/apint-div1.ll +++ b/test/Transforms/InstCombine/apint-div1.ll @@ -1,7 +1,7 @@ ; This test makes sure that div instructions are properly eliminated. ; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div +; RUN: opt < %s -instcombine -S | not grep div define i33 @test1(i33 %X) { diff --git a/test/Transforms/InstCombine/apint-div2.ll b/test/Transforms/InstCombine/apint-div2.ll index 2aa2c3a..2d7ac78 100644 --- a/test/Transforms/InstCombine/apint-div2.ll +++ b/test/Transforms/InstCombine/apint-div2.ll @@ -1,7 +1,7 @@ ; This test makes sure that div instructions are properly eliminated. ; This test is for Integer BitWidth >= 64 && BitWidth <= 1024. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div +; RUN: opt < %s -instcombine -S | not grep div define i333 @test1(i333 %X) { diff --git a/test/Transforms/InstCombine/apint-elim-logicalops.ll b/test/Transforms/InstCombine/apint-elim-logicalops.ll index 13d032c..ec60e45 100644 --- a/test/Transforms/InstCombine/apint-elim-logicalops.ll +++ b/test/Transforms/InstCombine/apint-elim-logicalops.ll @@ -1,6 +1,6 @@ ; Test that elimination of logical operators works with ; arbitrary precision integers. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {(and\|xor\|add\|shl\|shr)} ; END. diff --git a/test/Transforms/InstCombine/apint-mul1.ll b/test/Transforms/InstCombine/apint-mul1.ll index 36b1102..6a5b3e7 100644 --- a/test/Transforms/InstCombine/apint-mul1.ll +++ b/test/Transforms/InstCombine/apint-mul1.ll @@ -2,7 +2,7 @@ ; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; RUN: opt < %s -instcombine -S | not grep mul define i17 @test1(i17 %X) { diff --git a/test/Transforms/InstCombine/apint-mul2.ll b/test/Transforms/InstCombine/apint-mul2.ll index 72fd97a..558d2fb 100644 --- a/test/Transforms/InstCombine/apint-mul2.ll +++ b/test/Transforms/InstCombine/apint-mul2.ll @@ -2,7 +2,7 @@ ; This test is for Integer BitWidth >= 64 && BitWidth % 2 >= 1024. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; RUN: opt < %s -instcombine -S | not grep mul define i177 @test1(i177 %X) { diff --git a/test/Transforms/InstCombine/apint-not.ll b/test/Transforms/InstCombine/apint-not.ll index f557fa8..488b7f2 100644 --- a/test/Transforms/InstCombine/apint-not.ll +++ b/test/Transforms/InstCombine/apint-not.ll @@ -1,7 +1,7 @@ ; This test makes sure that the xor instructions are properly eliminated ; when arbitrary precision integers are used. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep xor +; RUN: opt < %s -instcombine -S | not grep xor define i33 @test1(i33 %A) { %B = xor i33 %A, -1 diff --git a/test/Transforms/InstCombine/apint-or1.ll b/test/Transforms/InstCombine/apint-or1.ll index 51b87fe..d4f87ac 100644 --- a/test/Transforms/InstCombine/apint-or1.ll +++ b/test/Transforms/InstCombine/apint-or1.ll @@ -2,7 +2,7 @@ ; This test is for Integer BitWidth <= 64 && BitWidth % 2 != 0. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep or +; RUN: opt < %s -instcombine -S | not grep or define i7 @test0(i7 %X) { diff --git a/test/Transforms/InstCombine/apint-or2.ll b/test/Transforms/InstCombine/apint-or2.ll index 21dc565..d7de255 100644 --- a/test/Transforms/InstCombine/apint-or2.ll +++ b/test/Transforms/InstCombine/apint-or2.ll @@ -1,7 +1,7 @@ ; This test makes sure that or instructions are properly eliminated. ; This test is for Integer BitWidth > 64 && BitWidth <= 1024. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep or +; RUN: opt < %s -instcombine -S | not grep or define i777 @test0(i777 %X) { diff --git a/test/Transforms/InstCombine/apint-rem1.ll b/test/Transforms/InstCombine/apint-rem1.ll index 2ec8c74..030facc 100644 --- a/test/Transforms/InstCombine/apint-rem1.ll +++ b/test/Transforms/InstCombine/apint-rem1.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem +; RUN: opt < %s -instcombine -S | not grep rem define i33 @test1(i33 %A) { diff --git a/test/Transforms/InstCombine/apint-rem2.ll b/test/Transforms/InstCombine/apint-rem2.ll index 4d22c22..9bfc4cd 100644 --- a/test/Transforms/InstCombine/apint-rem2.ll +++ b/test/Transforms/InstCombine/apint-rem2.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; This test is for Integer BitWidth >= 64 && BitWidth <= 1024. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem +; RUN: opt < %s -instcombine -S | not grep rem define i333 @test1(i333 %A) { diff --git a/test/Transforms/InstCombine/apint-select.ll b/test/Transforms/InstCombine/apint-select.ll index c2399fb..f2ea601 100644 --- a/test/Transforms/InstCombine/apint-select.ll +++ b/test/Transforms/InstCombine/apint-select.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select +; RUN: opt < %s -instcombine -S | not grep select define i41 @test1(i1 %C) { diff --git a/test/Transforms/InstCombine/apint-shift-simplify.ll b/test/Transforms/InstCombine/apint-shift-simplify.ll index a0046fb..1a3340a 100644 --- a/test/Transforms/InstCombine/apint-shift-simplify.ll +++ b/test/Transforms/InstCombine/apint-shift-simplify.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: egrep {shl|lshr|ashr} | count 3 define i41 @test0(i41 %A, i41 %B, i41 %C) { diff --git a/test/Transforms/InstCombine/apint-shift.ll b/test/Transforms/InstCombine/apint-shift.ll index afc5360..6573b5b 100644 --- a/test/Transforms/InstCombine/apint-shift.ll +++ b/test/Transforms/InstCombine/apint-shift.ll @@ -1,6 +1,6 @@ ; This test makes sure that shit instructions are properly eliminated ; even with arbitrary precision integers. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sh +; RUN: opt < %s -instcombine -S | not grep sh ; END. define i47 @test1(i47 %A) { diff --git a/test/Transforms/InstCombine/apint-shl-trunc.ll b/test/Transforms/InstCombine/apint-shl-trunc.ll index a9cffde..8163e6d 100644 --- a/test/Transforms/InstCombine/apint-shl-trunc.ll +++ b/test/Transforms/InstCombine/apint-shl-trunc.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shl +; RUN: opt < %s -instcombine -S | grep shl ; END. define i1 @test0(i39 %X, i39 %A) { diff --git a/test/Transforms/InstCombine/apint-sub.ll b/test/Transforms/InstCombine/apint-sub.ll index 2ff763c..8b9ff14 100644 --- a/test/Transforms/InstCombine/apint-sub.ll +++ b/test/Transforms/InstCombine/apint-sub.ll @@ -2,7 +2,7 @@ ; even with arbitrary precision integers. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v {sub i19 %Cok, %Bok} | grep -v {sub i25 0, %Aok} | not grep sub ; END. diff --git a/test/Transforms/InstCombine/apint-xor1.ll b/test/Transforms/InstCombine/apint-xor1.ll index 5ddf5cf..849c659 100644 --- a/test/Transforms/InstCombine/apint-xor1.ll +++ b/test/Transforms/InstCombine/apint-xor1.ll @@ -1,7 +1,7 @@ ; This test makes sure that xor instructions are properly eliminated. ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor } +; RUN: opt < %s -instcombine -S | not grep {xor } define i47 @test1(i47 %A, i47 %B) { diff --git a/test/Transforms/InstCombine/apint-xor2.ll b/test/Transforms/InstCombine/apint-xor2.ll index 4d2d415..cacc179 100644 --- a/test/Transforms/InstCombine/apint-xor2.ll +++ b/test/Transforms/InstCombine/apint-xor2.ll @@ -1,7 +1,7 @@ ; This test makes sure that xor instructions are properly eliminated. ; This test is for Integer BitWidth > 64 && BitWidth <= 1024. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor } +; RUN: opt < %s -instcombine -S | not grep {xor } ; END. diff --git a/test/Transforms/InstCombine/apint-zext1.ll b/test/Transforms/InstCombine/apint-zext1.ll index 03330c7..40de360 100644 --- a/test/Transforms/InstCombine/apint-zext1.ll +++ b/test/Transforms/InstCombine/apint-zext1.ll @@ -1,9 +1,11 @@ ; Tests to make sure elimination of casts is working correctly ; This test is for Integer BitWidth <= 64 && BitWidth % 2 != 0. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast {} {%c1.*} +; RUN: opt < %s -instcombine -S | FileCheck %s define i47 @test_sext_zext(i11 %A) { %c1 = zext i11 %A to i39 %c2 = sext i39 %c1 to i47 ret i47 %c2 +; CHECK: %c2 = zext i11 %A to i47 +; CHECK: ret i47 %c2 } diff --git a/test/Transforms/InstCombine/apint-zext2.ll b/test/Transforms/InstCombine/apint-zext2.ll index 8350d10..886dcf2 100644 --- a/test/Transforms/InstCombine/apint-zext2.ll +++ b/test/Transforms/InstCombine/apint-zext2.ll @@ -1,9 +1,11 @@ ; Tests to make sure elimination of casts is working correctly ; This test is for Integer BitWidth > 64 && BitWidth <= 1024. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast {} {%c1.*} +; RUN: opt < %s -instcombine -S | FileCheck %s define i1024 @test_sext_zext(i77 %A) { %c1 = zext i77 %A to i533 %c2 = sext i533 %c1 to i1024 ret i1024 %c2 +; CHECK: %c2 = zext i77 %A to i1024 +; CHECK: ret i1024 %c2 } diff --git a/test/Transforms/InstCombine/ashr-nop.ll b/test/Transforms/InstCombine/ashr-nop.ll index bb0da34..870ede3 100644 --- a/test/Transforms/InstCombine/ashr-nop.ll +++ b/test/Transforms/InstCombine/ashr-nop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ashr +; RUN: opt < %s -instcombine -S | not grep ashr define i32 @foo(i32 %x) { %o = and i32 %x, 1 diff --git a/test/Transforms/InstCombine/badmalloc.ll b/test/Transforms/InstCombine/badmalloc.ll new file mode 100644 index 0000000..cab23b5 --- /dev/null +++ b/test/Transforms/InstCombine/badmalloc.ll @@ -0,0 +1,19 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +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" +target triple = "x86_64-apple-darwin10.0" + +declare noalias i8* @malloc(i64) nounwind +declare void @free(i8*) + +; PR5130 +define i1 @test1() { + %A = call noalias i8* @malloc(i64 4) nounwind + %B = icmp eq i8* %A, null + + call void @free(i8* %A) + ret i1 %B + +; CHECK: @test1 +; CHECK: ret i1 %B +} diff --git a/test/Transforms/InstCombine/binop-cast.ll b/test/Transforms/InstCombine/binop-cast.ll index ea5299b..3dbca7e 100644 --- a/test/Transforms/InstCombine/binop-cast.ll +++ b/test/Transforms/InstCombine/binop-cast.ll @@ -1,7 +1,9 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @testAdd(i32 %X, i32 %Y) { %tmp = add i32 %X, %Y +; CHECK: %tmp = add i32 %X, %Y %tmp.l = bitcast i32 %tmp to i32 ret i32 %tmp.l +; CHECK: ret i32 %tmp } diff --git a/test/Transforms/InstCombine/bit-tracking.ll b/test/Transforms/InstCombine/bit-tracking.ll index d090c69..51bbc08 100644 --- a/test/Transforms/InstCombine/bit-tracking.ll +++ b/test/Transforms/InstCombine/bit-tracking.ll @@ -1,6 +1,6 @@ ; This file contains various testcases that require tracking whether bits are ; set or cleared by various instructions. -; RUN: llvm-as < %s | opt -instcombine -instcombine | llvm-dis |\ +; RUN: opt < %s -instcombine -instcombine -S |\ ; RUN: not grep %ELIM ; Reduce down to a single XOR diff --git a/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll b/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll index 8695d1e..4e9dfbb 100644 --- a/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll +++ b/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0} +; RUN: opt < %s -instcombine -S | grep {ret i32 0} ; PR4487 ; Bitcasts between vectors and scalars are valid, despite being ill-advised. diff --git a/test/Transforms/InstCombine/bitcast-vec-canon.ll b/test/Transforms/InstCombine/bitcast-vec-canon.ll new file mode 100644 index 0000000..d27765e --- /dev/null +++ b/test/Transforms/InstCombine/bitcast-vec-canon.ll @@ -0,0 +1,22 @@ +; RUN: opt < %s -instcombine -S | grep element | count 4 + +define double @a(<1 x i64> %y) { + %c = bitcast <1 x i64> %y to double + ret double %c +} + +define i64 @b(<1 x i64> %y) { + %c = bitcast <1 x i64> %y to i64 + ret i64 %c +} + +define <1 x i64> @c(double %y) { + %c = bitcast double %y to <1 x i64> + ret <1 x i64> %c +} + +define <1 x i64> @d(i64 %y) { + %c = bitcast i64 %y to <1 x i64> + ret <1 x i64> %c +} + diff --git a/test/Transforms/InstCombine/bitcast-vector-fold.ll b/test/Transforms/InstCombine/bitcast-vector-fold.ll index ded3e2f..8feec22 100644 --- a/test/Transforms/InstCombine/bitcast-vector-fold.ll +++ b/test/Transforms/InstCombine/bitcast-vector-fold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast +; RUN: opt < %s -instcombine -S | not grep bitcast 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/InstCombine/bitcount.ll b/test/Transforms/InstCombine/bitcount.ll index 8ebf289..f75ca2d 100644 --- a/test/Transforms/InstCombine/bitcount.ll +++ b/test/Transforms/InstCombine/bitcount.ll @@ -1,6 +1,6 @@ ; Tests to make sure bit counts of constants are folded -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 19} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | grep {ret i32 19} +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v declare | not grep llvm.ct declare i31 @llvm.ctpop.i31(i31 %val) diff --git a/test/Transforms/InstCombine/bittest.ll b/test/Transforms/InstCombine/bittest.ll index 8d45a48..92863d5 100644 --- a/test/Transforms/InstCombine/bittest.ll +++ b/test/Transforms/InstCombine/bittest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis |\ +; RUN: opt < %s -instcombine -simplifycfg -S |\ ; RUN: not grep {call void @abort} @b_rec.0 = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/InstCombine/bswap-fold.ll b/test/Transforms/InstCombine/bswap-fold.ll index 87d8b04..3e56951 100644 --- a/test/Transforms/InstCombine/bswap-fold.ll +++ b/test/Transforms/InstCombine/bswap-fold.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret | count 6 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep call.*bswap +; RUN: opt < %s -instcombine -S | grep ret | count 6 +; RUN: opt < %s -instcombine -S | not grep call.*bswap define i1 @test1(i16 %tmp2) { %tmp10 = call i16 @llvm.bswap.i16( i16 %tmp2 ) ; <i16> [#uses=1] diff --git a/test/Transforms/InstCombine/bswap.ll b/test/Transforms/InstCombine/bswap.ll index 2ba718e..c5aa8be 100644 --- a/test/Transforms/InstCombine/bswap.ll +++ b/test/Transforms/InstCombine/bswap.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {call.*llvm.bswap} | count 6 define i32 @test1(i32 %i) { diff --git a/test/Transforms/InstCombine/call-cast-target.ll b/test/Transforms/InstCombine/call-cast-target.ll index 1a02514..7addc8a 100644 --- a/test/Transforms/InstCombine/call-cast-target.ll +++ b/test/Transforms/InstCombine/call-cast-target.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep call | not grep bitcast target datalayout = "e-p:32:32" diff --git a/test/Transforms/InstCombine/call-intrinsics.ll b/test/Transforms/InstCombine/call-intrinsics.ll index e1c6057..f9d1080 100644 --- a/test/Transforms/InstCombine/call-intrinsics.ll +++ b/test/Transforms/InstCombine/call-intrinsics.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis @X = global i8 0 ; <i8*> [#uses=3] @Y = global i8 12 ; <i8*> [#uses=2] diff --git a/test/Transforms/InstCombine/call.ll b/test/Transforms/InstCombine/call.ll index df9b2a6..1e37eec 100644 --- a/test/Transforms/InstCombine/call.ll +++ b/test/Transforms/InstCombine/call.ll @@ -1,7 +1,5 @@ ; Ignore stderr, we expect warnings there -; RUN: llvm-as < %s 2> /dev/null | opt -instcombine | llvm-dis | \ -; RUN: grep call | notcast -; END. +; RUN: opt < %s -instcombine 2> /dev/null -S | FileCheck %s ; Simple case, argument translatable without changing the value @@ -10,17 +8,24 @@ declare void @test1a(i8*) define void @test1(i32* %A) { call void bitcast (void (i8*)* @test1a to void (i32*)*)( i32* %A ) ret void +; CHECK: %tmp = bitcast i32* %A to i8* +; CHECK: call void @test1a(i8* %tmp) +; CHECK: ret void } ; More complex case, translate argument because of resolution. This is safe ; because we have the body of the function define void @test2a(i8 %A) { ret void +; CHECK: ret void } define i32 @test2(i32 %A) { call void bitcast (void (i8)* @test2a to void (i32)*)( i32 %A ) ret i32 %A +; CHECK: %tmp = trunc i32 %A to i8 +; CHECK: call void @test2a(i8 %tmp) +; CHECK: ret i32 %A } @@ -32,17 +37,24 @@ define void @test3(i8 %A, i8 %B) { call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B ) ret void +; CHECK: %tmp = zext i8 %B to i32 +; CHECK: call void (i8, ...)* @test3a(i8 %A, i32 %tmp) +; CHECK: ret void } ; test conversion of return value... define i8 @test4a() { ret i8 0 +; CHECK: ret i8 0 } define i32 @test4() { %X = call i32 bitcast (i8 ()* @test4a to i32 ()*)( ) ; <i32> [#uses=1] ret i32 %X +; CHECK: %X1 = call i8 @test4a() +; CHECK: %tmp = zext i8 %X1 to i32 +; CHECK: ret i32 %tmp } @@ -53,6 +65,8 @@ declare i32 @test5a() define i32 @test5() { %X = call i32 @test5a( ) ; <i32> [#uses=1] ret i32 %X +; CHECK: %X = call i32 @test5a() +; CHECK: ret i32 %X } @@ -62,17 +76,22 @@ declare i32 @test6a(i32) define i32 @test6() { %X = call i32 bitcast (i32 (i32)* @test6a to i32 ()*)( ) ; <i32> [#uses=1] ret i32 %X +; CHECK: %X1 = call i32 @test6a(i32 0) +; CHECK: ret i32 %X1 } ; test removal of arguments, only can happen with a function body define void @test7a() { ret void +; CHECK: ret void } define void @test7() { call void bitcast (void ()* @test7a to void (i32)*)( i32 5 ) ret void +; CHECK: call void @test7a() +; CHECK: ret void } diff --git a/test/Transforms/InstCombine/call2.ll b/test/Transforms/InstCombine/call2.ll index 4ba840f..3a6bd67 100644 --- a/test/Transforms/InstCombine/call2.ll +++ b/test/Transforms/InstCombine/call2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis ; This used to crash trying to do a double-to-pointer conversion define i32 @bar() { diff --git a/test/Transforms/InstCombine/canonicalize_branch.ll b/test/Transforms/InstCombine/canonicalize_branch.ll index 79f02e7..52aff3d 100644 --- a/test/Transforms/InstCombine/canonicalize_branch.ll +++ b/test/Transforms/InstCombine/canonicalize_branch.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {icmp ne\|icmp ule\|icmp uge} define i32 @test1(i32 %X, i32 %Y) { diff --git a/test/Transforms/InstCombine/cast-and-cast.ll b/test/Transforms/InstCombine/cast-and-cast.ll index f90cb74..eda9d99 100644 --- a/test/Transforms/InstCombine/cast-and-cast.ll +++ b/test/Transforms/InstCombine/cast-and-cast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep bitcast define i1 @test1(i32 %val) { diff --git a/test/Transforms/InstCombine/cast-cast-to-and.ll b/test/Transforms/InstCombine/cast-cast-to-and.ll index bb7c3dd..1e591cc 100644 --- a/test/Transforms/InstCombine/cast-cast-to-and.ll +++ b/test/Transforms/InstCombine/cast-cast-to-and.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep i8 define i32 @test1(i32 %X) { diff --git a/test/Transforms/InstCombine/cast-load-gep.ll b/test/Transforms/InstCombine/cast-load-gep.ll index bc2c7b3..57f021c 100644 --- a/test/Transforms/InstCombine/cast-load-gep.ll +++ b/test/Transforms/InstCombine/cast-load-gep.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -globaldce | llvm-dis | \ +; RUN: opt < %s -instcombine -globaldce -S | \ ; RUN: not grep Array ; Pulling the cast out of the load allows us to eliminate the load, and then diff --git a/test/Transforms/InstCombine/cast-malloc.ll b/test/Transforms/InstCombine/cast-malloc.ll index d05f6b0..3754032 100644 --- a/test/Transforms/InstCombine/cast-malloc.ll +++ b/test/Transforms/InstCombine/cast-malloc.ll @@ -1,5 +1,5 @@ ; test that casted mallocs get converted to malloc of the right type -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep bitcast ; The target datalayout is important for this test case. We have to tell diff --git a/test/Transforms/InstCombine/cast-mul-select.ll b/test/Transforms/InstCombine/cast-mul-select.ll index 76e9b24..fcb7e23 100644 --- a/test/Transforms/InstCombine/cast-mul-select.ll +++ b/test/Transforms/InstCombine/cast-mul-select.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @mul(i32 %x, i32 %y) { %A = trunc i32 %x to i8 @@ -6,6 +6,9 @@ define i32 @mul(i32 %x, i32 %y) { %C = mul i8 %A, %B %D = zext i8 %C to i32 ret i32 %D +; CHECK: %C = mul i32 %x, %y +; CHECK: %D = and i32 %C, 255 +; CHECK: ret i32 %D } define i32 @select1(i1 %cond, i32 %x, i32 %y, i32 %z) { @@ -16,6 +19,10 @@ define i32 @select1(i1 %cond, i32 %x, i32 %y, i32 %z) { %E = select i1 %cond, i8 %C, i8 %D %F = zext i8 %E to i32 ret i32 %F +; CHECK: %D = add i32 %x, %y +; CHECK: %E = select i1 %cond, i32 %z, i32 %D +; CHECK: %F = and i32 %E, 255 +; CHECK: ret i32 %F } define i8 @select2(i1 %cond, i8 %x, i8 %y, i8 %z) { @@ -26,4 +33,7 @@ define i8 @select2(i1 %cond, i8 %x, i8 %y, i8 %z) { %E = select i1 %cond, i32 %C, i32 %D %F = trunc i32 %E to i8 ret i8 %F +; CHECK: %D = add i8 %x, %y +; CHECK: %E = select i1 %cond, i8 %z, i8 %D +; CHECK: ret i8 %E } diff --git a/test/Transforms/InstCombine/cast-propagate.ll b/test/Transforms/InstCombine/cast-propagate.ll index c00f953..95c040b 100644 --- a/test/Transforms/InstCombine/cast-propagate.ll +++ b/test/Transforms/InstCombine/cast-propagate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \ +; RUN: opt < %s -instcombine -mem2reg -S | \ ; RUN: not grep load define i32 @test1(i32* %P) { diff --git a/test/Transforms/InstCombine/cast-set.ll b/test/Transforms/InstCombine/cast-set.ll index 091f148..611ded4 100644 --- a/test/Transforms/InstCombine/cast-set.ll +++ b/test/Transforms/InstCombine/cast-set.ll @@ -1,13 +1,15 @@ ; This tests for various complex cast elimination cases instcombine should ; handle. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s define i1 @test1(i32 %X) { %A = bitcast i32 %X to i32 ; <i32> [#uses=1] ; Convert to setne int %X, 12 %c = icmp ne i32 %A, 12 ; <i1> [#uses=1] ret i1 %c +; CHECK: %c = icmp ne i32 %X, 12 +; CHECK: ret i1 %c } define i1 @test2(i32 %X, i32 %Y) { @@ -16,6 +18,8 @@ define i1 @test2(i32 %X, i32 %Y) { ; Convert to setne int %X, %Y %c = icmp ne i32 %A, %B ; <i1> [#uses=1] ret i1 %c +; CHECK: %c = icmp ne i32 %X, %Y +; CHECK: ret i1 %c } define i32 @test4(i32 %A) { @@ -23,6 +27,8 @@ define i32 @test4(i32 %A) { %C = shl i32 %B, 2 ; <i32> [#uses=1] %D = bitcast i32 %C to i32 ; <i32> [#uses=1] ret i32 %D +; CHECK: %C = shl i32 %A, 2 +; CHECK: ret i32 %C } define i16 @test5(i16 %A) { @@ -30,22 +36,28 @@ define i16 @test5(i16 %A) { %C = and i32 %B, 15 ; <i32> [#uses=1] %D = trunc i32 %C to i16 ; <i16> [#uses=1] ret i16 %D +; CHECK: %C = and i16 %A, 15 +; CHECK: ret i16 %C } define i1 @test6(i1 %A) { %B = zext i1 %A to i32 ; <i32> [#uses=1] %C = icmp ne i32 %B, 0 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 %A } define i1 @test6a(i1 %A) { %B = zext i1 %A to i32 ; <i32> [#uses=1] %C = icmp ne i32 %B, -1 ; <i1> [#uses=1] ret i1 %C +; CHECK: ret i1 true } define i1 @test7(i8* %A) { %B = bitcast i8* %A to i32* ; <i32*> [#uses=1] %C = icmp eq i32* %B, null ; <i1> [#uses=1] ret i1 %C +; CHECK: %C = icmp eq i8* %A, null +; CHECK: ret i1 %C } diff --git a/test/Transforms/InstCombine/cast-sext-zext.ll b/test/Transforms/InstCombine/cast-sext-zext.ll index 1acd758..0fecc1c 100644 --- a/test/Transforms/InstCombine/cast-sext-zext.ll +++ b/test/Transforms/InstCombine/cast-sext-zext.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sext +; RUN: opt < %s -instcombine -S | not grep sext ; XFAIL: * define zeroext i16 @t(i8 zeroext %on_off, i16* nocapture %puls) nounwind readonly { diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index 7a1e7a8..9835d65 100644 --- a/test/Transforms/InstCombine/cast.ll +++ b/test/Transforms/InstCombine/cast.ll @@ -1,5 +1,5 @@ ; Tests to make sure elimination of casts is working correctly -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep %c | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s @inbuf = external global [32832 x i8] ; <[32832 x i8]*> [#uses=1] @@ -7,6 +7,7 @@ define i32 @test1(i32 %A) { %c1 = bitcast i32 %A to i32 ; <i32> [#uses=1] %c2 = bitcast i32 %c1 to i32 ; <i32> [#uses=1] ret i32 %c2 +; CHECK: ret i32 %A } define i64 @test2(i8 %A) { @@ -14,6 +15,8 @@ define i64 @test2(i8 %A) { %c2 = zext i16 %c1 to i32 ; <i32> [#uses=1] %Ret = zext i32 %c2 to i64 ; <i64> [#uses=1] ret i64 %Ret +; CHECK: %Ret = zext i8 %A to i64 +; CHECK: ret i64 %Ret } ; This function should just use bitwise AND @@ -21,6 +24,8 @@ define i64 @test3(i64 %A) { %c1 = trunc i64 %A to i8 ; <i8> [#uses=1] %c2 = zext i8 %c1 to i64 ; <i64> [#uses=1] ret i64 %c2 +; CHECK: %c2 = and i64 %A, 255 +; CHECK: ret i64 %c2 } define i32 @test4(i32 %A, i32 %B) { @@ -30,6 +35,9 @@ define i32 @test4(i32 %A, i32 %B) { ; for the cast elim purpose %result = zext i8 %c to i32 ; <i32> [#uses=1] ret i32 %result +; CHECK: %COND = icmp slt i32 %A, %B +; CHECK: %result = zext i1 %COND to i32 +; CHECK: ret i32 %result } define i32 @test5(i1 %B) { @@ -38,36 +46,46 @@ define i32 @test5(i1 %B) { ; this cast %result = zext i8 %c to i32 ; <i32> [#uses=1] ret i32 %result +; CHECK: %result = zext i1 %B to i32 +; CHECK: ret i32 %result } define i32 @test6(i64 %A) { %c1 = trunc i64 %A to i32 ; <i32> [#uses=1] %res = bitcast i32 %c1 to i32 ; <i32> [#uses=1] ret i32 %res +; CHECK: %res = trunc i64 %A to i32 +; CHECK: ret i32 %res } define i64 @test7(i1 %A) { %c1 = zext i1 %A to i32 ; <i32> [#uses=1] %res = sext i32 %c1 to i64 ; <i64> [#uses=1] ret i64 %res +; CHECK: %res = zext i1 %A to i64 +; CHECK: ret i64 %res } define i64 @test8(i8 %A) { %c1 = sext i8 %A to i64 ; <i64> [#uses=1] %res = bitcast i64 %c1 to i64 ; <i64> [#uses=1] ret i64 %res +; CHECK: %res = sext i8 %A to i64 +; CHECK: ret i64 %res } define i16 @test9(i16 %A) { %c1 = sext i16 %A to i32 ; <i32> [#uses=1] %c2 = trunc i32 %c1 to i16 ; <i16> [#uses=1] ret i16 %c2 +; CHECK: ret i16 %A } define i16 @test10(i16 %A) { %c1 = sext i16 %A to i32 ; <i32> [#uses=1] %c2 = trunc i32 %c1 to i16 ; <i16> [#uses=1] ret i16 %c2 +; CHECK: ret i16 %A } declare void @varargs(i32, ...) @@ -76,22 +94,31 @@ define void @test11(i32* %P) { %c = bitcast i32* %P to i16* ; <i16*> [#uses=1] call void (i32, ...)* @varargs( i32 5, i16* %c ) ret void +; CHECK: call void (i32, ...)* @varargs(i32 5, i32* %P) +; CHECK: ret void } define i32* @test12() { %p = malloc [4 x i8] ; <[4 x i8]*> [#uses=1] %c = bitcast [4 x i8]* %p to i32* ; <i32*> [#uses=1] ret i32* %c +; CHECK: %p = malloc i32 +; CHECK: ret i32* %p } + define i8* @test13(i64 %A) { %c = getelementptr [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1] ret i8* %c +; CHECK: %c = getelementptr [32832 x i8]* @inbuf, i64 0, i64 %A +; CHECK: ret i8* %c } define i1 @test14(i8 %A) { %c = bitcast i8 %A to i8 ; <i8> [#uses=1] %X = icmp ult i8 %c, -128 ; <i1> [#uses=1] ret i1 %X +; CHECK: %X = icmp sgt i8 %A, -1 +; CHECK: ret i1 %X } @@ -105,24 +132,32 @@ define i1 @test14(i8 %A) { define i1 @test16(i32* %P) { %c = icmp ne i32* %P, null ; <i1> [#uses=1] ret i1 %c +; CHECK: %c = icmp ne i32* %P, null +; CHECK: ret i1 %c } define i16 @test17(i1 %tmp3) { %c = zext i1 %tmp3 to i32 ; <i32> [#uses=1] %t86 = trunc i32 %c to i16 ; <i16> [#uses=1] ret i16 %t86 +; CHECK: %t86 = zext i1 %tmp3 to i16 +; CHECK: ret i16 %t86 } define i16 @test18(i8 %tmp3) { %c = sext i8 %tmp3 to i32 ; <i32> [#uses=1] %t86 = trunc i32 %c to i16 ; <i16> [#uses=1] ret i16 %t86 +; CHECK: %t86 = sext i8 %tmp3 to i16 +; CHECK: ret i16 %t86 } define i1 @test19(i32 %X) { %c = sext i32 %X to i64 ; <i64> [#uses=1] %Z = icmp slt i64 %c, 12345 ; <i1> [#uses=1] ret i1 %Z +; CHECK: %Z = icmp slt i32 %X, 12345 +; CHECK: ret i1 %Z } define i1 @test20(i1 %B) { @@ -130,6 +165,7 @@ define i1 @test20(i1 %B) { %D = icmp slt i32 %c, -1 ; <i1> [#uses=1] ;; false ret i1 %D +; CHECK: ret i1 false } define i32 @test21(i32 %X) { @@ -138,6 +174,8 @@ define i32 @test21(i32 %X) { %c2 = sext i8 %c1 to i32 ; <i32> [#uses=1] %RV = and i32 %c2, 255 ; <i32> [#uses=1] ret i32 %RV +; CHECK: %c21 = and i32 %X, 255 +; CHECK: ret i32 %c21 } define i32 @test22(i32 %X) { @@ -146,6 +184,8 @@ define i32 @test22(i32 %X) { %c2 = sext i8 %c1 to i32 ; <i32> [#uses=1] %RV = shl i32 %c2, 24 ; <i32> [#uses=1] ret i32 %RV +; CHECK: %RV = shl i32 %X, 24 +; CHECK: ret i32 %RV } define i32 @test23(i32 %X) { @@ -154,6 +194,8 @@ define i32 @test23(i32 %X) { ;; and Z are signed. %c2 = zext i16 %c1 to i32 ; <i32> [#uses=1] ret i32 %c2 +; CHECK: %c2 = and i32 %X, 65535 +; CHECK: ret i32 %c2 } define i1 @test24(i1 %C) { @@ -161,6 +203,7 @@ define i1 @test24(i1 %C) { ;; Fold cast into select %c = icmp ne i32 %X, 0 ; <i1> [#uses=1] ret i1 %c +; CHECK: ret i1 true } define void @test25(i32** %P) { @@ -168,6 +211,8 @@ define void @test25(i32** %P) { ;; Fold cast into null store float* null, float** %c ret void +; CHECK: store i32* null, i32** %P +; CHECK: ret void } define i32 @test26(float %F) { @@ -175,16 +220,22 @@ define i32 @test26(float %F) { %c = fpext float %F to double ; <double> [#uses=1] %D = fptosi double %c to i32 ; <i32> [#uses=1] ret i32 %D +; CHECK: %D = fptosi float %F to i32 +; CHECK: ret i32 %D } define [4 x float]* @test27([9 x [4 x float]]* %A) { %c = bitcast [9 x [4 x float]]* %A to [4 x float]* ; <[4 x float]*> [#uses=1] ret [4 x float]* %c +; CHECK: %c = getelementptr inbounds [9 x [4 x float]]* %A, i64 0, i64 0 +; CHECK: ret [4 x float]* %c } define float* @test28([4 x float]* %A) { %c = bitcast [4 x float]* %A to float* ; <float*> [#uses=1] ret float* %c +; CHECK: %c = getelementptr inbounds [4 x float]* %A, i64 0, i64 0 +; CHECK: ret float* %c } define i32 @test29(i32 %c1, i32 %c2) { @@ -193,6 +244,9 @@ define i32 @test29(i32 %c1, i32 %c2) { %tmp = or i8 %tmp4.mask, %tmp1 ; <i8> [#uses=1] %tmp10 = zext i8 %tmp to i32 ; <i32> [#uses=1] ret i32 %tmp10 +; CHECK: %tmp2 = or i32 %c2, %c1 +; CHECK: %tmp10 = and i32 %tmp2, 255 +; CHECK: ret i32 %tmp10 } define i32 @test30(i32 %c1) { @@ -200,6 +254,9 @@ define i32 @test30(i32 %c1) { %c3 = xor i8 %c2, 1 ; <i8> [#uses=1] %c4 = zext i8 %c3 to i32 ; <i32> [#uses=1] ret i32 %c4 +; CHECK: %c3 = and i32 %c1, 255 +; CHECK: %c4 = xor i32 %c3, 1 +; CHECK: ret i32 %c4 } define i1 @test31(i64 %A) { @@ -207,6 +264,9 @@ define i1 @test31(i64 %A) { %C = and i32 %B, 42 ; <i32> [#uses=1] %D = icmp eq i32 %C, 10 ; <i1> [#uses=1] ret i1 %D +; CHECK: %C1 = and i64 %A, 42 +; CHECK: %D = icmp eq i64 %C1, 10 +; CHECK: ret i1 %D } define void @test32(double** %tmp) { @@ -214,12 +274,17 @@ define void @test32(double** %tmp) { %tmp8.upgrd.1 = bitcast [16 x i8]* %tmp8 to double* ; <double*> [#uses=1] store double* %tmp8.upgrd.1, double** %tmp ret void +; CHECK: %tmp81 = malloc [2 x double] +; CHECK: %tmp81.sub = getelementptr inbounds [2 x double]* %tmp81, i64 0, i64 0 +; CHECK: store double* %tmp81.sub, double** %tmp +; CHECK: ret void } define i32 @test33(i32 %c1) { %x = bitcast i32 %c1 to float ; <float> [#uses=1] %y = bitcast float %x to i32 ; <i32> [#uses=1] ret i32 %y +; CHECK: ret i32 %c1 } define i16 @test34(i16 %a) { @@ -227,6 +292,8 @@ define i16 @test34(i16 %a) { %tmp21 = lshr i32 %c1, 8 ; <i32> [#uses=1] %c2 = trunc i32 %tmp21 to i16 ; <i16> [#uses=1] ret i16 %c2 +; CHECK: %tmp21 = lshr i16 %a, 8 +; CHECK: ret i16 %tmp21 } define i16 @test35(i16 %a) { @@ -234,6 +301,8 @@ define i16 @test35(i16 %a) { %tmp2 = lshr i16 %c1, 8 ; <i16> [#uses=1] %c2 = bitcast i16 %tmp2 to i16 ; <i16> [#uses=1] ret i16 %c2 +; CHECK: %tmp2 = lshr i16 %a, 8 +; CHECK: ret i16 %tmp2 } ; icmp sgt i32 %a, -1 @@ -243,6 +312,8 @@ define i1 @test36(i32 %a) { %c = trunc i32 %b to i8 %d = icmp eq i8 %c, 0 ret i1 %d +; CHECK: %d = icmp sgt i32 %a, -1 +; CHECK: ret i1 %d } ; ret i1 false @@ -252,6 +323,7 @@ define i1 @test37(i32 %a) { %d = trunc i32 %c to i8 %e = icmp eq i8 %d, 11 ret i1 %e +; CHECK: ret i1 false } define i64 @test38(i32 %a) { @@ -260,4 +332,7 @@ define i64 @test38(i32 %a) { %3 = xor i8 %2, 1 %4 = zext i8 %3 to i64 ret i64 %4 +; CHECK: %1 = icmp ne i32 %a, -2 +; CHECK: %2 = zext i1 %1 to i64 +; CHECK: ret i64 %2 } diff --git a/test/Transforms/InstCombine/cast2.ll b/test/Transforms/InstCombine/cast2.ll index 5cc9087..0ae869f 100644 --- a/test/Transforms/InstCombine/cast2.ll +++ b/test/Transforms/InstCombine/cast2.ll @@ -1,5 +1,5 @@ ; Tests to make sure elimination of casts is working correctly -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s define i16 @test1(i16 %a) { %tmp = zext i16 %a to i32 ; <i32> [#uses=2] @@ -8,6 +8,8 @@ define i16 @test1(i16 %a) { %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1] %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1] ret i16 %tmp.upgrd.3 +; CHECK: %tmp.upgrd.32 = call i16 @llvm.bswap.i16(i16 %a) +; CHECK: ret i16 %tmp.upgrd.32 } define i16 @test2(i16 %a) { @@ -17,6 +19,10 @@ define i16 @test2(i16 %a) { %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1] %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1] ret i16 %tmp.upgrd.3 +; CHECK: %tmp21 = lshr i16 %a, 9 +; CHECK: %tmp5 = shl i16 %a, 8 +; CHECK: %tmp.upgrd.32 = or i16 %tmp21, %tmp5 +; CHECK: ret i16 %tmp.upgrd.32 } ; PR1263 @@ -24,6 +30,7 @@ define i32* @test3(i32* %tmp1) { %tmp64 = bitcast i32* %tmp1 to { i32 }* ; <{ i32 }*> [#uses=1] %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0 ; <i32*> [#uses=1] ret i32* %tmp65 +; CHECK: ret i32* %tmp1 } diff --git a/test/Transforms/InstCombine/cast3.ll b/test/Transforms/InstCombine/cast3.ll new file mode 100644 index 0000000..bc60f55 --- /dev/null +++ b/test/Transforms/InstCombine/cast3.ll @@ -0,0 +1,35 @@ +; RUN: opt < %s -instcombine -S | not grep getelementptr +; PR2831 + +; Don't raise arbitrary inttoptr+arithmetic+ptrtoint to getelementptr. + +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" + +define i32 @main(i32 %argc, i8** %argv) nounwind { +entry: + %0 = ptrtoint i8** %argv to i32 ; <i32> [#uses=1] + %1 = add i32 %0, 1 ; <i32> [#uses=1] + ret i32 %1 +} + +; This testcase could theoretically be optimized down to return zero, +; but for now being conservative with ptrtoint/inttoptr is fine. +define i32 @a() nounwind { +entry: + %b = alloca i32 ; <i32*> [#uses=3] + %a = alloca i32 ; <i32*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] + store i32 1, i32* %b, align 4 + %a1 = ptrtoint i32* %a to i32 ; <i32> [#uses=1] + %b4 = ptrtoint i32* %b to i32 ; <i32> [#uses=1] + %a7 = ptrtoint i32* %a to i32 ; <i32> [#uses=1] + %0 = sub i32 %b4, %a7 ; <i32> [#uses=1] + %1 = add i32 %a1, %0 ; <i32> [#uses=1] + %2 = inttoptr i32 %1 to i32* ; <i32*> [#uses=1] + store i32 0, i32* %2, align 4 + %3 = load i32* %b, align 4 ; <i32> [#uses=1] + br label %return + +return: ; preds = %entry + ret i32 %3 +} diff --git a/test/Transforms/InstCombine/cast_ld_addr_space.ll b/test/Transforms/InstCombine/cast_ld_addr_space.ll index beb20e3..e94dce7 100644 --- a/test/Transforms/InstCombine/cast_ld_addr_space.ll +++ b/test/Transforms/InstCombine/cast_ld_addr_space.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep bitcast | count 1 +; RUN: opt < %s -instcombine -S | grep bitcast | count 1 ; InstCombine can not 'load (cast P)' -> cast (load P)' if the cast changes ; the address space. diff --git a/test/Transforms/InstCombine/cast_ptr.ll b/test/Transforms/InstCombine/cast_ptr.ll index fd600a8..6544e7d 100644 --- a/test/Transforms/InstCombine/cast_ptr.ll +++ b/test/Transforms/InstCombine/cast_ptr.ll @@ -1,8 +1,15 @@ ; Tests to make sure elimination of casts is working correctly -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast +; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "p:32:32" +; This shouldn't convert to getelementptr because the relationship +; between the arithmetic and the layout of allocated memory is +; entirely unknown. +; CHECK: @test1 +; CHECK: ptrtoint +; CHECK: add +; CHECK: inttoptr define i8* @test1(i8* %t) { %tmpc = ptrtoint i8* %t to i32 ; <i32> [#uses=1] %tmpa = add i32 %tmpc, 32 ; <i32> [#uses=1] @@ -10,6 +17,9 @@ define i8* @test1(i8* %t) { ret i8* %tv } +; These casts should be folded away. +; CHECK: @test2 +; CHECK: icmp eq i8* %a, %b define i1 @test2(i8* %a, i8* %b) { %tmpa = ptrtoint i8* %a to i32 ; <i32> [#uses=1] %tmpb = ptrtoint i8* %b to i32 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/constant-fold-gep.ll b/test/Transforms/InstCombine/constant-fold-gep.ll new file mode 100644 index 0000000..5a7aef3 --- /dev/null +++ b/test/Transforms/InstCombine/constant-fold-gep.ll @@ -0,0 +1,54 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +; Constant folding should fix notionally out-of-bounds indices +; and add inbounds keywords. + +%struct.X = type { [3 x i32], [3 x i32] } + +@Y = internal global [3 x %struct.X] zeroinitializer + +define void @frob() { +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 1), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 2), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 3), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 4), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 2), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 5), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 6), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 7), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 8), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 0), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 9), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 10), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 2), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 11), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 12), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 13), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 14), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 15), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 1), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 16), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 17), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 1, i64 0, i32 0, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 18), align 8 +; CHECK: store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 2, i64 0, i32 0, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 36), align 8 +; CHECK: store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 1, i64 0, i32 0, i64 1), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 19), align 8 + ret void +} diff --git a/test/Transforms/InstCombine/constant-fold-ptr-casts.ll b/test/Transforms/InstCombine/constant-fold-ptr-casts.ll index 27c4606..9b6c6c3 100644 --- a/test/Transforms/InstCombine/constant-fold-ptr-casts.ll +++ b/test/Transforms/InstCombine/constant-fold-ptr-casts.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 2143034560} +; RUN: opt < %s -instcombine -S | grep {ret i32 2143034560} ; Instcombine should be able to completely fold this code. diff --git a/test/Transforms/InstCombine/crash.ll b/test/Transforms/InstCombine/crash.ll new file mode 100644 index 0000000..d475ab5 --- /dev/null +++ b/test/Transforms/InstCombine/crash.ll @@ -0,0 +1,46 @@ +; RUN: opt < %s -instcombine | llvm-dis +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" +target triple = "i386-apple-darwin10.0" + +define i32 @test0(i8 %tmp2) ssp { +entry: + %tmp3 = zext i8 %tmp2 to i32 + %tmp8 = lshr i32 %tmp3, 6 + %tmp9 = lshr i32 %tmp3, 7 + %tmp10 = xor i32 %tmp9, 67108858 + %tmp11 = xor i32 %tmp10, %tmp8 + %tmp12 = xor i32 %tmp11, 0 + ret i32 %tmp12 +} + +; PR4905 +define <2 x i64> @test1(<2 x i64> %x, <2 x i64> %y) nounwind { +entry: + %conv.i94 = bitcast <2 x i64> %y to <4 x i32> ; <<4 x i32>> [#uses=1] + %sub.i97 = sub <4 x i32> %conv.i94, undef ; <<4 x i32>> [#uses=1] + %conv3.i98 = bitcast <4 x i32> %sub.i97 to <2 x i64> ; <<2 x i64>> [#uses=2] + %conv2.i86 = bitcast <2 x i64> %conv3.i98 to <4 x i32> ; <<4 x i32>> [#uses=1] + %cmp.i87 = icmp sgt <4 x i32> undef, %conv2.i86 ; <<4 x i1>> [#uses=1] + %sext.i88 = sext <4 x i1> %cmp.i87 to <4 x i32> ; <<4 x i32>> [#uses=1] + %conv3.i89 = bitcast <4 x i32> %sext.i88 to <2 x i64> ; <<2 x i64>> [#uses=1] + %and.i = and <2 x i64> %conv3.i89, %conv3.i98 ; <<2 x i64>> [#uses=1] + %or.i = or <2 x i64> zeroinitializer, %and.i ; <<2 x i64>> [#uses=1] + %conv2.i43 = bitcast <2 x i64> %or.i to <4 x i32> ; <<4 x i32>> [#uses=1] + %sub.i = sub <4 x i32> zeroinitializer, %conv2.i43 ; <<4 x i32>> [#uses=1] + %conv3.i44 = bitcast <4 x i32> %sub.i to <2 x i64> ; <<2 x i64>> [#uses=1] + ret <2 x i64> %conv3.i44 +} + + +; PR4908 +define void @test2(<1 x i16>* nocapture %b, i32* nocapture %c) nounwind ssp { +entry: + %arrayidx = getelementptr inbounds <1 x i16>* %b, i64 undef ; <<1 x i16>*> + %tmp2 = load <1 x i16>* %arrayidx ; <<1 x i16>> [#uses=1] + %tmp6 = bitcast <1 x i16> %tmp2 to i16 ; <i16> [#uses=1] + %tmp7 = zext i16 %tmp6 to i32 ; <i32> [#uses=1] + %ins = or i32 0, %tmp7 ; <i32> [#uses=1] + %arrayidx20 = getelementptr inbounds i32* %c, i64 undef ; <i32*> [#uses=1] + store i32 %ins, i32* %arrayidx20 + ret void +} diff --git a/test/Transforms/InstCombine/dce-iterate.ll b/test/Transforms/InstCombine/dce-iterate.ll index faefa8a..1d2cc53 100644 --- a/test/Transforms/InstCombine/dce-iterate.ll +++ b/test/Transforms/InstCombine/dce-iterate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret double .sy} +; RUN: opt < %s -instcombine -S | grep {ret double .sy} define internal double @ScaleObjectAdd(double %sx, double %sy, double %sz) nounwind { entry: diff --git a/test/Transforms/InstCombine/deadcode.ll b/test/Transforms/InstCombine/deadcode.ll index 43c1793..52af0ef 100644 --- a/test/Transforms/InstCombine/deadcode.ll +++ b/test/Transforms/InstCombine/deadcode.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 %A} -; RUN: llvm-as < %s | opt -die | llvm-dis | not grep call.*llvm.stacksave +; RUN: opt < %s -instcombine -S | grep {ret i32 %A} +; RUN: opt < %s -die -S | not grep call.*llvm.stacksave define i32 @test(i32 %A) { %X = or i1 false, false diff --git a/test/Transforms/InstCombine/div-cmp-overflow.ll b/test/Transforms/InstCombine/div-cmp-overflow.ll index 9276c96..6f63adc 100644 --- a/test/Transforms/InstCombine/div-cmp-overflow.ll +++ b/test/Transforms/InstCombine/div-cmp-overflow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sdiv +; RUN: opt < %s -instcombine -S | not grep sdiv ; PR2740 define i1 @func_75(i32 %i2) nounwind { diff --git a/test/Transforms/InstCombine/div.ll b/test/Transforms/InstCombine/div.ll index ea6ea63..0d13980 100644 --- a/test/Transforms/InstCombine/div.ll +++ b/test/Transforms/InstCombine/div.ll @@ -1,6 +1,6 @@ ; This test makes sure that div instructions are properly eliminated. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div +; RUN: opt < %s -instcombine -S | not grep div define i32 @test1(i32 %A) { %B = sdiv i32 %A, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/enforce-known-alignment.ll b/test/Transforms/InstCombine/enforce-known-alignment.ll index 6ac24a8..9e9be7f 100644 --- a/test/Transforms/InstCombine/enforce-known-alignment.ll +++ b/test/Transforms/InstCombine/enforce-known-alignment.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep alloca | grep {align 16} +; RUN: opt < %s -instcombine -S | grep alloca | grep {align 16} 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" target triple = "i386-apple-darwin9.6" diff --git a/test/Transforms/InstCombine/exact-sdiv.ll b/test/Transforms/InstCombine/exact-sdiv.ll new file mode 100644 index 0000000..e567754 --- /dev/null +++ b/test/Transforms/InstCombine/exact-sdiv.ll @@ -0,0 +1,52 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +; CHECK: define i32 @foo +; CHECK: sdiv i32 %x, 8 +define i32 @foo(i32 %x) { + %y = sdiv i32 %x, 8 + ret i32 %y +} + +; CHECK: define i32 @bar +; CHECK: ashr i32 %x, 3 +define i32 @bar(i32 %x) { + %y = sdiv exact i32 %x, 8 + ret i32 %y +} + +; CHECK: i32 @a0 +; CHECK: %y = srem i32 %x, 3 +; CHECK: %z = sub i32 %x, %y +; CHECK: ret i32 %z +define i32 @a0(i32 %x) { + %y = sdiv i32 %x, 3 + %z = mul i32 %y, 3 + ret i32 %z +} + +; CHECK: i32 @b0 +; CHECK: ret i32 %x +define i32 @b0(i32 %x) { + %y = sdiv exact i32 %x, 3 + %z = mul i32 %y, 3 + ret i32 %z +} + +; CHECK: i32 @a1 +; CHECK: %y = srem i32 %x, 3 +; CHECK: %z = sub i32 %y, %x +; CHECK: ret i32 %z +define i32 @a1(i32 %x) { + %y = sdiv i32 %x, 3 + %z = mul i32 %y, -3 + ret i32 %z +} + +; CHECK: i32 @b1 +; CHECK: %z = sub i32 0, %x +; CHECK: ret i32 %z +define i32 @b1(i32 %x) { + %y = sdiv exact i32 %x, 3 + %z = mul i32 %y, -3 + ret i32 %z +} diff --git a/test/Transforms/InstCombine/extractvalue.ll b/test/Transforms/InstCombine/extractvalue.ll index 59b996e..875f860 100644 --- a/test/Transforms/InstCombine/extractvalue.ll +++ b/test/Transforms/InstCombine/extractvalue.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep extractvalue +; RUN: opt < %s -instcombine -S | not grep extractvalue ; Instcombine should fold various combinations of insertvalue and extractvalue ; together diff --git a/test/Transforms/InstCombine/fold-bin-operand.ll b/test/Transforms/InstCombine/fold-bin-operand.ll new file mode 100644 index 0000000..b837985 --- /dev/null +++ b/test/Transforms/InstCombine/fold-bin-operand.ll @@ -0,0 +1,13 @@ +; RUN: opt < %s -instcombine -S | not grep icmp + +define i1 @f(i1 %x) { + %b = and i1 %x, icmp eq (i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 2 to i8*)) + ret i1 %b +} + +; FIXME: This doesn't fold at the moment! +; define i32 @f(i32 %x) { +; %b = add i32 %x, zext (i1 icmp eq (i8* inttoptr (i32 1000000 to i8*), i8* inttoptr (i32 2000000 to i8*)) to i32) +; ret i32 %b +;} + diff --git a/test/Transforms/InstCombine/fold-vector-zero.ll b/test/Transforms/InstCombine/fold-vector-zero.ll index 0b5b30a..e1d86b6 100644 --- a/test/Transforms/InstCombine/fold-vector-zero.ll +++ b/test/Transforms/InstCombine/fold-vector-zero.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep zeroinitializer +; RUN: opt < %s -instcombine -S | not grep zeroinitializer define void @foo(i64 %A, i64 %B) { bb8: diff --git a/test/Transforms/InstCombine/fp-ret-bitcast.ll b/test/Transforms/InstCombine/fp-ret-bitcast.ll index 00c1ea0..169340a 100644 --- a/test/Transforms/InstCombine/fp-ret-bitcast.ll +++ b/test/Transforms/InstCombine/fp-ret-bitcast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {call float bitcast} | count 1 %struct.NSObject = type { %struct.objc_class* } %struct.NSArray = type { %struct.NSObject } diff --git a/test/Transforms/InstCombine/fpcast.ll b/test/Transforms/InstCombine/fpcast.ll index 7f25092..bc6aa0a 100644 --- a/test/Transforms/InstCombine/fpcast.ll +++ b/test/Transforms/InstCombine/fpcast.ll @@ -1,15 +1,15 @@ ; Test some floating point casting cases -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | notcast -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \ -; RUN: egrep {ret i8 \(-1\)\|\(255\)} +; RUN: opt < %s -instcombine -S | FileCheck %s define i8 @test1() { %x = fptoui float 2.550000e+02 to i8 ; <i8> [#uses=1] ret i8 %x +; CHECK: ret i8 -1 } define i8 @test2() { %x = fptosi float -1.000000e+00 to i8 ; <i8> [#uses=1] ret i8 %x +; CHECK: ret i8 -1 } diff --git a/test/Transforms/InstCombine/fpextend.ll b/test/Transforms/InstCombine/fpextend.ll index c212128..70e0c62 100644 --- a/test/Transforms/InstCombine/fpextend.ll +++ b/test/Transforms/InstCombine/fpextend.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep fpext +; RUN: opt < %s -instcombine -S | not grep fpext @X = external global float @Y = external global float diff --git a/test/Transforms/InstCombine/fsub-fsub.ll b/test/Transforms/InstCombine/fsub-fsub.ll index ab70479..94ebf09 100644 --- a/test/Transforms/InstCombine/fsub-fsub.ll +++ b/test/Transforms/InstCombine/fsub-fsub.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep fsub | count 2 +; RUN: opt < %s -instcombine -S | grep fsub | count 2 ; PR4374 define float @func(float %a, float %b) nounwind { diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll index c2cb720..ffaa6af 100644 --- a/test/Transforms/InstCombine/getelementptr.ll +++ b/test/Transforms/InstCombine/getelementptr.ll @@ -1,81 +1,470 @@ -; The %A getelementptr instruction should be eliminated here +; RUN: opt < %s -instcombine -S | FileCheck %s -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ -; RUN: grep -v %B | not grep getelementptr -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep foo1 -; END. +target datalayout = "e-p:64:64" +%intstruct = type { i32 } +%pair = type { i32, i32 } +%struct.B = type { double } +%struct.A = type { %struct.B, i32, i32 } -@Global = constant [10 x i8] c"helloworld" ; <[10 x i8]*> [#uses=1] + +@Global = constant [10 x i8] c"helloworld" ; Test noop elimination -define i32* @foo1(i32* %I) { - %A = getelementptr i32* %I, i64 0 ; <i32*> [#uses=1] +define i32* @test1(i32* %I) { + %A = getelementptr i32* %I, i64 0 ret i32* %A +; CHECK: @test1 +; CHECK: ret i32* %I } ; Test noop elimination -define i32* @foo2(i32* %I) { - %A = getelementptr i32* %I ; <i32*> [#uses=1] +define i32* @test2(i32* %I) { + %A = getelementptr i32* %I ret i32* %A +; CHECK: @test2 +; CHECK: ret i32* %I } ; Test that two array indexing geps fold -define i32* @foo3(i32* %I) { - %A = getelementptr i32* %I, i64 17 ; <i32*> [#uses=1] - %B = getelementptr i32* %A, i64 4 ; <i32*> [#uses=1] +define i32* @test3(i32* %I) { + %A = getelementptr i32* %I, i64 17 + %B = getelementptr i32* %A, i64 4 ret i32* %B +; CHECK: @test3 +; CHECK: getelementptr i32* %I, i64 21 } ; Test that two getelementptr insts fold -define i32* @foo4({ i32 }* %I) { - %A = getelementptr { i32 }* %I, i64 1 ; <{ i32 }*> [#uses=1] - %B = getelementptr { i32 }* %A, i64 0, i32 0 ; <i32*> [#uses=1] +define i32* @test4({ i32 }* %I) { + %A = getelementptr { i32 }* %I, i64 1 + %B = getelementptr { i32 }* %A, i64 0, i32 0 ret i32* %B +; CHECK: @test4 +; CHECK: getelementptr %intstruct* %I, i64 1, i32 0 } -define void @foo5(i8 %B) { +define void @test5(i8 %B) { ; This should be turned into a constexpr instead of being an instruction - %A = getelementptr [10 x i8]* @Global, i64 0, i64 4 ; <i8*> [#uses=1] + %A = getelementptr [10 x i8]* @Global, i64 0, i64 4 store i8 %B, i8* %A ret void +; CHECK: @test5 +; CHECK: store i8 %B, i8* getelementptr inbounds ([10 x i8]* @Global, i64 0, i64 4) } -define i32* @foo6() { - %M = malloc [4 x i32] ; <[4 x i32]*> [#uses=1] - %A = getelementptr [4 x i32]* %M, i64 0, i64 0 ; <i32*> [#uses=1] - %B = getelementptr i32* %A, i64 2 ; <i32*> [#uses=1] +define i32* @test6() { + %M = malloc [4 x i32] + %A = getelementptr [4 x i32]* %M, i64 0, i64 0 + %B = getelementptr i32* %A, i64 2 ret i32* %B +; CHECK: @test6 +; CHECK: getelementptr [4 x i32]* %M, i64 0, i64 2 } -define i32* @foo7(i32* %I, i64 %C, i64 %D) { - %A = getelementptr i32* %I, i64 %C ; <i32*> [#uses=1] - %B = getelementptr i32* %A, i64 %D ; <i32*> [#uses=1] +define i32* @test7(i32* %I, i64 %C, i64 %D) { + %A = getelementptr i32* %I, i64 %C + %B = getelementptr i32* %A, i64 %D ret i32* %B +; CHECK: @test7 +; CHECK: %A.sum = add i64 %C, %D +; CHECK: getelementptr i32* %I, i64 %A.sum } -define i8* @foo8([10 x i32]* %X) { +define i8* @test8([10 x i32]* %X) { ;; Fold into the cast. - %A = getelementptr [10 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=1] - %B = bitcast i32* %A to i8* ; <i8*> [#uses=1] + %A = getelementptr [10 x i32]* %X, i64 0, i64 0 + %B = bitcast i32* %A to i8* ret i8* %B +; CHECK: @test8 +; CHECK: bitcast [10 x i32]* %X to i8* } define i32 @test9() { - %A = getelementptr { i32, double }* null, i32 0, i32 1 ; <double*> [#uses=1] - %B = ptrtoint double* %A to i32 ; <i32> [#uses=1] + %A = getelementptr { i32, double }* null, i32 0, i32 1 + %B = ptrtoint double* %A to i32 ret i32 %B +; CHECK: @test9 +; CHECK: ret i32 8 } define i1 @test10({ i32, i32 }* %x, { i32, i32 }* %y) { - %tmp.1 = getelementptr { i32, i32 }* %x, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp.3 = getelementptr { i32, i32 }* %y, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp.1 = getelementptr { i32, i32 }* %x, i32 0, i32 1 + %tmp.3 = getelementptr { i32, i32 }* %y, i32 0, i32 1 ;; seteq x, y - %tmp.4 = icmp eq i32* %tmp.1, %tmp.3 ; <i1> [#uses=1] + %tmp.4 = icmp eq i32* %tmp.1, %tmp.3 ret i1 %tmp.4 +; CHECK: @test10 +; CHECK: icmp eq %pair* %x, %y } define i1 @test11({ i32, i32 }* %X) { - %P = getelementptr { i32, i32 }* %X, i32 0, i32 0 ; <i32*> [#uses=1] - %Q = icmp eq i32* %P, null ; <i1> [#uses=1] + %P = getelementptr { i32, i32 }* %X, i32 0, i32 0 + %Q = icmp eq i32* %P, null ret i1 %Q +; CHECK: @test11 +; CHECK: icmp eq %pair* %X, null +} + + +; PR4748 +define i32 @test12(%struct.A* %a) { +entry: + %g3 = getelementptr %struct.A* %a, i32 0, i32 1 + store i32 10, i32* %g3, align 4 + + %g4 = getelementptr %struct.A* %a, i32 0, i32 0 + + %new_a = bitcast %struct.B* %g4 to %struct.A* + + %g5 = getelementptr %struct.A* %new_a, i32 0, i32 1 + %a_a = load i32* %g5, align 4 + ret i32 %a_a +; CHECK: @test12 +; CHECK: getelementptr %struct.A* %a, i64 0, i32 1 +; CHECK-NEXT: store i32 10, i32* %g3 +; CHECK-NEXT: ret i32 10 +} + + +; PR2235 +%S = type { i32, [ 100 x i32] } +define i1 @test13(i64 %X, %S* %P) { + %A = getelementptr inbounds %S* %P, i32 0, i32 1, i64 %X + %B = getelementptr inbounds %S* %P, i32 0, i32 0 + %C = icmp eq i32* %A, %B + ret i1 %C +; CHECK: @test13 +; CHECK: %C = icmp eq i64 %X, -1 +} + + +@G = external global [3 x i8] +define i8* @test14(i32 %Idx) { + %idx = zext i32 %Idx to i64 + %tmp = getelementptr i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i64 %idx + ret i8* %tmp +; CHECK: @test14 +; CHECK: getelementptr [3 x i8]* @G, i64 0, i64 %idx +} + + +; Test folding of constantexpr geps into normal geps. +@Array = external global [40 x i32] +define i32 *@test15(i64 %X) { + %A = getelementptr i32* getelementptr ([40 x i32]* @Array, i64 0, i64 0), i64 %X + ret i32* %A +; CHECK: @test15 +; CHECK: getelementptr [40 x i32]* @Array, i64 0, i64 %X +} + + +define i32* @test16(i32* %X, i32 %Idx) { + %R = getelementptr i32* %X, i32 %Idx + ret i32* %R +; CHECK: @test16 +; CHECK: sext i32 %Idx to i64 +} + + +define i1 @test17(i16* %P, i32 %I, i32 %J) { + %X = getelementptr inbounds i16* %P, i32 %I + %Y = getelementptr inbounds i16* %P, i32 %J + %C = icmp ult i16* %X, %Y + ret i1 %C +; CHECK: @test17 +; CHECK: %C = icmp slt i32 %I, %J +} + +define i1 @test18(i16* %P, i32 %I) { + %X = getelementptr inbounds i16* %P, i32 %I + %C = icmp ult i16* %X, %P + ret i1 %C +; CHECK: @test18 +; CHECK: %C = icmp slt i32 %I, 0 +} + +define i32 @test19(i32* %P, i32 %A, i32 %B) { + %tmp.4 = getelementptr inbounds i32* %P, i32 %A + %tmp.9 = getelementptr inbounds i32* %P, i32 %B + %tmp.10 = icmp eq i32* %tmp.4, %tmp.9 + %tmp.11 = zext i1 %tmp.10 to i32 + ret i32 %tmp.11 +; CHECK: @test19 +; CHECK: icmp eq i32 %A, %B +} + +define i32 @test20(i32* %P, i32 %A, i32 %B) { + %tmp.4 = getelementptr inbounds i32* %P, i32 %A + %tmp.6 = icmp eq i32* %tmp.4, %P + %tmp.7 = zext i1 %tmp.6 to i32 + ret i32 %tmp.7 +; CHECK: @test20 +; CHECK: icmp eq i32 %A, 0 +} + + +define i32 @test21() { + %pbob1 = alloca %intstruct + %pbob2 = getelementptr %intstruct* %pbob1 + %pbobel = getelementptr %intstruct* %pbob2, i64 0, i32 0 + %rval = load i32* %pbobel + ret i32 %rval +; CHECK: @test21 +; CHECK: getelementptr %intstruct* %pbob1, i64 0, i32 0 +} + + +@A = global i32 1 ; <i32*> [#uses=1] +@B = global i32 2 ; <i32*> [#uses=1] + +define i1 @test22() { + %C = icmp ult i32* getelementptr (i32* @A, i64 1), + getelementptr (i32* @B, i64 2) + ret i1 %C +; CHECK: @test22 +; CHECK: icmp ult (i32* getelementptr inbounds (i32* @A, i64 1), i32* getelementptr (i32* @B, i64 2)) +} + + +%X = type { [10 x i32], float } + +define i1 @test23() { + %A = getelementptr %X* null, i64 0, i32 0, i64 0 ; <i32*> [#uses=1] + %B = icmp ne i32* %A, null ; <i1> [#uses=1] + ret i1 %B +; CHECK: @test23 +; CHECK: ret i1 false +} + +%"java/lang/Object" = type { %struct.llvm_java_object_base } +%"java/lang/StringBuffer" = type { %"java/lang/Object", i32, { %"java/lang/Object", i32, [0 x i16] }*, i1 } +%struct.llvm_java_object_base = type opaque + +define void @test24() { +bc0: + %tmp53 = getelementptr %"java/lang/StringBuffer"* null, i32 0, i32 1 ; <i32*> [#uses=1] + store i32 0, i32* %tmp53 + ret void +; CHECK: @test24 +; CHECK: store i32 0, i32* getelementptr (%"java/lang/StringBuffer"* null, i32 0, i32 1) +} + +define void @test25() { +entry: + %tmp = getelementptr { i64, i64, i64, i64 }* null, i32 0, i32 3 ; <i64*> [#uses=1] + %tmp.upgrd.1 = load i64* %tmp ; <i64> [#uses=1] + %tmp8.ui = load i64* null ; <i64> [#uses=1] + %tmp8 = bitcast i64 %tmp8.ui to i64 ; <i64> [#uses=1] + %tmp9 = and i64 %tmp8, %tmp.upgrd.1 ; <i64> [#uses=1] + %sext = trunc i64 %tmp9 to i32 ; <i32> [#uses=1] + %tmp27.i = sext i32 %sext to i64 ; <i64> [#uses=1] + tail call void @foo25( i32 0, i64 %tmp27.i ) + unreachable +; CHECK: @test25 +} + +declare void @foo25(i32, i64) + + +; PR1637 +define i1 @test26(i8* %arr) { + %X = getelementptr i8* %arr, i32 1 + %Y = getelementptr i8* %arr, i32 1 + %test = icmp uge i8* %X, %Y + ret i1 %test +; CHECK: @test26 +; CHECK: ret i1 true +} + + %struct.__large_struct = type { [100 x i64] } + %struct.compat_siginfo = type { i32, i32, i32, { [29 x i32] } } + %struct.siginfo_t = type { i32, i32, i32, { { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] } } + %struct.sigval_t = type { i8* } + +define i32 @test27(%struct.compat_siginfo* %to, %struct.siginfo_t* %from) { +entry: + %from_addr = alloca %struct.siginfo_t* + %tmp344 = load %struct.siginfo_t** %from_addr, align 8 + %tmp345 = getelementptr %struct.siginfo_t* %tmp344, i32 0, i32 3 + %tmp346 = getelementptr { { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] }* %tmp345, i32 0, i32 0 + %tmp346347 = bitcast { i32, i32, [0 x i8], %struct.sigval_t, i32 }* %tmp346 to { i32, i32, %struct.sigval_t }* + %tmp348 = getelementptr { i32, i32, %struct.sigval_t }* %tmp346347, i32 0, i32 2 + %tmp349 = getelementptr %struct.sigval_t* %tmp348, i32 0, i32 0 + %tmp349350 = bitcast i8** %tmp349 to i32* + %tmp351 = load i32* %tmp349350, align 8 + %tmp360 = call i32 asm sideeffect "...", + "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"( i32 %tmp351, + %struct.__large_struct* null, i32 -14, i32 0 ) + unreachable +; CHECK: @test27 +} + +; PR1978 + %struct.x = type <{ i8 }> +@.str = internal constant [6 x i8] c"Main!\00" +@.str1 = internal constant [12 x i8] c"destroy %p\0A\00" + +define i32 @test28() nounwind { +entry: + %orientations = alloca [1 x [1 x %struct.x]] + %tmp3 = call i32 @puts( i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0) ) nounwind + %tmp45 = getelementptr inbounds [1 x [1 x %struct.x]]* %orientations, i32 1, i32 0, i32 0 + %orientations62 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 0, i32 0, i32 0 + br label %bb10 + +bb10: + %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb10 ] + %tmp.0.reg2mem.0.rec = mul i32 %indvar, -1 + %tmp12.rec = add i32 %tmp.0.reg2mem.0.rec, -1 + %tmp12 = getelementptr inbounds %struct.x* %tmp45, i32 %tmp12.rec + %tmp16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind + %tmp84 = icmp eq %struct.x* %tmp12, %orientations62 + %indvar.next = add i32 %indvar, 1 + br i1 %tmp84, label %bb17, label %bb10 + +bb17: + ret i32 0 +; CHECK: @test28 +; CHECK: icmp eq i32 %indvar, 0 +} + +declare i32 @puts(i8*) + +declare i32 @printf(i8*, ...) + + + + +; rdar://6762290 + %T = type <{ i64, i64, i64 }> +define i32 @test29(i8* %start, i32 %X) nounwind { +entry: + %tmp3 = load i64* null + %add.ptr = getelementptr i8* %start, i64 %tmp3 + %tmp158 = load i32* null + %add.ptr159 = getelementptr %T* null, i32 %tmp158 + %add.ptr209 = getelementptr i8* %start, i64 0 + %add.ptr212 = getelementptr i8* %add.ptr209, i32 %X + %cmp214 = icmp ugt i8* %add.ptr212, %add.ptr + br i1 %cmp214, label %if.then216, label %if.end363 + +if.then216: + ret i32 1 + +if.end363: + ret i32 0 +; CHECK: @test29 +} + + +; PR3694 +define i32 @test30(i32 %m, i32 %n) nounwind { +entry: + %0 = alloca i32, i32 %n, align 4 + %1 = bitcast i32* %0 to [0 x i32]* + call void @test30f(i32* %0) nounwind + %2 = getelementptr [0 x i32]* %1, i32 0, i32 %m + %3 = load i32* %2, align 4 + ret i32 %3 +; CHECK: @test30 +; CHECK: getelementptr i32 +} + +declare void @test30f(i32*) + + + +define i1 @test31(i32* %A) { + %B = getelementptr i32* %A, i32 1 + %C = getelementptr i32* %A, i64 1 + %V = icmp eq i32* %B, %C + ret i1 %V +; CHECK: @test31 +; CHECK: ret i1 true +} + + +; PR1345 +define i8* @test32(i8* %v) { + %A = alloca [4 x i8*], align 16 + %B = getelementptr [4 x i8*]* %A, i32 0, i32 0 + store i8* null, i8** %B + %C = bitcast [4 x i8*]* %A to { [16 x i8] }* + %D = getelementptr { [16 x i8] }* %C, i32 0, i32 0, i32 8 + %E = bitcast i8* %D to i8** + store i8* %v, i8** %E + %F = getelementptr [4 x i8*]* %A, i32 0, i32 2 + %G = load i8** %F + ret i8* %G +; CHECK: @test32 +; CHECK: %D = getelementptr [4 x i8*]* %A, i64 0, i64 1 +; CHECK: %F = getelementptr [4 x i8*]* %A, i64 0, i64 2 +} + +; PR3290 +%struct.Key = type { { i32, i32 } } +%struct.anon = type <{ i8, [3 x i8], i32 }> + +define i32 *@test33(%struct.Key *%A) { + %B = bitcast %struct.Key* %A to %struct.anon* + %C = getelementptr %struct.anon* %B, i32 0, i32 2 + ret i32 *%C +; CHECK: @test33 +; CHECK: getelementptr %struct.Key* %A, i64 0, i32 0, i32 1 +} + + + + %T2 = type { i8*, i8 } +define i8* @test34(i8* %Val, i64 %V) nounwind { +entry: + %A = alloca %T2, align 8 + %mrv_gep = bitcast %T2* %A to i64* + %B = getelementptr %T2* %A, i64 0, i32 0 + + store i64 %V, i64* %mrv_gep + %C = load i8** %B, align 8 + ret i8* %C +; CHECK: @test34 +; CHECK: %V.c = inttoptr i64 %V to i8* +; CHECK: ret i8* %V.c +} + +%t0 = type { i8*, [19 x i8] } +%t1 = type { i8*, [0 x i8] } + +@array = external global [11 x i8] + +@s = external global %t0 +@"\01LC8" = external constant [17 x i8] + +; Instcombine should be able to fold this getelementptr. + +define i32 @test35() nounwind { + call i32 (i8*, ...)* @printf(i8* getelementptr ([17 x i8]* @"\01LC8", i32 0, i32 0), + i8* getelementptr (%t1* bitcast (%t0* @s to %t1*), i32 0, i32 1, i32 0)) nounwind + ret i32 0 +; CHECK: @test35 +; CHECK: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @"\01LC8", i64 0, i64 0), i8* bitcast (i8** getelementptr (%t1* bitcast (%t0* @s to %t1*), i64 1, i32 0) to i8*)) nounwind +} + +; Instcombine should constant-fold the GEP so that indices that have +; static array extents are within bounds of those array extents. +; In the below, -1 is not in the range [0,11). After the transformation, +; the same address is computed, but 3 is in the range of [0,11). + +define i8* @test36() nounwind { + ret i8* getelementptr ([11 x i8]* @array, i32 0, i64 -1) +; CHECK: @test36 +; CHECK: ret i8* getelementptr ([11 x i8]* @array, i64 1676976733973595601, i64 4) +} + +; Instcombine shouldn't assume that gep(A,0,1) != gep(A,1,0). +@A37 = external constant [1 x i8] +define i1 @test37() nounwind { +; CHECK: @test37 +; CHECK: ret i1 true + %t = icmp eq i8* getelementptr ([1 x i8]* @A37, i64 0, i64 1), + getelementptr ([1 x i8]* @A37, i64 1, i64 0) + ret i1 %t } diff --git a/test/Transforms/InstCombine/hoist_instr.ll b/test/Transforms/InstCombine/hoist_instr.ll index e425bc2..fa451bc 100644 --- a/test/Transforms/InstCombine/hoist_instr.ll +++ b/test/Transforms/InstCombine/hoist_instr.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ -; RUN: %prcontext div 1 | grep then: +; RUN: opt < %s -instcombine -S | FileCheck %s ;; This tests that the div is hoisted into the then block. define i32 @foo(i1 %C, i32 %A, i32 %B) { @@ -7,6 +6,8 @@ entry: br i1 %C, label %then, label %endif then: ; preds = %entry +; CHECK: then: +; CHECK-NEXT: sdiv i32 br label %endif endif: ; preds = %then, %entry diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index 27136d6..64e88c9 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp +; RUN: opt < %s -instcombine -S | not grep icmp define i32 @test1(i32 %X) { entry: @@ -28,3 +28,17 @@ entry: ret i32 %1 } +; PR4837 +define <2 x i1> @test5(<2 x i64> %x) { +entry: + %V = icmp eq <2 x i64> %x, undef + ret <2 x i1> %V +} + +define i32 @test6(i32 %a, i32 %b) { + %c = icmp sle i32 %a, -1 + %d = zext i1 %c to i32 + %e = sub i32 0, %d + %f = and i32 %e, %b + ret i32 %f +} diff --git a/test/Transforms/InstCombine/known_align.ll b/test/Transforms/InstCombine/known_align.ll index a6e3409..5382abf 100644 --- a/test/Transforms/InstCombine/known_align.ll +++ b/test/Transforms/InstCombine/known_align.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 1} +; RUN: opt < %s -instcombine -S | grep {align 1} ; END. %struct.p = type <{ i8, i32 }> diff --git a/test/Transforms/InstCombine/load.ll b/test/Transforms/InstCombine/load.ll index 85a7495..6d068f5 100644 --- a/test/Transforms/InstCombine/load.ll +++ b/test/Transforms/InstCombine/load.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load +; RUN: opt < %s -instcombine -S | not grep load @X = constant i32 42 ; <i32*> [#uses=2] @X2 = constant i32 47 ; <i32*> [#uses=1] diff --git a/test/Transforms/InstCombine/load2.ll b/test/Transforms/InstCombine/load2.ll index 5c3cf33..611b0fb 100644 --- a/test/Transforms/InstCombine/load2.ll +++ b/test/Transforms/InstCombine/load2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load +; RUN: opt < %s -instcombine -S | not grep load @GLOBAL = internal constant [4 x i32] zeroinitializer diff --git a/test/Transforms/InstCombine/load3.ll b/test/Transforms/InstCombine/load3.ll index e102d39..9c87316 100644 --- a/test/Transforms/InstCombine/load3.ll +++ b/test/Transforms/InstCombine/load3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep load | count 1 +; RUN: opt < %s -instcombine -S | grep load | count 1 ; Instcombine should be able to do trivial CSE of loads. diff --git a/test/Transforms/InstCombine/loadstore-alignment.ll b/test/Transforms/InstCombine/loadstore-alignment.ll index ebea3e4..ff34017 100644 --- a/test/Transforms/InstCombine/loadstore-alignment.ll +++ b/test/Transforms/InstCombine/loadstore-alignment.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {, align 16} | count 14 +; RUN: opt < %s -instcombine -S | grep {, align 16} | count 14 @x = external global <2 x i64>, align 16 @xx = external global [13 x <2 x i64>], align 16 diff --git a/test/Transforms/InstCombine/logical-select.ll b/test/Transforms/InstCombine/logical-select.ll index 3bb2d34..ece8bc3 100644 --- a/test/Transforms/InstCombine/logical-select.ll +++ b/test/Transforms/InstCombine/logical-select.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t ; RUN: grep select %t | count 5 ; RUN: not grep and %t ; RUN: not grep or %t diff --git a/test/Transforms/InstCombine/lshr-phi.ll b/test/Transforms/InstCombine/lshr-phi.ll index 683eb87..76a113f 100644 --- a/test/Transforms/InstCombine/lshr-phi.ll +++ b/test/Transforms/InstCombine/lshr-phi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t ; RUN: not grep lshr %t ; RUN: grep add %t | count 1 diff --git a/test/Transforms/InstCombine/malloc-free-delete.ll b/test/Transforms/InstCombine/malloc-free-delete.ll index 24f793f..2ed5ec6 100644 --- a/test/Transforms/InstCombine/malloc-free-delete.ll +++ b/test/Transforms/InstCombine/malloc-free-delete.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep malloc +; RUN: opt < %s -instcombine -S | grep {ret i32 0} +; RUN: opt < %s -instcombine -S | not grep malloc ; PR1201 define i32 @main(i32 %argc, i8** %argv) { %c_19 = alloca i8* ; <i8**> [#uses=2] diff --git a/test/Transforms/InstCombine/malloc.ll b/test/Transforms/InstCombine/malloc.ll index 6a4601a..b6ebbea 100644 --- a/test/Transforms/InstCombine/malloc.ll +++ b/test/Transforms/InstCombine/malloc.ll @@ -1,5 +1,5 @@ ; test that malloc's with a constant argument are promoted to array allocations -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep getelementptr +; RUN: opt < %s -instcombine -S | grep getelementptr define i32* @test() { %X = malloc i32, i32 4 diff --git a/test/Transforms/InstCombine/malloc2.ll b/test/Transforms/InstCombine/malloc2.ll index eb7c9ab..102422e 100644 --- a/test/Transforms/InstCombine/malloc2.ll +++ b/test/Transforms/InstCombine/malloc2.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep malloc +; RUN: opt < %s -instcombine -S | grep {ret i32 0} +; RUN: opt < %s -instcombine -S | not grep malloc ; PR1313 define i32 @test1(i32 %argc, i8* %argv, i8* %envp) { diff --git a/test/Transforms/InstCombine/malloc3.ll b/test/Transforms/InstCombine/malloc3.ll index f6f412d..cd407ff 100644 --- a/test/Transforms/InstCombine/malloc3.ll +++ b/test/Transforms/InstCombine/malloc3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {malloc.*struct.foo} | count 2 +; RUN: opt < %s -instcombine -S | grep {malloc.*struct.foo} | count 2 ; PR1728 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" diff --git a/test/Transforms/InstCombine/memcpy-to-load.ll b/test/Transforms/InstCombine/memcpy-to-load.ll index 7a0027d..ebb8711 100644 --- a/test/Transforms/InstCombine/memcpy-to-load.ll +++ b/test/Transforms/InstCombine/memcpy-to-load.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {load double} +; RUN: opt < %s -instcombine -S | grep {load double} 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/InstCombine/memmove.ll b/test/Transforms/InstCombine/memmove.ll index 09ec67d..1806cfc 100644 --- a/test/Transforms/InstCombine/memmove.ll +++ b/test/Transforms/InstCombine/memmove.ll @@ -1,6 +1,6 @@ ; This test makes sure that memmove instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {call void @llvm.memmove} @S = internal constant [33 x i8] c"panic: restorelist inconsistency\00" ; <[33 x i8]*> [#uses=1] diff --git a/test/Transforms/InstCombine/memset.ll b/test/Transforms/InstCombine/memset.ll index 27a5b60..8e85694 100644 --- a/test/Transforms/InstCombine/memset.ll +++ b/test/Transforms/InstCombine/memset.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {call.*llvm.memset} +; RUN: opt < %s -instcombine -S | not grep {call.*llvm.memset} declare void @llvm.memset.i32(i8*, i8, i32, i32) diff --git a/test/Transforms/InstCombine/mul-masked-bits.ll b/test/Transforms/InstCombine/mul-masked-bits.ll index 9b0a5bf..a43d5f2 100644 --- a/test/Transforms/InstCombine/mul-masked-bits.ll +++ b/test/Transforms/InstCombine/mul-masked-bits.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ashr +; RUN: opt < %s -instcombine -S | grep ashr define i32 @foo(i32 %x, i32 %y) { %a = and i32 %x, 7 diff --git a/test/Transforms/InstCombine/mul.ll b/test/Transforms/InstCombine/mul.ll index 9b5f7a5..53a5643 100644 --- a/test/Transforms/InstCombine/mul.ll +++ b/test/Transforms/InstCombine/mul.ll @@ -1,5 +1,5 @@ ; This test makes sure that mul instructions are properly eliminated. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; RUN: opt < %s -instcombine -S | not grep mul define i32 @test1(i32 %A) { %B = mul i32 %A, 1 ; <i32> [#uses=1] @@ -83,3 +83,34 @@ define internal void @test13(<4 x float>*) { store <4 x float> %3, <4 x float>* %0, align 1 ret void } + +define <16 x i8> @test14(<16 x i8> %a) { + %b = mul <16 x i8> %a, zeroinitializer + ret <16 x i8> %b +} + +; rdar://7293527 +define i32 @test15(i32 %A, i32 %B) { +entry: + %shl = shl i32 1, %B + %m = mul i32 %shl, %A + ret i32 %m +} + +; X * Y (when Y is 0 or 1) --> x & (0-Y) +define i32 @test16(i32 %b, i1 %c) { + %d = zext i1 %c to i32 ; <i32> [#uses=1] + ; e = b & (a >> 31) + %e = mul i32 %d, %b ; <i32> [#uses=1] + ret i32 %e +} + +; X * Y (when Y is 0 or 1) --> x & (0-Y) +define i32 @test17(i32 %a, i32 %b) { + %a.lobit = lshr i32 %a, 31 + %e = mul i32 %a.lobit, %b + ret i32 %e +} + + + diff --git a/test/Transforms/InstCombine/multi-use-or.ll b/test/Transforms/InstCombine/multi-use-or.ll index 4804967..9bbef23 100644 --- a/test/Transforms/InstCombine/multi-use-or.ll +++ b/test/Transforms/InstCombine/multi-use-or.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add double .sx, .sy} +; RUN: opt < %s -instcombine -S | grep {add double .sx, .sy} ; The 'or' has multiple uses, make sure that this doesn't prevent instcombine ; from propagating the extends to the truncs. diff --git a/test/Transforms/InstCombine/narrow.ll b/test/Transforms/InstCombine/narrow.ll index 41106e7..1b96a06 100644 --- a/test/Transforms/InstCombine/narrow.ll +++ b/test/Transforms/InstCombine/narrow.ll @@ -1,6 +1,6 @@ ; This file contains various testcases that check to see that instcombine ; is narrowing computations when possible. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {ret i1 false} ; test1 - Eliminating the casts in this testcase (by narrowing the AND diff --git a/test/Transforms/InstCombine/no-negzero.ll b/test/Transforms/InstCombine/no-negzero.ll new file mode 100644 index 0000000..f295130 --- /dev/null +++ b/test/Transforms/InstCombine/no-negzero.ll @@ -0,0 +1,33 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s +; ModuleID = '3555a.c' +; sqrt(fabs) cannot be negative zero, so we should eliminate the fadd. +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" +target triple = "i386-apple-darwin9.8" + +; CHECK: @mysqrt +; CHECK-NOT: fadd +; CHECK: ret +define double @mysqrt(double %x) nounwind { +entry: + %x_addr = alloca double ; <double*> [#uses=2] + %retval = alloca double, align 8 ; <double*> [#uses=2] + %0 = alloca double, align 8 ; <double*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] + store double %x, double* %x_addr + %1 = load double* %x_addr, align 8 ; <double> [#uses=1] + %2 = call double @fabs(double %1) nounwind readnone ; <double> [#uses=1] + %3 = call double @sqrt(double %2) nounwind readonly ; <double> [#uses=1] + %4 = fadd double %3, 0.000000e+00 ; <double> [#uses=1] + store double %4, double* %0, align 8 + %5 = load double* %0, align 8 ; <double> [#uses=1] + store double %5, double* %retval, align 8 + br label %return + +return: ; preds = %entry + %retval1 = load double* %retval ; <double> [#uses=1] + ret double %retval1 +} + +declare double @fabs(double) + +declare double @sqrt(double) nounwind readonly diff --git a/test/Transforms/InstCombine/not-fcmp.ll b/test/Transforms/InstCombine/not-fcmp.ll index 4560419..ad01a6b 100644 --- a/test/Transforms/InstCombine/not-fcmp.ll +++ b/test/Transforms/InstCombine/not-fcmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep "fcmp uge" +; RUN: opt < %s -instcombine -S | grep "fcmp uge" ; PR1570 define i1 @f(float %X, float %Y) { diff --git a/test/Transforms/InstCombine/not.ll b/test/Transforms/InstCombine/not.ll index a79e518..c58ce11 100644 --- a/test/Transforms/InstCombine/not.ll +++ b/test/Transforms/InstCombine/not.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep xor +; RUN: opt < %s -instcombine -S | not grep xor define i32 @test1(i32 %A) { %B = xor i32 %A, -1 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/nothrow.ll b/test/Transforms/InstCombine/nothrow.ll index fbf162a..08d90bf 100644 --- a/test/Transforms/InstCombine/nothrow.ll +++ b/test/Transforms/InstCombine/nothrow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep call +; RUN: opt < %s -instcombine -S | not grep call ; rdar://6880732 declare double @t1(i32) readonly diff --git a/test/Transforms/InstCombine/nsw.ll b/test/Transforms/InstCombine/nsw.ll new file mode 100644 index 0000000..821cebe --- /dev/null +++ b/test/Transforms/InstCombine/nsw.ll @@ -0,0 +1,20 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +; CHECK: define i32 @foo +; %y = sub i32 0, %x +; %z = sdiv i32 %y, 337 +; ret i32 %y +define i32 @foo(i32 %x) { + %y = sub i32 0, %x + %z = sdiv i32 %y, 337 + ret i32 %y +} + +; CHECK: define i32 @bar +; %y = sdiv i32 %x, -337 +; ret i32 %y +define i32 @bar(i32 %x) { + %y = sub nsw i32 0, %x + %z = sdiv i32 %y, 337 + ret i32 %y +} diff --git a/test/Transforms/InstCombine/odr-linkage.ll b/test/Transforms/InstCombine/odr-linkage.ll index 96f8833..a64ef28 100644 --- a/test/Transforms/InstCombine/odr-linkage.ll +++ b/test/Transforms/InstCombine/odr-linkage.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 10} +; RUN: opt < %s -instcombine -S | grep {ret i32 10} @g1 = available_externally constant i32 1 @g2 = linkonce_odr constant i32 2 diff --git a/test/Transforms/InstCombine/or-fcmp.ll b/test/Transforms/InstCombine/or-fcmp.ll index 3833c6f..9692bfc 100644 --- a/test/Transforms/InstCombine/or-fcmp.ll +++ b/test/Transforms/InstCombine/or-fcmp.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep fcmp | count 3 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret | grep 1 +; RUN: opt < %s -instcombine -S | grep fcmp | count 3 +; RUN: opt < %s -instcombine -S | grep ret | grep 1 define zeroext i8 @t1(float %x, float %y) nounwind { %a = fcmp ueq float %x, %y ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/or-to-xor.ll b/test/Transforms/InstCombine/or-to-xor.ll index e40417b..1495ee4 100644 --- a/test/Transforms/InstCombine/or-to-xor.ll +++ b/test/Transforms/InstCombine/or-to-xor.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {xor i32 %a, %b} | count 4 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and} +; RUN: opt < %s -instcombine -S | grep {xor i32 %a, %b} | count 4 +; RUN: opt < %s -instcombine -S | not grep {and} define i32 @func1(i32 %a, i32 %b) nounwind readnone { entry: diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index e70fb1c..37f934b 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v xor | not grep {or } ; END. diff --git a/test/Transforms/InstCombine/or2.ll b/test/Transforms/InstCombine/or2.ll index f14a274..c01229a 100644 --- a/test/Transforms/InstCombine/or2.ll +++ b/test/Transforms/InstCombine/or2.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v xor | not grep {or } +; RUN: opt < %s -instcombine -S | grep -v xor | not grep {or } ; PR1738 define i1 @test1(double %X, double %Y) { diff --git a/test/Transforms/InstCombine/phi-merge-gep.ll b/test/Transforms/InstCombine/phi-merge-gep.ll new file mode 100644 index 0000000..2671749 --- /dev/null +++ b/test/Transforms/InstCombine/phi-merge-gep.ll @@ -0,0 +1,102 @@ +; RUN: opt < %s -S -instcombine > %t +; RUN: grep {= getelementptr} %t | count 20 +; RUN: grep {= phi} %t | count 13 + +; Don't push the geps through these phis, because they would require +; two phis each, which burdens the loop with high register pressure. + +define void @foo(float* %Ar, float* %Ai, i64 %As, float* %Cr, float* %Ci, i64 %Cs, i64 %n) nounwind { +entry: + %0 = getelementptr inbounds float* %Ar, i64 0 ; <float*> [#uses=1] + %1 = getelementptr inbounds float* %Ai, i64 0 ; <float*> [#uses=1] + %2 = mul i64 %n, %As ; <i64> [#uses=1] + %3 = getelementptr inbounds float* %Ar, i64 %2 ; <float*> [#uses=1] + %4 = mul i64 %n, %As ; <i64> [#uses=1] + %5 = getelementptr inbounds float* %Ai, i64 %4 ; <float*> [#uses=1] + %6 = mul i64 %n, 2 ; <i64> [#uses=1] + %7 = mul i64 %6, %As ; <i64> [#uses=1] + %8 = getelementptr inbounds float* %Ar, i64 %7 ; <float*> [#uses=1] + %9 = mul i64 %n, 2 ; <i64> [#uses=1] + %10 = mul i64 %9, %As ; <i64> [#uses=1] + %11 = getelementptr inbounds float* %Ai, i64 %10 ; <float*> [#uses=1] + %12 = getelementptr inbounds float* %Cr, i64 0 ; <float*> [#uses=1] + %13 = getelementptr inbounds float* %Ci, i64 0 ; <float*> [#uses=1] + %14 = mul i64 %n, %Cs ; <i64> [#uses=1] + %15 = getelementptr inbounds float* %Cr, i64 %14 ; <float*> [#uses=1] + %16 = mul i64 %n, %Cs ; <i64> [#uses=1] + %17 = getelementptr inbounds float* %Ci, i64 %16 ; <float*> [#uses=1] + %18 = mul i64 %n, 2 ; <i64> [#uses=1] + %19 = mul i64 %18, %Cs ; <i64> [#uses=1] + %20 = getelementptr inbounds float* %Cr, i64 %19 ; <float*> [#uses=1] + %21 = mul i64 %n, 2 ; <i64> [#uses=1] + %22 = mul i64 %21, %Cs ; <i64> [#uses=1] + %23 = getelementptr inbounds float* %Ci, i64 %22 ; <float*> [#uses=1] + br label %bb13 + +bb: ; preds = %bb13 + %24 = load float* %A0r.0, align 4 ; <float> [#uses=1] + %25 = load float* %A0i.0, align 4 ; <float> [#uses=1] + %26 = load float* %A1r.0, align 4 ; <float> [#uses=2] + %27 = load float* %A1i.0, align 4 ; <float> [#uses=2] + %28 = load float* %A2r.0, align 4 ; <float> [#uses=2] + %29 = load float* %A2i.0, align 4 ; <float> [#uses=2] + %30 = fadd float %26, %28 ; <float> [#uses=2] + %31 = fadd float %27, %29 ; <float> [#uses=2] + %32 = fsub float %26, %28 ; <float> [#uses=1] + %33 = fsub float %27, %29 ; <float> [#uses=1] + %34 = fadd float %24, %30 ; <float> [#uses=2] + %35 = fadd float %25, %31 ; <float> [#uses=2] + %36 = fmul float %30, -1.500000e+00 ; <float> [#uses=1] + %37 = fmul float %31, -1.500000e+00 ; <float> [#uses=1] + %38 = fadd float %34, %36 ; <float> [#uses=2] + %39 = fadd float %35, %37 ; <float> [#uses=2] + %40 = fmul float %32, 0x3FEBB67AE0000000 ; <float> [#uses=2] + %41 = fmul float %33, 0x3FEBB67AE0000000 ; <float> [#uses=2] + %42 = fadd float %38, %41 ; <float> [#uses=1] + %43 = fsub float %39, %40 ; <float> [#uses=1] + %44 = fsub float %38, %41 ; <float> [#uses=1] + %45 = fadd float %39, %40 ; <float> [#uses=1] + store float %34, float* %C0r.0, align 4 + store float %35, float* %C0i.0, align 4 + store float %42, float* %C1r.0, align 4 + store float %43, float* %C1i.0, align 4 + store float %44, float* %C2r.0, align 4 + store float %45, float* %C2i.0, align 4 + %46 = getelementptr inbounds float* %A0r.0, i64 %As ; <float*> [#uses=1] + %47 = getelementptr inbounds float* %A0i.0, i64 %As ; <float*> [#uses=1] + %48 = getelementptr inbounds float* %A1r.0, i64 %As ; <float*> [#uses=1] + %49 = getelementptr inbounds float* %A1i.0, i64 %As ; <float*> [#uses=1] + %50 = getelementptr inbounds float* %A2r.0, i64 %As ; <float*> [#uses=1] + %51 = getelementptr inbounds float* %A2i.0, i64 %As ; <float*> [#uses=1] + %52 = getelementptr inbounds float* %C0r.0, i64 %Cs ; <float*> [#uses=1] + %53 = getelementptr inbounds float* %C0i.0, i64 %Cs ; <float*> [#uses=1] + %54 = getelementptr inbounds float* %C1r.0, i64 %Cs ; <float*> [#uses=1] + %55 = getelementptr inbounds float* %C1i.0, i64 %Cs ; <float*> [#uses=1] + %56 = getelementptr inbounds float* %C2r.0, i64 %Cs ; <float*> [#uses=1] + %57 = getelementptr inbounds float* %C2i.0, i64 %Cs ; <float*> [#uses=1] + %58 = add nsw i64 %i.0, 1 ; <i64> [#uses=1] + br label %bb13 + +bb13: ; preds = %bb, %entry + %i.0 = phi i64 [ 0, %entry ], [ %58, %bb ] ; <i64> [#uses=2] + %C2i.0 = phi float* [ %23, %entry ], [ %57, %bb ] ; <float*> [#uses=2] + %C2r.0 = phi float* [ %20, %entry ], [ %56, %bb ] ; <float*> [#uses=2] + %C1i.0 = phi float* [ %17, %entry ], [ %55, %bb ] ; <float*> [#uses=2] + %C1r.0 = phi float* [ %15, %entry ], [ %54, %bb ] ; <float*> [#uses=2] + %C0i.0 = phi float* [ %13, %entry ], [ %53, %bb ] ; <float*> [#uses=2] + %C0r.0 = phi float* [ %12, %entry ], [ %52, %bb ] ; <float*> [#uses=2] + %A2i.0 = phi float* [ %11, %entry ], [ %51, %bb ] ; <float*> [#uses=2] + %A2r.0 = phi float* [ %8, %entry ], [ %50, %bb ] ; <float*> [#uses=2] + %A1i.0 = phi float* [ %5, %entry ], [ %49, %bb ] ; <float*> [#uses=2] + %A1r.0 = phi float* [ %3, %entry ], [ %48, %bb ] ; <float*> [#uses=2] + %A0i.0 = phi float* [ %1, %entry ], [ %47, %bb ] ; <float*> [#uses=2] + %A0r.0 = phi float* [ %0, %entry ], [ %46, %bb ] ; <float*> [#uses=2] + %59 = icmp slt i64 %i.0, %n ; <i1> [#uses=1] + br i1 %59, label %bb, label %bb14 + +bb14: ; preds = %bb13 + br label %return + +return: ; preds = %bb14 + ret void +} diff --git a/test/Transforms/InstCombine/phi-merge.ll b/test/Transforms/InstCombine/phi-merge.ll index daac412..c41f503 100644 --- a/test/Transforms/InstCombine/phi-merge.ll +++ b/test/Transforms/InstCombine/phi-merge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {phi i32} +; RUN: opt < %s -instcombine -S | not grep {phi i32} ; PR1777 declare i1 @rrr() diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index 4efbb79..24eca72 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep phi +; RUN: opt < %s -instcombine -S | not grep phi define i32 @test1(i32 %A, i1 %b) { BB0: diff --git a/test/Transforms/InstCombine/pr2645-0.ll b/test/Transforms/InstCombine/pr2645-0.ll index 04cc185..9bcaa43 100644 --- a/test/Transforms/InstCombine/pr2645-0.ll +++ b/test/Transforms/InstCombine/pr2645-0.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {insertelement <4 x float> undef} +; RUN: opt < %s -instcombine -S | grep {insertelement <4 x float> undef} ; Instcombine should be able to prove that none of the ; insertelement's first operand's elements are needed. diff --git a/test/Transforms/InstCombine/pr2645-1.ll b/test/Transforms/InstCombine/pr2645-1.ll index 194d2cd..d320daf 100644 --- a/test/Transforms/InstCombine/pr2645-1.ll +++ b/test/Transforms/InstCombine/pr2645-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shufflevector +; RUN: opt < %s -instcombine -S | grep shufflevector ; PR2645 ; instcombine shouldn't delete the shufflevector. diff --git a/test/Transforms/InstCombine/pr2996.ll b/test/Transforms/InstCombine/pr2996.ll index 3e7dfa2..ff3245d 100644 --- a/test/Transforms/InstCombine/pr2996.ll +++ b/test/Transforms/InstCombine/pr2996.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine ; PR2996 define void @func_53(i16 signext %p_56) nounwind { diff --git a/test/Transforms/InstCombine/preserve-sminmax.ll b/test/Transforms/InstCombine/preserve-sminmax.ll index 24fb7da..dbfd56a 100644 --- a/test/Transforms/InstCombine/preserve-sminmax.ll +++ b/test/Transforms/InstCombine/preserve-sminmax.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep { i32 \[%\]sd, \[\[:alnum:\]\]* \\?1\\>} | count 4 +; RUN: opt < %s -instcombine -S | grep { i32 \[%\]sd, \[\[:alnum:\]\]* \\?1\\>} | count 4 ; Instcombine normally would fold the sdiv into the comparison, ; making "icmp slt i32 %h, 2", but in this case the sdiv has diff --git a/test/Transforms/InstCombine/ptr-int-cast.ll b/test/Transforms/InstCombine/ptr-int-cast.ll index 5c15439..2f64d8b 100644 --- a/test/Transforms/InstCombine/ptr-int-cast.ll +++ b/test/Transforms/InstCombine/ptr-int-cast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t define i1 @test1(i32 *%x) nounwind { entry: diff --git a/test/Transforms/InstCombine/rem.ll b/test/Transforms/InstCombine/rem.ll index 8b2263d..bac248e 100644 --- a/test/Transforms/InstCombine/rem.ll +++ b/test/Transforms/InstCombine/rem.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem +; RUN: opt < %s -instcombine -S | not grep rem ; END. define i32 @test1(i32 %A) { diff --git a/test/Transforms/InstCombine/sdiv-1.ll b/test/Transforms/InstCombine/sdiv-1.ll index 305b6d7..c46b5ea 100644 --- a/test/Transforms/InstCombine/sdiv-1.ll +++ b/test/Transforms/InstCombine/sdiv-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -inline | llvm-dis | not grep '-715827882' +; RUN: opt < %s -instcombine -inline -S | not grep '-715827882' ; PR3142 define i32 @a(i32 %X) nounwind readnone { diff --git a/test/Transforms/InstCombine/sdiv-2.ll b/test/Transforms/InstCombine/sdiv-2.ll index db0c7fb..0e4c008 100644 --- a/test/Transforms/InstCombine/sdiv-2.ll +++ b/test/Transforms/InstCombine/sdiv-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -disable-output +; RUN: opt < %s -instcombine -disable-output ; PR3144 define fastcc i32 @func(i32 %length) nounwind { diff --git a/test/Transforms/InstCombine/sdiv-shift.ll b/test/Transforms/InstCombine/sdiv-shift.ll new file mode 100644 index 0000000..f4d2b36 --- /dev/null +++ b/test/Transforms/InstCombine/sdiv-shift.ll @@ -0,0 +1,9 @@ +; RUN: opt < %s -instcombine -S | not grep div + +define i32 @a(i16 zeroext %x, i32 %y) nounwind { +entry: + %conv = zext i16 %x to i32 + %s = shl i32 2, %y + %d = sdiv i32 %conv, %s + ret i32 %d +} diff --git a/test/Transforms/InstCombine/select-2.ll b/test/Transforms/InstCombine/select-2.ll index 4621f6e..a76addc 100644 --- a/test/Transforms/InstCombine/select-2.ll +++ b/test/Transforms/InstCombine/select-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select | count 2 +; RUN: opt < %s -instcombine -S | grep select | count 2 ; Make sure instcombine don't fold select into operands. We don't want to emit ; select of two integers unless it's selecting 0 / 1. diff --git a/test/Transforms/InstCombine/select-load-call.ll b/test/Transforms/InstCombine/select-load-call.ll index 367356e..bef0cf8 100644 --- a/test/Transforms/InstCombine/select-load-call.ll +++ b/test/Transforms/InstCombine/select-load-call.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 1} +; RUN: opt < %s -instcombine -S | grep {ret i32 1} declare void @test2() diff --git a/test/Transforms/InstCombine/select.ll b/test/Transforms/InstCombine/select.ll index 15083f2..b04382e 100644 --- a/test/Transforms/InstCombine/select.ll +++ b/test/Transforms/InstCombine/select.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; PR1822 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select +; RUN: opt < %s -instcombine -S | not grep select define i32 @test1(i32 %A, i32 %B) { %C = select i1 false, i32 %A, i32 %B ; <i32> [#uses=1] @@ -202,3 +202,64 @@ define i1 @test24(i1 %a, i1 %b) { ret i1 %c } +define i32 @test25(i1 %c) { +entry: + br i1 %c, label %jump, label %ret +jump: + br label %ret +ret: + %a = phi i1 [true, %jump], [false, %entry] + %b = select i1 %a, i32 10, i32 20 + ret i32 %b +} + +define i32 @test26(i1 %cond) { +entry: + br i1 %cond, label %jump, label %ret +jump: + %c = or i1 false, false + br label %ret +ret: + %a = phi i1 [true, %jump], [%c, %entry] + %b = select i1 %a, i32 10, i32 20 + ret i32 %b +} + +define i32 @test27(i1 %c, i32 %A, i32 %B) { +entry: + br i1 %c, label %jump, label %ret +jump: + br label %ret +ret: + %a = phi i1 [true, %jump], [false, %entry] + %b = select i1 %a, i32 %A, i32 %B + ret i32 %b +} + +define i32 @test28(i1 %cond, i32 %A, i32 %B) { +entry: + br i1 %cond, label %jump, label %ret +jump: + br label %ret +ret: + %c = phi i32 [%A, %jump], [%B, %entry] + %a = phi i1 [true, %jump], [false, %entry] + %b = select i1 %a, i32 %A, i32 %c + ret i32 %b +} + +define i32 @test29(i1 %cond, i32 %A, i32 %B) { +entry: + br i1 %cond, label %jump, label %ret +jump: + br label %ret +ret: + %c = phi i32 [%A, %jump], [%B, %entry] + %a = phi i1 [true, %jump], [false, %entry] + br label %next + +next: + %b = select i1 %a, i32 %A, i32 %c + ret i32 %b +} + diff --git a/test/Transforms/InstCombine/set.ll b/test/Transforms/InstCombine/set.ll index 5e3ca0b..daa9148 100644 --- a/test/Transforms/InstCombine/set.ll +++ b/test/Transforms/InstCombine/set.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp +; RUN: opt < %s -instcombine -S | not grep icmp ; END. @X = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/InstCombine/setcc-cast-cast.ll b/test/Transforms/InstCombine/setcc-cast-cast.ll index ed2e2be..b2681ea 100644 --- a/test/Transforms/InstCombine/setcc-cast-cast.ll +++ b/test/Transforms/InstCombine/setcc-cast-cast.ll @@ -1,7 +1,7 @@ ; This test case was reduced from MultiSource/Applications/hbd. It makes sure ; that folding doesn't happen in case a zext is applied where a sext should have ; been when a setcc is used with two casts. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {br i1 false} ; END. diff --git a/test/Transforms/InstCombine/setcc-strength-reduce.ll b/test/Transforms/InstCombine/setcc-strength-reduce.ll index 9931ccb..62ab116 100644 --- a/test/Transforms/InstCombine/setcc-strength-reduce.ll +++ b/test/Transforms/InstCombine/setcc-strength-reduce.ll @@ -2,7 +2,7 @@ ; working. Basically this boils down to converting setlt,gt,le,ge instructions ; into equivalent setne,eq instructions. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v {icmp eq} | grep -v {icmp ne} | not grep icmp ; END. diff --git a/test/Transforms/InstCombine/sext-misc.ll b/test/Transforms/InstCombine/sext-misc.ll index 5874966..107bba6 100644 --- a/test/Transforms/InstCombine/sext-misc.ll +++ b/test/Transforms/InstCombine/sext-misc.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sext +; RUN: opt < %s -instcombine -S | not grep sext declare i32 @llvm.ctpop.i32(i32) declare i32 @llvm.ctlz.i32(i32) diff --git a/test/Transforms/InstCombine/shift-simplify.ll b/test/Transforms/InstCombine/shift-simplify.ll index ecf3f5f..e5cc705 100644 --- a/test/Transforms/InstCombine/shift-simplify.ll +++ b/test/Transforms/InstCombine/shift-simplify.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: egrep {shl|lshr|ashr} | count 3 define i32 @test0(i32 %A, i32 %B, i32 %C) { diff --git a/test/Transforms/InstCombine/shift-sra.ll b/test/Transforms/InstCombine/shift-sra.ll index 6058bd6..4492785 100644 --- a/test/Transforms/InstCombine/shift-sra.ll +++ b/test/Transforms/InstCombine/shift-sra.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {lshr i32} | count 2 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ashr +; RUN: opt < %s -instcombine -S | not grep ashr define i32 @test1(i32 %X, i8 %A) { diff --git a/test/Transforms/InstCombine/shift-trunc-shift.ll b/test/Transforms/InstCombine/shift-trunc-shift.ll index bf9f407..7133d29 100644 --- a/test/Transforms/InstCombine/shift-trunc-shift.ll +++ b/test/Transforms/InstCombine/shift-trunc-shift.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep lshr.*63 +; RUN: opt < %s -instcombine -S | grep lshr.*63 define i32 @t1(i64 %d18) { entry: diff --git a/test/Transforms/InstCombine/shift.ll b/test/Transforms/InstCombine/shift.ll index 9dc7755..feed37b 100644 --- a/test/Transforms/InstCombine/shift.ll +++ b/test/Transforms/InstCombine/shift.ll @@ -1,25 +1,32 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sh -; END. +; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @test1(i32 %A) { +; CHECK: @test1 +; CHECK: ret i32 %A %B = shl i32 %A, 0 ; <i32> [#uses=1] ret i32 %B } define i32 @test2(i8 %A) { +; CHECK: @test2 +; CHECK: ret i32 0 %shift.upgrd.1 = zext i8 %A to i32 ; <i32> [#uses=1] %B = shl i32 0, %shift.upgrd.1 ; <i32> [#uses=1] ret i32 %B } define i32 @test3(i32 %A) { +; CHECK: @test3 +; CHECK: ret i32 %A %B = ashr i32 %A, 0 ; <i32> [#uses=1] ret i32 %B } define i32 @test4(i8 %A) { +; CHECK: @test4 +; CHECK: ret i32 0 %shift.upgrd.2 = zext i8 %A to i32 ; <i32> [#uses=1] %B = ashr i32 0, %shift.upgrd.2 ; <i32> [#uses=1] ret i32 %B @@ -27,22 +34,31 @@ define i32 @test4(i8 %A) { define i32 @test5(i32 %A) { +; CHECK: @test5 +; CHECK: ret i32 0 %B = lshr i32 %A, 32 ;; shift all bits out ret i32 %B } define i32 @test5a(i32 %A) { +; CHECK: @test5a +; CHECK: ret i32 0 %B = shl i32 %A, 32 ;; shift all bits out ret i32 %B } define i32 @test6(i32 %A) { +; CHECK: @test6 +; CHECK-NEXT: mul i32 %A, 6 +; CHECK-NEXT: ret i32 %B = shl i32 %A, 1 ;; convert to an mul instruction %C = mul i32 %B, 3 ret i32 %C } define i32 @test7(i8 %A) { +; CHECK: @test7 +; CHECK-NEXT: ret i32 -1 %shift.upgrd.3 = zext i8 %A to i32 %B = ashr i32 -1, %shift.upgrd.3 ;; Always equal to -1 ret i32 %B @@ -50,6 +66,8 @@ define i32 @test7(i8 %A) { ;; (A << 5) << 3 === A << 8 == 0 define i8 @test8(i8 %A) { +; CHECK: @test8 +; CHECK: ret i8 0 %B = shl i8 %A, 5 ; <i8> [#uses=1] %C = shl i8 %B, 3 ; <i8> [#uses=1] ret i8 %C @@ -57,6 +75,9 @@ define i8 @test8(i8 %A) { ;; (A << 7) >> 7 === A & 1 define i8 @test9(i8 %A) { +; CHECK: @test9 +; CHECK-NEXT: and i8 %A, 1 +; CHECK-NEXT: ret i8 %B = shl i8 %A, 7 ; <i8> [#uses=1] %C = lshr i8 %B, 7 ; <i8> [#uses=1] ret i8 %C @@ -64,6 +85,9 @@ define i8 @test9(i8 %A) { ;; (A >> 7) << 7 === A & 128 define i8 @test10(i8 %A) { +; CHECK: @test10 +; CHECK-NEXT: and i8 %A, -128 +; CHECK-NEXT: ret i8 %B = lshr i8 %A, 7 ; <i8> [#uses=1] %C = shl i8 %B, 7 ; <i8> [#uses=1] ret i8 %C @@ -71,6 +95,10 @@ define i8 @test10(i8 %A) { ;; (A >> 3) << 4 === (A & 0x1F) << 1 define i8 @test11(i8 %A) { +; CHECK: @test11 +; CHECK-NEXT: mul i8 %A, 6 +; CHECK-NEXT: and i8 +; CHECK-NEXT: ret i8 %a = mul i8 %A, 3 ; <i8> [#uses=1] %B = lshr i8 %a, 3 ; <i8> [#uses=1] %C = shl i8 %B, 4 ; <i8> [#uses=1] @@ -79,6 +107,9 @@ define i8 @test11(i8 %A) { ;; (A >> 8) << 8 === A & -256 define i32 @test12(i32 %A) { +; CHECK: @test12 +; CHECK-NEXT: and i32 %A, -256 +; CHECK-NEXT: ret i32 %B = ashr i32 %A, 8 ; <i32> [#uses=1] %C = shl i32 %B, 8 ; <i32> [#uses=1] ret i32 %C @@ -86,6 +117,10 @@ define i32 @test12(i32 %A) { ;; (A >> 3) << 4 === (A & -8) * 2 define i8 @test13(i8 %A) { +; CHECK: @test13 +; CHECK-NEXT: mul i8 %A, 6 +; CHECK-NEXT: and i8 +; CHECK-NEXT: ret i8 %a = mul i8 %A, 3 ; <i8> [#uses=1] %B = ashr i8 %a, 3 ; <i8> [#uses=1] %C = shl i8 %B, 4 ; <i8> [#uses=1] @@ -94,6 +129,10 @@ define i8 @test13(i8 %A) { ;; D = ((B | 1234) << 4) === ((B << 4)|(1234 << 4) define i32 @test14(i32 %A) { +; CHECK: @test14 +; CHECK-NEXT: or i32 %A, 19744 +; CHECK-NEXT: and i32 +; CHECK-NEXT: ret i32 %B = lshr i32 %A, 4 ; <i32> [#uses=1] %C = or i32 %B, 1234 ; <i32> [#uses=1] %D = shl i32 %C, 4 ; <i32> [#uses=1] @@ -102,6 +141,9 @@ define i32 @test14(i32 %A) { ;; D = ((B | 1234) << 4) === ((B << 4)|(1234 << 4) define i32 @test14a(i32 %A) { +; CHECK: @test14a +; CHECK-NEXT: and i32 %A, 77 +; CHECK-NEXT: ret i32 %B = shl i32 %A, 4 ; <i32> [#uses=1] %C = and i32 %B, 1234 ; <i32> [#uses=1] %D = lshr i32 %C, 4 ; <i32> [#uses=1] @@ -109,12 +151,18 @@ define i32 @test14a(i32 %A) { } define i32 @test15(i1 %C) { +; CHECK: @test15 +; CHECK-NEXT: select i1 %C, i32 12, i32 4 +; CHECK-NEXT: ret i32 %A = select i1 %C, i32 3, i32 1 ; <i32> [#uses=1] %V = shl i32 %A, 2 ; <i32> [#uses=1] ret i32 %V } define i32 @test15a(i1 %C) { +; CHECK: @test15a +; CHECK-NEXT: select i1 %C, i32 512, i32 128 +; CHECK-NEXT: ret i32 %A = select i1 %C, i8 3, i8 1 ; <i8> [#uses=1] %shift.upgrd.4 = zext i8 %A to i32 ; <i32> [#uses=1] %V = shl i32 64, %shift.upgrd.4 ; <i32> [#uses=1] @@ -122,13 +170,21 @@ define i32 @test15a(i1 %C) { } define i1 @test16(i32 %X) { - %tmp.3 = ashr i32 %X, 4 ; <i32> [#uses=1] - %tmp.6 = and i32 %tmp.3, 1 ; <i32> [#uses=1] - %tmp.7 = icmp ne i32 %tmp.6, 0 ; <i1> [#uses=1] +; CHECK: @test16 +; CHECK-NEXT: and i32 %X, 16 +; CHECK-NEXT: icmp ne i32 +; CHECK-NEXT: ret i1 + %tmp.3 = ashr i32 %X, 4 + %tmp.6 = and i32 %tmp.3, 1 + %tmp.7 = icmp ne i32 %tmp.6, 0 ret i1 %tmp.7 } define i1 @test17(i32 %A) { +; CHECK: @test17 +; CHECK-NEXT: and i32 %A, -8 +; CHECK-NEXT: icmp eq i32 +; CHECK-NEXT: ret i1 %B = lshr i32 %A, 3 ; <i32> [#uses=1] %C = icmp eq i32 %B, 1234 ; <i1> [#uses=1] ret i1 %C @@ -136,6 +192,9 @@ define i1 @test17(i32 %A) { define i1 @test18(i8 %A) { +; CHECK: @test18 +; CHECK: ret i1 false + %B = lshr i8 %A, 7 ; <i8> [#uses=1] ;; false %C = icmp eq i8 %B, 123 ; <i1> [#uses=1] @@ -143,6 +202,9 @@ define i1 @test18(i8 %A) { } define i1 @test19(i32 %A) { +; CHECK: @test19 +; CHECK-NEXT: icmp ult i32 %A, 4 +; CHECK-NEXT: ret i1 %B = ashr i32 %A, 2 ; <i32> [#uses=1] ;; (X & -4) == 0 %C = icmp eq i32 %B, 0 ; <i1> [#uses=1] @@ -151,6 +213,10 @@ define i1 @test19(i32 %A) { define i1 @test19a(i32 %A) { +; CHECK: @test19a +; CHECK-NEXT: and i32 %A, -4 +; CHECK-NEXT: icmp eq i32 +; CHECK-NEXT: ret i1 %B = ashr i32 %A, 2 ; <i32> [#uses=1] ;; (X & -4) == -4 %C = icmp eq i32 %B, -1 ; <i1> [#uses=1] @@ -158,6 +224,8 @@ define i1 @test19a(i32 %A) { } define i1 @test20(i8 %A) { +; CHECK: @test20 +; CHECK: ret i1 false %B = ashr i8 %A, 7 ; <i8> [#uses=1] ;; false %C = icmp eq i8 %B, 123 ; <i1> [#uses=1] @@ -165,18 +233,30 @@ define i1 @test20(i8 %A) { } define i1 @test21(i8 %A) { +; CHECK: @test21 +; CHECK-NEXT: and i8 %A, 15 +; CHECK-NEXT: icmp eq i8 +; CHECK-NEXT: ret i1 %B = shl i8 %A, 4 ; <i8> [#uses=1] %C = icmp eq i8 %B, -128 ; <i1> [#uses=1] ret i1 %C } define i1 @test22(i8 %A) { +; CHECK: @test22 +; CHECK-NEXT: and i8 %A, 15 +; CHECK-NEXT: icmp eq i8 +; CHECK-NEXT: ret i1 %B = shl i8 %A, 4 ; <i8> [#uses=1] %C = icmp eq i8 %B, 0 ; <i1> [#uses=1] ret i1 %C } define i8 @test23(i32 %A) { +; CHECK: @test23 +; CHECK-NEXT: trunc i32 %A to i8 +; CHECK-NEXT: ret i8 + ;; casts not needed %B = shl i32 %A, 24 ; <i32> [#uses=1] %C = ashr i32 %B, 24 ; <i32> [#uses=1] @@ -185,6 +265,9 @@ define i8 @test23(i32 %A) { } define i8 @test24(i8 %X) { +; CHECK: @test24 +; CHECK-NEXT: and i8 %X, 3 +; CHECK-NEXT: ret i8 %Y = and i8 %X, -5 ; <i8> [#uses=1] %Z = shl i8 %Y, 5 ; <i8> [#uses=1] %Q = ashr i8 %Z, 5 ; <i8> [#uses=1] @@ -192,6 +275,11 @@ define i8 @test24(i8 %X) { } define i32 @test25(i32 %tmp.2, i32 %AA) { +; CHECK: @test25 +; CHECK-NEXT: and i32 %tmp.2, -131072 +; CHECK-NEXT: add i32 %{{[^,]*}}, %AA +; CHECK-NEXT: and i32 %{{[^,]*}}, -131072 +; CHECK-NEXT: ret i32 %x = lshr i32 %AA, 17 ; <i32> [#uses=1] %tmp.3 = lshr i32 %tmp.2, 17 ; <i32> [#uses=1] %tmp.5 = add i32 %tmp.3, %x ; <i32> [#uses=1] @@ -201,6 +289,9 @@ define i32 @test25(i32 %tmp.2, i32 %AA) { ;; handle casts between shifts. define i32 @test26(i32 %A) { +; CHECK: @test26 +; CHECK-NEXT: and i32 %A, -2 +; CHECK-NEXT: ret i32 %B = lshr i32 %A, 1 ; <i32> [#uses=1] %C = bitcast i32 %B to i32 ; <i32> [#uses=1] %D = shl i32 %C, 1 ; <i32> [#uses=1] @@ -209,8 +300,46 @@ define i32 @test26(i32 %A) { define i1 @test27(i32 %x) nounwind { +; CHECK: @test27 +; CHECK-NEXT: and i32 %x, 8 +; CHECK-NEXT: icmp ne i32 +; CHECK-NEXT: ret i1 %y = lshr i32 %x, 3 %z = trunc i32 %y to i1 ret i1 %z } +define i8 @test28(i8 %x) { +entry: +; CHECK: @test28 +; CHECK: icmp slt i8 %x, 0 +; CHECK-NEXT: br i1 + %tmp1 = lshr i8 %x, 7 + %cond1 = icmp ne i8 %tmp1, 0 + br i1 %cond1, label %bb1, label %bb2 + +bb1: + ret i8 0 + +bb2: + ret i8 1 +} + +define i8 @test28a(i8 %x, i8 %y) { +entry: +; This shouldn't be transformed. +; CHECK: @test28a +; CHECK: %tmp1 = lshr i8 %x, 7 +; CHECK: %cond1 = icmp eq i8 %tmp1, 0 +; CHECK: br i1 %cond1, label %bb2, label %bb1 + %tmp1 = lshr i8 %x, 7 + %cond1 = icmp ne i8 %tmp1, 0 + br i1 %cond1, label %bb1, label %bb2 +bb1: + ret i8 %tmp1 +bb2: + %tmp2 = add i8 %tmp1, %y + ret i8 %tmp2 +} + + diff --git a/test/Transforms/InstCombine/shufflemask-undef.ll b/test/Transforms/InstCombine/shufflemask-undef.ll index a9e8d34..cf87aef 100644 --- a/test/Transforms/InstCombine/shufflemask-undef.ll +++ b/test/Transforms/InstCombine/shufflemask-undef.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {shufflevector.\*i32 8} +; RUN: opt < %s -instcombine -S | not grep {shufflevector.\*i32 8} 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" target triple = "i386-apple-darwin9" diff --git a/test/Transforms/InstCombine/shufflevec-constant.ll b/test/Transforms/InstCombine/shufflevec-constant.ll index f153a48..2c667903 100644 --- a/test/Transforms/InstCombine/shufflevec-constant.ll +++ b/test/Transforms/InstCombine/shufflevec-constant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep "2 x float" +; RUN: opt < %s -instcombine -S | grep "2 x float" 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" target triple = "i386-apple-darwin9" diff --git a/test/Transforms/InstCombine/signed-comparison.ll b/test/Transforms/InstCombine/signed-comparison.ll index 86e07ec7..9a08c64 100644 --- a/test/Transforms/InstCombine/signed-comparison.ll +++ b/test/Transforms/InstCombine/signed-comparison.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t ; RUN: not grep zext %t ; RUN: not grep slt %t ; RUN: grep {icmp ult} %t diff --git a/test/Transforms/InstCombine/signext.ll b/test/Transforms/InstCombine/signext.ll index 7166626..008662e 100644 --- a/test/Transforms/InstCombine/signext.ll +++ b/test/Transforms/InstCombine/signext.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {(and\|xor\|add\|shl\|shr)} ; END. diff --git a/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll b/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll new file mode 100644 index 0000000..6d2193f --- /dev/null +++ b/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll @@ -0,0 +1,84 @@ +; RUN: opt < %s -instcombine -disable-output + +; SimplifyDemandedBits should cope with pointer types. + +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" +target triple = "x86_64-unknown-linux-gnu" + %struct.VEC_rtx_base = type { i32, i32, [1 x %struct.rtx_def*] } + %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base } + %struct.block_symbol = type { [3 x %struct.rtunion], %struct.object_block*, i64 } + %struct.object_block = type { %struct.section*, i32, i64, %struct.VEC_rtx_gc*, %struct.VEC_rtx_gc* } + %struct.omp_clause_subcode = type { i32 } + %struct.rtunion = type { i8* } + %struct.rtx_def = type { i16, i8, i8, %struct.u } + %struct.section = type { %struct.unnamed_section } + %struct.u = type { %struct.block_symbol } + %struct.unnamed_section = type { %struct.omp_clause_subcode, void (i8*)*, i8*, %struct.section* } + +define fastcc void @cse_insn(%struct.rtx_def* %insn, %struct.rtx_def* %libcall_insn) nounwind { +entry: + br i1 undef, label %bb43, label %bb88 + +bb43: ; preds = %entry + br label %bb88 + +bb88: ; preds = %bb43, %entry + br i1 undef, label %bb95, label %bb107 + +bb95: ; preds = %bb88 + unreachable + +bb107: ; preds = %bb88 + %0 = load i16* undef, align 8 ; <i16> [#uses=1] + %1 = icmp eq i16 %0, 38 ; <i1> [#uses=1] + %src_eqv_here.0 = select i1 %1, %struct.rtx_def* null, %struct.rtx_def* null ; <%struct.rtx_def*> [#uses=1] + br i1 undef, label %bb127, label %bb125 + +bb125: ; preds = %bb107 + br i1 undef, label %bb127, label %bb126 + +bb126: ; preds = %bb125 + br i1 undef, label %bb129, label %bb133 + +bb127: ; preds = %bb125, %bb107 + unreachable + +bb129: ; preds = %bb126 + br label %bb133 + +bb133: ; preds = %bb129, %bb126 + br i1 undef, label %bb134, label %bb146 + +bb134: ; preds = %bb133 + unreachable + +bb146: ; preds = %bb133 + br i1 undef, label %bb180, label %bb186 + +bb180: ; preds = %bb146 + %2 = icmp eq %struct.rtx_def* null, null ; <i1> [#uses=1] + %3 = zext i1 %2 to i8 ; <i8> [#uses=1] + %4 = icmp ne %struct.rtx_def* %src_eqv_here.0, null ; <i1> [#uses=1] + %5 = zext i1 %4 to i8 ; <i8> [#uses=1] + %toBool181 = icmp ne i8 %3, 0 ; <i1> [#uses=1] + %toBool182 = icmp ne i8 %5, 0 ; <i1> [#uses=1] + %6 = and i1 %toBool181, %toBool182 ; <i1> [#uses=1] + %7 = zext i1 %6 to i8 ; <i8> [#uses=1] + %toBool183 = icmp ne i8 %7, 0 ; <i1> [#uses=1] + br i1 %toBool183, label %bb184, label %bb186 + +bb184: ; preds = %bb180 + br i1 undef, label %bb185, label %bb186 + +bb185: ; preds = %bb184 + br label %bb186 + +bb186: ; preds = %bb185, %bb184, %bb180, %bb146 + br i1 undef, label %bb190, label %bb195 + +bb190: ; preds = %bb186 + unreachable + +bb195: ; preds = %bb186 + unreachable +} diff --git a/test/Transforms/InstCombine/sink_instruction.ll b/test/Transforms/InstCombine/sink_instruction.ll index cb8a090..e521de2 100644 --- a/test/Transforms/InstCombine/sink_instruction.ll +++ b/test/Transforms/InstCombine/sink_instruction.ll @@ -1,10 +1,10 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ -; RUN: %prcontext div 1 | grep ret +; RUN: opt -instcombine %s -S | FileCheck %s ;; This tests that the instructions in the entry blocks are sunk into each ;; arm of the 'if'. -define i32 @foo(i1 %C, i32 %A, i32 %B) { +define i32 @test1(i1 %C, i32 %A, i32 %B) { +; CHECK: @test1 entry: %tmp.2 = sdiv i32 %A, %B ; <i32> [#uses=1] %tmp.9 = add i32 %B, %A ; <i32> [#uses=1] @@ -14,6 +14,43 @@ then: ; preds = %entry ret i32 %tmp.9 endif: ; preds = %entry +; CHECK: sdiv i32 +; CHECK-NEXT: ret i32 ret i32 %tmp.2 } + +;; PHI use, sink divide before call. +define i32 @test2(i32 %x) nounwind ssp { +; CHECK: @test2 +; CHECK-NOT: sdiv i32 +entry: + br label %bb + +bb: ; preds = %bb2, %entry + %x_addr.17 = phi i32 [ %x, %entry ], [ %x_addr.0, %bb2 ] ; <i32> [#uses=4] + %i.06 = phi i32 [ 0, %entry ], [ %4, %bb2 ] ; <i32> [#uses=1] + %0 = add nsw i32 %x_addr.17, 1 ; <i32> [#uses=1] + %1 = sdiv i32 %0, %x_addr.17 ; <i32> [#uses=1] + %2 = icmp eq i32 %x_addr.17, 0 ; <i1> [#uses=1] + br i1 %2, label %bb1, label %bb2 + +bb1: ; preds = %bb +; CHECK: bb1: +; CHECK-NEXT: add nsw i32 %x_addr.17, 1 +; CHECK-NEXT: sdiv i32 +; CHECK-NEXT: tail call i32 @bar() + %3 = tail call i32 @bar() nounwind ; <i32> [#uses=0] + br label %bb2 + +bb2: ; preds = %bb, %bb1 + %x_addr.0 = phi i32 [ %1, %bb1 ], [ %x_addr.17, %bb ] ; <i32> [#uses=2] + %4 = add nsw i32 %i.06, 1 ; <i32> [#uses=2] + %exitcond = icmp eq i32 %4, 1000000 ; <i1> [#uses=1] + br i1 %exitcond, label %bb4, label %bb + +bb4: ; preds = %bb2 + ret i32 %x_addr.0 +} + +declare i32 @bar() diff --git a/test/Transforms/InstCombine/sitofp.ll b/test/Transforms/InstCombine/sitofp.ll index 2bf7385..bd31b89 100644 --- a/test/Transforms/InstCombine/sitofp.ll +++ b/test/Transforms/InstCombine/sitofp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep itofp +; RUN: opt < %s -instcombine -S | not grep itofp define i1 @test1(i8 %A) { %B = sitofp i8 %A to double diff --git a/test/Transforms/InstCombine/srem-simplify-bug.ll b/test/Transforms/InstCombine/srem-simplify-bug.ll index cdf5202..af824a4 100644 --- a/test/Transforms/InstCombine/srem-simplify-bug.ll +++ b/test/Transforms/InstCombine/srem-simplify-bug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false} +; RUN: opt < %s -instcombine -S | grep {ret i1 false} ; PR2276 define i1 @f(i32 %x) { diff --git a/test/Transforms/InstCombine/srem.ll b/test/Transforms/InstCombine/srem.ll index 864775a..beefe4f 100644 --- a/test/Transforms/InstCombine/srem.ll +++ b/test/Transforms/InstCombine/srem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep srem +; RUN: opt < %s -instcombine -S | grep srem define i64 @foo(i64 %x1, i64 %y2) { %r = sdiv i64 %x1, %y2 diff --git a/test/Transforms/InstCombine/srem1.ll b/test/Transforms/InstCombine/srem1.ll index ee59d3e..f18690c 100644 --- a/test/Transforms/InstCombine/srem1.ll +++ b/test/Transforms/InstCombine/srem1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine +; RUN: opt < %s -instcombine ; PR2670 @g_127 = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/InstCombine/stack-overalign.ll b/test/Transforms/InstCombine/stack-overalign.ll index 45bdc2e..88b4114 100644 --- a/test/Transforms/InstCombine/stack-overalign.ll +++ b/test/Transforms/InstCombine/stack-overalign.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 32} | count 1 +; RUN: opt < %s -instcombine -S | grep {align 32} | count 1 ; It's tempting to have an instcombine in which the src pointer of a ; memcpy is aligned up to the alignment of the destination, however diff --git a/test/Transforms/InstCombine/stacksaverestore.ll b/test/Transforms/InstCombine/stacksaverestore.ll index c82a425..0fcaefa 100644 --- a/test/Transforms/InstCombine/stacksaverestore.ll +++ b/test/Transforms/InstCombine/stacksaverestore.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {call.*stackrestore} | count 1 +; RUN: opt < %s -instcombine -S | grep {call.*stackrestore} | count 1 declare i8* @llvm.stacksave() declare void @llvm.stackrestore(i8*) diff --git a/test/Transforms/InstCombine/store-merge.ll b/test/Transforms/InstCombine/store-merge.ll index 7b117ca..06d497d 100644 --- a/test/Transforms/InstCombine/store-merge.ll +++ b/test/Transforms/InstCombine/store-merge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {ret i32 %.toremerge} | count 2 ;; Simple sinking tests diff --git a/test/Transforms/InstCombine/store.ll b/test/Transforms/InstCombine/store.ll index 337b2cc..d6f916d 100644 --- a/test/Transforms/InstCombine/store.ll +++ b/test/Transforms/InstCombine/store.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v {store.*,.*null} | not grep store define void @test1(i32* %P) { diff --git a/test/Transforms/InstCombine/sub.ll b/test/Transforms/InstCombine/sub.ll index 1ab4eaf..bd7a700 100644 --- a/test/Transforms/InstCombine/sub.ll +++ b/test/Transforms/InstCombine/sub.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep -v {sub i32 %Cok, %Bok} | grep -v {sub i32 0, %Aok} | not grep sub define i32 @test1(i32 %A) { diff --git a/test/Transforms/InstCombine/trunc-mask-ext.ll b/test/Transforms/InstCombine/trunc-mask-ext.ll index 7e3d844..93e3753 100644 --- a/test/Transforms/InstCombine/trunc-mask-ext.ll +++ b/test/Transforms/InstCombine/trunc-mask-ext.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -S > %t ; RUN: not grep zext %t ; RUN: not grep sext %t diff --git a/test/Transforms/InstCombine/udiv-simplify-bug-0.ll b/test/Transforms/InstCombine/udiv-simplify-bug-0.ll index 5bcaa66..bfdd98c 100644 --- a/test/Transforms/InstCombine/udiv-simplify-bug-0.ll +++ b/test/Transforms/InstCombine/udiv-simplify-bug-0.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i64 0} | count 2 +; RUN: opt < %s -instcombine -S | grep {ret i64 0} | count 2 define i64 @foo(i32 %x) nounwind { %y = lshr i32 %x, 1 diff --git a/test/Transforms/InstCombine/udiv-simplify-bug-1.ll b/test/Transforms/InstCombine/udiv-simplify-bug-1.ll index 0036760..d95e8f8 100644 --- a/test/Transforms/InstCombine/udiv-simplify-bug-1.ll +++ b/test/Transforms/InstCombine/udiv-simplify-bug-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t1.ll +; RUN: opt < %s -instcombine -S > %t1.ll ; RUN: grep udiv %t1.ll | count 2 ; RUN: grep zext %t1.ll | count 2 ; PR2274 diff --git a/test/Transforms/InstCombine/udiv_select_to_select_shift.ll b/test/Transforms/InstCombine/udiv_select_to_select_shift.ll index 614ae3d..9b059a6 100644 --- a/test/Transforms/InstCombine/udiv_select_to_select_shift.ll +++ b/test/Transforms/InstCombine/udiv_select_to_select_shift.ll @@ -1,7 +1,7 @@ ; Test that this transform works: ; udiv X, (Select Cond, C1, C2) --> Select Cond, (shr X, C1), (shr X, C2) ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis -f -o %t +; RUN: opt < %s -instcombine -S -o %t ; RUN: not grep select %t ; RUN: grep lshr %t | count 2 ; RUN: not grep udiv %t diff --git a/test/Transforms/InstCombine/udivrem-change-width.ll b/test/Transforms/InstCombine/udivrem-change-width.ll new file mode 100644 index 0000000..56877e3 --- /dev/null +++ b/test/Transforms/InstCombine/udivrem-change-width.ll @@ -0,0 +1,19 @@ +; RUN: opt < %s -instcombine -S | not grep zext +; PR4548 + +define i8 @udiv_i8(i8 %a, i8 %b) nounwind { + %conv = zext i8 %a to i32 + %conv2 = zext i8 %b to i32 + %div = udiv i32 %conv, %conv2 + %conv3 = trunc i32 %div to i8 + ret i8 %conv3 +} + +define i8 @urem_i8(i8 %a, i8 %b) nounwind { + %conv = zext i8 %a to i32 + %conv2 = zext i8 %b to i32 + %div = urem i32 %conv, %conv2 + %conv3 = trunc i32 %div to i8 + ret i8 %conv3 +} + diff --git a/test/Transforms/InstCombine/urem-simplify-bug.ll b/test/Transforms/InstCombine/urem-simplify-bug.ll index 15956f2..7c2b4b0 100644 --- a/test/Transforms/InstCombine/urem-simplify-bug.ll +++ b/test/Transforms/InstCombine/urem-simplify-bug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {= or i32 %x, -5 } +; RUN: opt < %s -instcombine -S | grep {= or i32 %x, -5 } @.str = internal constant [5 x i8] c"foo\0A\00" ; <[5 x i8]*> [#uses=1] @.str1 = internal constant [5 x i8] c"bar\0A\00" ; <[5 x i8]*> [#uses=1] diff --git a/test/Transforms/InstCombine/urem.ll b/test/Transforms/InstCombine/urem.ll index 24e7463..5108422 100644 --- a/test/Transforms/InstCombine/urem.ll +++ b/test/Transforms/InstCombine/urem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep urem +; RUN: opt < %s -instcombine -S | grep urem define i64 @rem_unsigned(i64 %x1, i64 %y2) { %r = udiv i64 %x1, %y2 diff --git a/test/Transforms/InstCombine/vec_demanded_elts-2.ll b/test/Transforms/InstCombine/vec_demanded_elts-2.ll index dac0315..4159361 100644 --- a/test/Transforms/InstCombine/vec_demanded_elts-2.ll +++ b/test/Transforms/InstCombine/vec_demanded_elts-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep extractelement +; RUN: opt < %s -instcombine -S | not grep extractelement define void @get_image() nounwind { entry: diff --git a/test/Transforms/InstCombine/vec_demanded_elts-3.ll b/test/Transforms/InstCombine/vec_demanded_elts-3.ll index eba3629..62e4370 100644 --- a/test/Transforms/InstCombine/vec_demanded_elts-3.ll +++ b/test/Transforms/InstCombine/vec_demanded_elts-3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load +; RUN: opt < %s -instcombine -S | not grep load ; PR4340 define void @vac(<4 x float>* nocapture %a) nounwind { diff --git a/test/Transforms/InstCombine/vec_demanded_elts.ll b/test/Transforms/InstCombine/vec_demanded_elts.ll index 95df8c6..2009a77 100644 --- a/test/Transforms/InstCombine/vec_demanded_elts.ll +++ b/test/Transforms/InstCombine/vec_demanded_elts.ll @@ -1,12 +1,12 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {fadd float} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {fmul float} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {insertelement.*0.00} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {call.*llvm.x86.sse.mul} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {call.*llvm.x86.sse.sub} ; END. diff --git a/test/Transforms/InstCombine/vec_extract_elt.ll b/test/Transforms/InstCombine/vec_extract_elt.ll index 30b2f1d..63e4ee2 100644 --- a/test/Transforms/InstCombine/vec_extract_elt.ll +++ b/test/Transforms/InstCombine/vec_extract_elt.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep extractelement +; RUN: opt < %s -instcombine -S | not grep extractelement define i32 @test(float %f) { %tmp7 = insertelement <4 x float> undef, float %f, i32 0 ; <<4 x float>> [#uses=1] diff --git a/test/Transforms/InstCombine/vec_insertelt.ll b/test/Transforms/InstCombine/vec_insertelt.ll index 9be154b..eedf882 100644 --- a/test/Transforms/InstCombine/vec_insertelt.ll +++ b/test/Transforms/InstCombine/vec_insertelt.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret <4 x i32> %A} +; RUN: opt < %s -instcombine -S | grep {ret <4 x i32> %A} ; PR1286 define <4 x i32> @test1(<4 x i32> %A) { diff --git a/test/Transforms/InstCombine/vec_narrow.ll b/test/Transforms/InstCombine/vec_narrow.ll index e444c2a..daf7bcf 100644 --- a/test/Transforms/InstCombine/vec_narrow.ll +++ b/test/Transforms/InstCombine/vec_narrow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {add float} %V = type <4 x float> diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll index aaaee3f..29adc1e 100644 --- a/test/Transforms/InstCombine/vec_shuffle.ll +++ b/test/Transforms/InstCombine/vec_shuffle.ll @@ -1,20 +1,25 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep vector_shuffle -; END. +; RUN: opt < %s -instcombine -S | FileCheck %s %T = type <4 x float> define %T @test1(%T %v1) { +; CHECK: @test1 +; CHECK: ret %T %v1 %v2 = shufflevector %T %v1, %T undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> ret %T %v2 } define %T @test2(%T %v1) { +; CHECK: @test2 +; CHECK: ret %T %v1 %v2 = shufflevector %T %v1, %T %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7> ret %T %v2 } define float @test3(%T %A, %T %B, float %f) { +; CHECK: @test3 +; CHECK: ret float %f %C = insertelement %T %A, float %f, i32 0 %D = shufflevector %T %C, %T %B, <4 x i32> <i32 5, i32 0, i32 2, i32 7> %E = extractelement %T %D, i32 1 @@ -22,18 +27,27 @@ define float @test3(%T %A, %T %B, float %f) { } define i32 @test4(<4 x i32> %X) { +; CHECK: @test4 +; CHECK-NEXT: extractelement +; CHECK-NEXT: ret %tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer %tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0 ret i32 %tmp34 } define i32 @test5(<4 x i32> %X) { +; CHECK: @test5 +; CHECK-NEXT: extractelement +; CHECK-NEXT: ret %tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 undef, i32 undef> %tmp34 = extractelement <4 x i32> %tmp152.i53899.i, i32 0 ret i32 %tmp34 } define float @test6(<4 x float> %X) { +; CHECK: @test6 +; CHECK-NEXT: extractelement +; CHECK-NEXT: ret %X1 = bitcast <4 x float> %X to <4 x i32> %tmp152.i53899.i = shufflevector <4 x i32> %X1, <4 x i32> undef, <4 x i32> zeroinitializer %tmp152.i53900.i = bitcast <4 x i32> %tmp152.i53899.i to <4 x float> @@ -42,6 +56,34 @@ define float @test6(<4 x float> %X) { } define <4 x float> @test7(<4 x float> %tmp45.i) { +; CHECK: @test7 +; CHECK-NEXT: ret %T %tmp45.i %tmp1642.i = shufflevector <4 x float> %tmp45.i, <4 x float> undef, <4 x i32> < i32 0, i32 1, i32 6, i32 7 > ret <4 x float> %tmp1642.i } + +; This should turn into a single shuffle. +define <4 x float> @test8(<4 x float> %tmp, <4 x float> %tmp1) { +; CHECK: @test8 +; CHECK-NEXT: shufflevector +; CHECK-NEXT: ret + %tmp4 = extractelement <4 x float> %tmp, i32 1 + %tmp2 = extractelement <4 x float> %tmp, i32 3 + %tmp1.upgrd.1 = extractelement <4 x float> %tmp1, i32 0 + %tmp128 = insertelement <4 x float> undef, float %tmp4, i32 0 + %tmp130 = insertelement <4 x float> %tmp128, float undef, i32 1 + %tmp132 = insertelement <4 x float> %tmp130, float %tmp2, i32 2 + %tmp134 = insertelement <4 x float> %tmp132, float %tmp1.upgrd.1, i32 3 + ret <4 x float> %tmp134 +} + +; Test fold of two shuffles where the first shuffle vectors inputs are a +; different length then the second. +define <4 x i8> @test9(<16 x i8> %tmp6) nounwind { +; CHECK: @test9 +; CHECK-NEXT: shufflevector +; CHECK-NEXT: ret + %tmp7 = shufflevector <16 x i8> %tmp6, <16 x i8> undef, <4 x i32> < i32 13, i32 9, i32 4, i32 13 > ; <<4 x i8>> [#uses=1] + %tmp9 = shufflevector <4 x i8> %tmp7, <4 x i8> undef, <4 x i32> < i32 3, i32 1, i32 2, i32 0 > ; <<4 x i8>> [#uses=1] + ret <4 x i8> %tmp9 +}
\ No newline at end of file diff --git a/test/Transforms/InstCombine/vector-casts.ll b/test/Transforms/InstCombine/vector-casts.ll new file mode 100644 index 0000000..470d485 --- /dev/null +++ b/test/Transforms/InstCombine/vector-casts.ll @@ -0,0 +1,107 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +; This turns into a&1 != 0 +define <2 x i1> @test1(<2 x i64> %a) { + %t = trunc <2 x i64> %a to <2 x i1> + ret <2 x i1> %t + +; CHECK: @test1 +; CHECK: and <2 x i64> %a, <i64 1, i64 1> +; CHECK: icmp ne <2 x i64> %tmp, zeroinitializer +} + +; The ashr turns into an lshr. +define <2 x i64> @test2(<2 x i64> %a) { + %b = and <2 x i64> %a, <i64 65535, i64 65535> + %t = ashr <2 x i64> %b, <i64 1, i64 1> + ret <2 x i64> %t + +; CHECK: @test2 +; CHECK: and <2 x i64> %a, <i64 65535, i64 65535> +; CHECK: lshr <2 x i64> %b, <i64 1, i64 1> +} + + + +define <2 x i64> @test3(<4 x float> %a, <4 x float> %b) nounwind readnone { +entry: + %cmp = fcmp ord <4 x float> %a, zeroinitializer + %sext = sext <4 x i1> %cmp to <4 x i32> + %cmp4 = fcmp ord <4 x float> %b, zeroinitializer + %sext5 = sext <4 x i1> %cmp4 to <4 x i32> + %and = and <4 x i32> %sext, %sext5 + %conv = bitcast <4 x i32> %and to <2 x i64> + ret <2 x i64> %conv + +; CHECK: @test3 +; CHECK: fcmp ord <4 x float> %a, %b +} + +define <2 x i64> @test4(<4 x float> %a, <4 x float> %b) nounwind readnone { +entry: + %cmp = fcmp uno <4 x float> %a, zeroinitializer + %sext = sext <4 x i1> %cmp to <4 x i32> + %cmp4 = fcmp uno <4 x float> %b, zeroinitializer + %sext5 = sext <4 x i1> %cmp4 to <4 x i32> + %or = or <4 x i32> %sext, %sext5 + %conv = bitcast <4 x i32> %or to <2 x i64> + ret <2 x i64> %conv +; CHECK: @test4 +; CHECK: fcmp uno <4 x float> %a, %b +} + + + +define void @convert(<2 x i32>* %dst.addr, <2 x i64> %src) nounwind { +entry: + %val = trunc <2 x i64> %src to <2 x i32> + %add = add <2 x i32> %val, <i32 1, i32 1> + store <2 x i32> %add, <2 x i32>* %dst.addr + ret void +} + +define <2 x i65> @foo(<2 x i64> %t) { + %a = trunc <2 x i64> %t to <2 x i32> + %b = zext <2 x i32> %a to <2 x i65> + ret <2 x i65> %b +} +define <2 x i64> @bar(<2 x i65> %t) { + %a = trunc <2 x i65> %t to <2 x i32> + %b = zext <2 x i32> %a to <2 x i64> + ret <2 x i64> %b +} +define <2 x i65> @foos(<2 x i64> %t) { + %a = trunc <2 x i64> %t to <2 x i32> + %b = sext <2 x i32> %a to <2 x i65> + ret <2 x i65> %b +} +define <2 x i64> @bars(<2 x i65> %t) { + %a = trunc <2 x i65> %t to <2 x i32> + %b = sext <2 x i32> %a to <2 x i64> + ret <2 x i64> %b +} +define <2 x i64> @quxs(<2 x i64> %t) { + %a = trunc <2 x i64> %t to <2 x i32> + %b = sext <2 x i32> %a to <2 x i64> + ret <2 x i64> %b +} +define <2 x i64> @quxt(<2 x i64> %t) { + %a = shl <2 x i64> %t, <i64 32, i64 32> + %b = ashr <2 x i64> %a, <i64 32, i64 32> + ret <2 x i64> %b +} +define <2 x double> @fa(<2 x double> %t) { + %a = fptrunc <2 x double> %t to <2 x float> + %b = fpext <2 x float> %a to <2 x double> + ret <2 x double> %b +} +define <2 x double> @fb(<2 x double> %t) { + %a = fptoui <2 x double> %t to <2 x i64> + %b = uitofp <2 x i64> %a to <2 x double> + ret <2 x double> %b +} +define <2 x double> @fc(<2 x double> %t) { + %a = fptosi <2 x double> %t to <2 x i64> + %b = sitofp <2 x i64> %a to <2 x double> + ret <2 x double> %b +} diff --git a/test/Transforms/InstCombine/vector-srem.ll b/test/Transforms/InstCombine/vector-srem.ll index e8766eb..acb11c5 100644 --- a/test/Transforms/InstCombine/vector-srem.ll +++ b/test/Transforms/InstCombine/vector-srem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {srem <4 x i32>} +; RUN: opt < %s -instcombine -S | grep {srem <4 x i32>} define <4 x i32> @foo(<4 x i32> %t, <4 x i32> %u) { diff --git a/test/Transforms/InstCombine/volatile_store.ll b/test/Transforms/InstCombine/volatile_store.ll index 09651ba..5316bd7 100644 --- a/test/Transforms/InstCombine/volatile_store.ll +++ b/test/Transforms/InstCombine/volatile_store.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile store} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile load} +; RUN: opt < %s -instcombine -S | grep {volatile store} +; RUN: opt < %s -instcombine -S | grep {volatile load} @x = weak global i32 0 ; <i32*> [#uses=2] diff --git a/test/Transforms/InstCombine/xor-demorgans.ll b/test/Transforms/InstCombine/xor-demorgans.ll index c8de6db..3383845 100644 --- a/test/Transforms/InstCombine/xor-demorgans.ll +++ b/test/Transforms/InstCombine/xor-demorgans.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {= or} +; RUN: opt < %s -instcombine -S | not grep {= or} ; PR3266 ; XFAIL: * diff --git a/test/Transforms/InstCombine/xor-undef.ll b/test/Transforms/InstCombine/xor-undef.ll index c090223..cf72955 100644 --- a/test/Transforms/InstCombine/xor-undef.ll +++ b/test/Transforms/InstCombine/xor-undef.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zeroinitializer +; RUN: opt < %s -instcombine -S | grep zeroinitializer define <2 x i64> @f() { %tmp = xor <2 x i64> undef, undef diff --git a/test/Transforms/InstCombine/xor.ll b/test/Transforms/InstCombine/xor.ll index d8b84a6..a7bcdac 100644 --- a/test/Transforms/InstCombine/xor.ll +++ b/test/Transforms/InstCombine/xor.ll @@ -1,6 +1,6 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: not grep {xor } ; END. @G1 = global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/InstCombine/xor2.ll b/test/Transforms/InstCombine/xor2.ll index efb3146..23a9915 100644 --- a/test/Transforms/InstCombine/xor2.ll +++ b/test/Transforms/InstCombine/xor2.ll @@ -1,17 +1,43 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor } +; RUN: opt < %s -instcombine -S | FileCheck %s ; PR1253 define i1 @test0(i32 %A) { +; CHECK: @test0 +; CHECK: %C = icmp slt i32 %A, 0 %B = xor i32 %A, -2147483648 %C = icmp sgt i32 %B, -1 ret i1 %C } define i1 @test1(i32 %A) { +; CHECK: @test1 +; CHECK: %C = icmp slt i32 %A, 0 %B = xor i32 %A, 12345 %C = icmp slt i32 %B, 0 ret i1 %C } +; PR1014 +define i32 @test2(i32 %tmp1) { +; CHECK: @test2 +; CHECK-NEXT: or i32 %tmp1, 8 +; CHECK-NEXT: and i32 +; CHECK-NEXT: ret i32 + %ovm = and i32 %tmp1, 32 + %ov3 = add i32 %ovm, 145 + %ov110 = xor i32 %ov3, 153 + ret i32 %ov110 +} + +define i32 @test3(i32 %tmp1) { +; CHECK: @test3 +; CHECK-NEXT: or i32 %tmp1, 8 +; CHECK-NEXT: and i32 +; CHECK-NEXT: ret i32 + %ovm = or i32 %tmp1, 145 + %ov31 = and i32 %ovm, 177 + %ov110 = xor i32 %ov31, 153 + ret i32 %ov110 +} diff --git a/test/Transforms/InstCombine/zero-point-zero-add.ll b/test/Transforms/InstCombine/zero-point-zero-add.ll index adb28e4..d07a9f4 100644 --- a/test/Transforms/InstCombine/zero-point-zero-add.ll +++ b/test/Transforms/InstCombine/zero-point-zero-add.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 0.0 | count 1 +; RUN: opt < %s -instcombine -S | grep 0.0 | count 1 declare double @abs(double) diff --git a/test/Transforms/InstCombine/zeroext-and-reduce.ll b/test/Transforms/InstCombine/zeroext-and-reduce.ll index 2b4950a..592b8a1 100644 --- a/test/Transforms/InstCombine/zeroext-and-reduce.ll +++ b/test/Transforms/InstCombine/zeroext-and-reduce.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ +; RUN: opt < %s -instcombine -S | \ ; RUN: grep {and i32 %Y, 8} define i32 @test1(i8 %X) { diff --git a/test/Transforms/InstCombine/zext-bool-add-sub.ll b/test/Transforms/InstCombine/zext-bool-add-sub.ll new file mode 100644 index 0000000..1164273 --- /dev/null +++ b/test/Transforms/InstCombine/zext-bool-add-sub.ll @@ -0,0 +1,29 @@ +; RUN: opt < %s -instcombine -S | not grep zext + +define i32 @a(i1 %x) { +entry: + %y = zext i1 %x to i32 + %res = add i32 %y, 1 + ret i32 %res +} + +define i32 @b(i1 %x) { +entry: + %y = zext i1 %x to i32 + %res = add i32 %y, -1 + ret i32 %res +} + +define i32 @c(i1 %x) { +entry: + %y = zext i1 %x to i32 + %res = sub i32 0, %y + ret i32 %res +} + +define i32 @d(i1 %x) { +entry: + %y = zext i1 %x to i32 + %res = sub i32 3, %y + ret i32 %res +} diff --git a/test/Transforms/InstCombine/zext-fold.ll b/test/Transforms/InstCombine/zext-fold.ll index 27ea460..9521101 100644 --- a/test/Transforms/InstCombine/zext-fold.ll +++ b/test/Transforms/InstCombine/zext-fold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {zext } | count 1 +; RUN: opt < %s -instcombine -S | grep {zext } | count 1 ; PR1570 define i32 @test2(float %X, float %Y) { diff --git a/test/Transforms/InstCombine/zext-or-icmp.ll b/test/Transforms/InstCombine/zext-or-icmp.ll index 35c7c0a..969c301 100644 --- a/test/Transforms/InstCombine/zext-or-icmp.ll +++ b/test/Transforms/InstCombine/zext-or-icmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp | count 1 +; RUN: opt < %s -instcombine -S | grep icmp | count 1 %struct.FooBar = type <{ i8, i8, [2 x i8], i8, i8, i8, i8, i16, i16, [4 x i8], [8 x %struct.Rock] }> %struct.Rock = type { i16, i16 } diff --git a/test/Transforms/InstCombine/zext.ll b/test/Transforms/InstCombine/zext.ll index c0fa377..10eabf7 100644 --- a/test/Transforms/InstCombine/zext.ll +++ b/test/Transforms/InstCombine/zext.ll @@ -1,33 +1,11 @@ ; Tests to make sure elimination of casts is working correctly -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ -; RUN: notcast {} {%c1.*} +; RUN: opt < %s -instcombine -S | FileCheck %s define i64 @test_sext_zext(i16 %A) { %c1 = zext i16 %A to i32 ; <i32> [#uses=1] %c2 = sext i32 %c1 to i64 ; <i64> [#uses=1] ret i64 %c2 +; CHECK-NOT: %c1 +; CHECK: %c2 = zext i16 %A to i64 +; CHECK: ret i64 %c2 } - -; PR3599 -define i32 @test2(i64 %tmp) nounwind readnone { -entry: - %tmp5 = trunc i64 %tmp to i8 ; <i8> [#uses=1] - %tmp7 = lshr i64 %tmp, 8 ; <i64> [#uses=1] - %tmp8 = trunc i64 %tmp7 to i8 ; <i8> [#uses=1] - %tmp10 = lshr i64 %tmp, 16 ; <i64> [#uses=1] - %tmp11 = trunc i64 %tmp10 to i8 ; <i8> [#uses=1] - %tmp13 = lshr i64 %tmp, 24 ; <i64> [#uses=1] - %tmp14 = trunc i64 %tmp13 to i8 ; <i8> [#uses=1] - %tmp1 = zext i8 %tmp5 to i32 ; <i32> [#uses=1] - %tmp2 = zext i8 %tmp8 to i32 ; <i32> [#uses=1] - %tmp3 = shl i32 %tmp2, 8 ; <i32> [#uses=1] - %tmp4 = zext i8 %tmp11 to i32 ; <i32> [#uses=1] - %tmp6 = shl i32 %tmp4, 16 ; <i32> [#uses=1] - %tmp9 = zext i8 %tmp14 to i32 ; <i32> [#uses=1] - %tmp12 = shl i32 %tmp9, 24 ; <i32> [#uses=1] - %tmp15 = or i32 %tmp12, %tmp1 ; <i32> [#uses=1] - %tmp16 = or i32 %tmp15, %tmp6 ; <i32> [#uses=1] - %tmp17 = or i32 %tmp16, %tmp3 ; <i32> [#uses=1] - ret i32 %tmp17 -} - diff --git a/test/Transforms/Internalize/2008-05-09-AllButMain.ll b/test/Transforms/Internalize/2008-05-09-AllButMain.ll index 6ba5cb9..a85e834 100644 --- a/test/Transforms/Internalize/2008-05-09-AllButMain.ll +++ b/test/Transforms/Internalize/2008-05-09-AllButMain.ll @@ -1,12 +1,12 @@ ; No arguments means internalize all but main -; RUN: llvm-as < %s | opt -internalize | llvm-dis | grep internal | count 4 +; RUN: opt < %s -internalize -S | grep internal | count 4 ; Internalize all but foo and j -; RUN: llvm-as < %s | opt -internalize -internalize-public-api-list foo -internalize-public-api-list j | llvm-dis | grep internal | count 3 +; RUN: opt < %s -internalize -internalize-public-api-list foo -internalize-public-api-list j -S | grep internal | count 3 ; Non existent files should be treated as if they were empty (so internalize all but main) -; RUN: llvm-as < %s | opt -internalize -internalize-public-api-file /nonexistent/file 2> /dev/null | llvm-dis | grep internal | count 4 -; RUN: llvm-as < %s | opt -internalize -internalize-public-api-list bar -internalize-public-api-list foo -internalize-public-api-file /nonexistent/file 2> /dev/null | llvm-dis | grep internal | count 3 +; RUN: opt < %s -internalize -internalize-public-api-file /nonexistent/file 2> /dev/null -S | grep internal | count 4 +; RUN: opt < %s -internalize -internalize-public-api-list bar -internalize-public-api-list foo -internalize-public-api-file /nonexistent/file 2> /dev/null -S | grep internal | count 3 ; -file and -list options should be merged, the .apifile contains foo and j -; RUN: llvm-as < %s | opt -internalize -internalize-public-api-list bar -internalize-public-api-file %s.apifile | llvm-dis | grep internal | count 2 +; RUN: opt < %s -internalize -internalize-public-api-list bar -internalize-public-api-file %s.apifile -S | grep internal | count 2 @i = weak global i32 0 ; <i32*> [#uses=0] @j = weak global i32 0 ; <i32*> [#uses=0] diff --git a/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll b/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll index c0041ac..7b18a04 100644 --- a/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll +++ b/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -internalize | llvm-dis | grep internal | count 3 +; RUN: opt < %s -internalize -S | grep internal | count 3 @A = global i32 0 @B = alias i32* @A diff --git a/test/Transforms/JumpThreading/2008-11-27-EntryMunge.ll b/test/Transforms/JumpThreading/2008-11-27-EntryMunge.ll index 216dacb..b5d1065 100644 --- a/test/Transforms/JumpThreading/2008-11-27-EntryMunge.ll +++ b/test/Transforms/JumpThreading/2008-11-27-EntryMunge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -jump-threading -simplifycfg | llvm-dis | grep {ret i32 0} +; RUN: opt < %s -jump-threading -S | grep {ret i32 0} ; PR3138 define i32 @jt() { diff --git a/test/Transforms/JumpThreading/2008-11-28-InfLoop.ll b/test/Transforms/JumpThreading/2008-11-28-InfLoop.ll index 974b9ef..306b2d5 100644 --- a/test/Transforms/JumpThreading/2008-11-28-InfLoop.ll +++ b/test/Transforms/JumpThreading/2008-11-28-InfLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -jump-threading | llvm-dis +; RUN: opt < %s -jump-threading -S 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" target triple = "i386-apple-darwin9.5" diff --git a/test/Transforms/JumpThreading/2009-01-08-DeadLoopRepl.ll b/test/Transforms/JumpThreading/2009-01-08-DeadLoopRepl.ll index 6de67eb..208c822 100644 --- a/test/Transforms/JumpThreading/2009-01-08-DeadLoopRepl.ll +++ b/test/Transforms/JumpThreading/2009-01-08-DeadLoopRepl.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -jump-threading | llvm-dis +; RUN: opt < %s -jump-threading | llvm-dis ; PR3298 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" diff --git a/test/Transforms/JumpThreading/2009-01-19-InfSwitchLoop.ll b/test/Transforms/JumpThreading/2009-01-19-InfSwitchLoop.ll index ab8b087..05a3ef9 100644 --- a/test/Transforms/JumpThreading/2009-01-19-InfSwitchLoop.ll +++ b/test/Transforms/JumpThreading/2009-01-19-InfSwitchLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -jump-threading | llvm-dis +; RUN: opt < %s -jump-threading -S ; PR3353 define i32 @test(i8 %X) { diff --git a/test/Transforms/JumpThreading/and-and-cond.ll b/test/Transforms/JumpThreading/and-and-cond.ll index de4435c..e6db9ee 100644 --- a/test/Transforms/JumpThreading/and-and-cond.ll +++ b/test/Transforms/JumpThreading/and-and-cond.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | grep {ret i32 %v1} +; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -S | grep {ret i32 %v1} ; There should be no uncond branches left. -; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | not grep {br label} +; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -S | not grep {br label} declare i32 @f1() declare i32 @f2() diff --git a/test/Transforms/JumpThreading/and-cond.ll b/test/Transforms/JumpThreading/and-cond.ll index b01c4ba..58dbec7 100644 --- a/test/Transforms/JumpThreading/and-cond.ll +++ b/test/Transforms/JumpThreading/and-cond.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | grep {ret i32 %v1} +; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -S | grep {ret i32 %v1} ; There should be no uncond branches left. -; RUN: llvm-as < %s | opt -jump-threading -mem2reg -instcombine -simplifycfg | llvm-dis | not grep {br label} +; RUN: opt < %s -jump-threading -mem2reg -instcombine -simplifycfg -S | not grep {br label} declare i32 @f1() declare i32 @f2() diff --git a/test/Transforms/JumpThreading/basic.ll b/test/Transforms/JumpThreading/basic.ll index bf746e7..3d936b8 100644 --- a/test/Transforms/JumpThreading/basic.ll +++ b/test/Transforms/JumpThreading/basic.ll @@ -1,12 +1,12 @@ -; RUN: llvm-as < %s | opt -jump-threading -simplifycfg -mem2reg | llvm-dis | grep {ret i32 %v1} -; There should be no uncond branches left. -; RUN: llvm-as < %s | opt -jump-threading -simplifycfg -mem2reg | llvm-dis | not grep {br label} +; RUN: opt < %s -jump-threading -S | FileCheck %s declare i32 @f1() declare i32 @f2() declare void @f3() -define i32 @test(i1 %cond) { +define i32 @test1(i1 %cond) { +; CHECK: @test1 + br i1 %cond, label %T1, label %F1 T1: @@ -23,20 +23,27 @@ Merge: br i1 %A, label %T2, label %F2 T2: +; CHECK: T2: +; CHECK: ret i32 %v1 call void @f3() ret i32 %B F2: +; CHECK: F2: +; CHECK: ret i32 %v2 ret i32 %B } ;; cond is known false on Entry -> F1 edge! define i32 @test2(i1 %cond) { +; CHECK: @test2 Entry: br i1 %cond, label %T1, label %F1 T1: +; CHECK: %v1 = call i32 @f1() +; CHECK: ret i32 47 %v1 = call i32 @f1() br label %Merge @@ -51,3 +58,117 @@ F2: call void @f3() ret i32 12 } + + +; Undef handling. +define i32 @test3(i1 %cond) { +; CHECK: @test3 +; CHECK-NEXT: T1: +; CHECK-NEXT: ret i32 42 + br i1 undef, label %T1, label %F1 + +T1: + ret i32 42 + +F1: + ret i32 17 +} + +define i32 @test4(i1 %cond, i1 %cond2) { +; CHECK: @test4 + + br i1 %cond, label %T1, label %F1 + +T1: +; CHECK: %v1 = call i32 @f1() +; CHECK-NEXT: br label %T + + %v1 = call i32 @f1() + br label %Merge + +F1: + %v2 = call i32 @f2() +; CHECK: %v2 = call i32 @f2() +; CHECK-NEXT: br i1 %cond2, + br label %Merge + +Merge: + %A = phi i1 [undef, %T1], [%cond2, %F1] + %B = phi i32 [%v1, %T1], [%v2, %F1] + br i1 %A, label %T2, label %F2 + +T2: + call void @f3() + ret i32 %B + +F2: + ret i32 %B +} + + +;; This tests that the branch in 'merge' can be cloned up into T1. +define i32 @test5(i1 %cond, i1 %cond2) { +; CHECK: @test5 + + br i1 %cond, label %T1, label %F1 + +T1: +; CHECK: T1: +; CHECK-NEXT: %v1 = call i32 @f1() +; CHECK-NEXT: %cond3 = icmp eq i32 %v1, 412 +; CHECK-NEXT: br i1 %cond3, label %T2, label %F2 + + %v1 = call i32 @f1() + %cond3 = icmp eq i32 %v1, 412 + br label %Merge + +F1: + %v2 = call i32 @f2() + br label %Merge + +Merge: + %A = phi i1 [%cond3, %T1], [%cond2, %F1] + %B = phi i32 [%v1, %T1], [%v2, %F1] + br i1 %A, label %T2, label %F2 + +T2: + call void @f3() + ret i32 %B + +F2: + ret i32 %B +} + + +;; Lexically duplicated conditionals should be threaded. + + +define i32 @test6(i32 %A) { +; CHECK: @test6 + %tmp455 = icmp eq i32 %A, 42 + br i1 %tmp455, label %BB1, label %BB2 + +BB2: +; CHECK: call i32 @f1() +; CHECK-NEXT: call void @f3() +; CHECK-NEXT: ret i32 4 + call i32 @f1() + br label %BB1 + + +BB1: + %tmp459 = icmp eq i32 %A, 42 + br i1 %tmp459, label %BB3, label %BB4 + +BB3: + call i32 @f2() + ret i32 3 + +BB4: + call void @f3() + ret i32 4 +} + + + + diff --git a/test/Transforms/JumpThreading/branch-no-const.ll b/test/Transforms/JumpThreading/branch-no-const.ll index 0ea2431..16867b0 100644 --- a/test/Transforms/JumpThreading/branch-no-const.ll +++ b/test/Transforms/JumpThreading/branch-no-const.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -jump-threading | llvm-dis | not grep phi +; RUN: opt < %s -jump-threading -S | not grep phi declare i8 @mcguffin() diff --git a/test/Transforms/JumpThreading/compare.ll b/test/Transforms/JumpThreading/compare.ll index cbada56..581785c 100644 --- a/test/Transforms/JumpThreading/compare.ll +++ b/test/Transforms/JumpThreading/compare.ll @@ -1,5 +1,5 @@ ; There should be no phi nodes left. -; RUN: llvm-as < %s | opt -jump-threading -simplifycfg -mem2reg | llvm-dis | not grep {phi i32} +; RUN: opt < %s -jump-threading -S | not grep {phi i32} declare i32 @f1() declare i32 @f2() diff --git a/test/Transforms/JumpThreading/crash.ll b/test/Transforms/JumpThreading/crash.ll new file mode 100644 index 0000000..0b6cd27 --- /dev/null +++ b/test/Transforms/JumpThreading/crash.ll @@ -0,0 +1,56 @@ +; RUN: opt < %s -jump-threading -disable-output +; PR2285 +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" +target triple = "x86_64-unknown-linux-gnu" + %struct.system__secondary_stack__mark_id = type { i64, i64 } + +define void @_ada_c35507b() { +entry: + br label %bb + +bb: ; preds = %bb13, %entry + %ch.0 = phi i8 [ 0, %entry ], [ 0, %bb13 ] ; <i8> [#uses=1] + %tmp11 = icmp ugt i8 %ch.0, 31 ; <i1> [#uses=1] + %tmp120 = call %struct.system__secondary_stack__mark_id @system__secondary_stack__ss_mark( ) ; <%struct.system__secondary_stack__mark_id> [#uses=1] + br i1 %tmp11, label %bb110, label %bb13 + +bb13: ; preds = %bb + br label %bb + +bb110: ; preds = %bb + %mrv_gr124 = getresult %struct.system__secondary_stack__mark_id %tmp120, 1 ; <i64> [#uses=0] + unreachable +} + +declare %struct.system__secondary_stack__mark_id @system__secondary_stack__ss_mark() + + + +define fastcc void @findratio(double* nocapture %res1, double* nocapture %res2) nounwind ssp { +entry: + br label %bb12 + +bb6.us: + %tmp = icmp eq i32 undef, undef + %tmp1 = fsub double undef, undef + %tmp2 = fcmp ult double %tmp1, 0.000000e+00 + br i1 %tmp, label %bb6.us, label %bb13 + + +bb12: + %tmp3 = fcmp ult double undef, 0.000000e+00 + br label %bb13 + +bb13: + %.lcssa31 = phi double [ undef, %bb12 ], [ %tmp1, %bb6.us ] + %.lcssa30 = phi i1 [ %tmp3, %bb12 ], [ %tmp2, %bb6.us ] + br i1 %.lcssa30, label %bb15, label %bb61 + +bb15: + %tmp4 = fsub double -0.000000e+00, %.lcssa31 + ret void + + +bb61: + ret void +} diff --git a/test/Transforms/JumpThreading/no-irreducible-loops.ll b/test/Transforms/JumpThreading/no-irreducible-loops.ll index 0c729d1..b4d4418 100644 --- a/test/Transforms/JumpThreading/no-irreducible-loops.ll +++ b/test/Transforms/JumpThreading/no-irreducible-loops.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -jump-threading -loop-rotate -instcombine -indvars -loop-unroll -simplifycfg | llvm-dis > %t +; RUN: opt < %s -jump-threading -loop-rotate -instcombine -indvars -loop-unroll -simplifycfg -S > %t ; RUN: grep {volatile store} %t | count 3 ; RUN: not grep {br label} %t diff --git a/test/Transforms/JumpThreading/thread-loads.ll b/test/Transforms/JumpThreading/thread-loads.ll index 5c0b256..96ba701 100644 --- a/test/Transforms/JumpThreading/thread-loads.ll +++ b/test/Transforms/JumpThreading/thread-loads.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -jump-threading -mem2reg -simplifycfg | llvm-dis | grep {ret i32 1} +; RUN: opt < %s -jump-threading -simplifycfg -S | grep {ret i32 1} ; rdar://6402033 ; Test that we can thread through the block with the partially redundant load (%2). diff --git a/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll b/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll index aa24014..7545641 100644 --- a/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll +++ b/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \ -; RUN: grep {%SJE.0.0.lcssa = phi .struct.SetJmpMapEntry} -; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \ -; RUN: grep {%SJE.0.0.lcssa1 = phi .struct.SetJmpMapEntry} +; RUN: opt < %s -lcssa -S | \ +; RUN: grep {%%SJE.0.0.lcssa = phi .struct.SetJmpMapEntry} +; RUN: opt < %s -lcssa -S | \ +; RUN: grep {%%SJE.0.0.lcssa1 = phi .struct.SetJmpMapEntry} %struct.SetJmpMapEntry = type { i8*, i32, %struct.SetJmpMapEntry* } diff --git a/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll b/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll index eaccbad..ad4f144 100644 --- a/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll +++ b/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \ +; RUN: opt < %s -lcssa -S | \ ; RUN: grep {%X.1.lcssa} -; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \ +; RUN: opt < %s -lcssa -S | \ ; RUN: not grep {%X.1.lcssa1} declare i1 @c1() diff --git a/test/Transforms/LCSSA/2006-07-09-NoDominator.ll b/test/Transforms/LCSSA/2006-07-09-NoDominator.ll index c8af100..b03f09a 100644 --- a/test/Transforms/LCSSA/2006-07-09-NoDominator.ll +++ b/test/Transforms/LCSSA/2006-07-09-NoDominator.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lcssa +; RUN: opt < %s -lcssa %struct.SetJmpMapEntry = type { i8*, i32, %struct.SetJmpMapEntry* } diff --git a/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll b/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll index bececb1..3ba8d18 100644 --- a/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll +++ b/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lcssa -disable-output -verify-dom-info +; RUN: opt < %s -lcssa -disable-output -verify-dom-info -verify-loop-info ; PR977 ; END. declare i32 @opost_block() diff --git a/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll b/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll index b02feb4..ecb1be5 100644 --- a/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll +++ b/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lcssa -disable-output +; RUN: opt < %s -lcssa -disable-output ; PR977 ; END. diff --git a/test/Transforms/LCSSA/2007-07-12-LICM-2.ll b/test/Transforms/LCSSA/2007-07-12-LICM-2.ll index e8dc391..2c5815c 100644 --- a/test/Transforms/LCSSA/2007-07-12-LICM-2.ll +++ b/test/Transforms/LCSSA/2007-07-12-LICM-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output +; RUN: opt < %s -loop-rotate -licm -loop-unswitch -disable-output define i32 @main(i32 %argc, i8** %argv) { entry: br label %bb7 diff --git a/test/Transforms/LCSSA/2007-07-12-LICM-3.ll b/test/Transforms/LCSSA/2007-07-12-LICM-3.ll index 72cebed..7e0d3c6 100644 --- a/test/Transforms/LCSSA/2007-07-12-LICM-3.ll +++ b/test/Transforms/LCSSA/2007-07-12-LICM-3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output +; RUN: opt < %s -loop-rotate -licm -loop-unswitch -disable-output define i32 @main(i32 %argc, i8** %argv) { entry: diff --git a/test/Transforms/LCSSA/2007-07-12-LICM.ll b/test/Transforms/LCSSA/2007-07-12-LICM.ll index 0c433c3..8c07aa2 100644 --- a/test/Transforms/LCSSA/2007-07-12-LICM.ll +++ b/test/Transforms/LCSSA/2007-07-12-LICM.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output +; RUN: opt < %s -loop-rotate -licm -loop-unswitch -disable-output define i32 @main(i32 %argc, i8** %argv) { entry: br label %bb7 diff --git a/test/Transforms/LCSSA/basictest.ll b/test/Transforms/LCSSA/basictest.ll index 090bde9..23ab2c0 100644 --- a/test/Transforms/LCSSA/basictest.ll +++ b/test/Transforms/LCSSA/basictest.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \ +; RUN: opt < %s -lcssa -S | \ ; RUN: grep {X3.lcssa = phi i32} -; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \ +; RUN: opt < %s -lcssa -S | \ ; RUN: grep {X4 = add i32 3, %X3.lcssa} define void @lcssa(i1 %S2) { diff --git a/test/Transforms/LCSSA/invoke-dest.ll b/test/Transforms/LCSSA/invoke-dest.ll index 5c6c7a0..4547150 100644 --- a/test/Transforms/LCSSA/invoke-dest.ll +++ b/test/Transforms/LCSSA/invoke-dest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lcssa +; RUN: opt < %s -lcssa 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" diff --git a/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll b/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll index cf05206..ff20312 100644 --- a/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll +++ b/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -licm -disable-output +; RUN: opt < %s -basicaa -licm -disable-output ;%MoveArray = external global [64 x ulong] diff --git a/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll b/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll index bf209ea..4782bd1 100644 --- a/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll +++ b/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll @@ -1,6 +1,6 @@ ; Exit blocks need to be updated for all nested loops... -; RUN: llvm-as < %s | opt -loopsimplify +; RUN: opt < %s -loopsimplify define i32 @yyparse() { bb0: diff --git a/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll b/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll index 4b51a3b..2718cb1 100644 --- a/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll +++ b/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll @@ -1,7 +1,7 @@ ; This testcase fails because preheader insertion is not updating exit node ; information for loops. -; RUN: llvm-as < %s | opt -licm +; RUN: opt < %s -licm define i32 @main(i32 %argc, i8** %argv) { bb0: diff --git a/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll b/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll index 18b8606..70a04c7 100644 --- a/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll +++ b/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll @@ -3,7 +3,7 @@ ; happens because preheader insertion doesn't insert a preheader for this ; case... bad. -; RUN: llvm-as < %s | opt -licm -loop-deletion -simplifycfg | llvm-dis | \ +; RUN: opt < %s -licm -loop-deletion -simplifycfg -S | \ ; RUN: not grep {br } define i32 @main(i32 %argc) { diff --git a/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll b/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll index 7ce164e..a9c6b85 100644 --- a/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll +++ b/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll @@ -1,6 +1,6 @@ ; LICM is adding stores before phi nodes. bad. -; RUN: llvm-as < %s | opt -licm +; RUN: opt < %s -licm define i1 @test(i1 %c) { ; <label>:0 diff --git a/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll b/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll index 849ecd7..c759e6e 100644 --- a/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll +++ b/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll @@ -1,6 +1,6 @@ ; Test that hoisting is disabled for pointers of different types... ; -; RUN: llvm-as < %s | opt -licm +; RUN: opt < %s -licm define void @test(i32* %P) { br label %Loop diff --git a/test/Transforms/LICM/2003-05-02-LoadHoist.ll b/test/Transforms/LICM/2003-05-02-LoadHoist.ll index 7b58535..71d3e78 100644 --- a/test/Transforms/LICM/2003-05-02-LoadHoist.ll +++ b/test/Transforms/LICM/2003-05-02-LoadHoist.ll @@ -3,7 +3,7 @@ ; loaded from. Basically if the load gets hoisted, the subtract gets turned ; into a constant zero. ; -; RUN: llvm-as < %s | opt -licm -gvn -instcombine | llvm-dis | grep load +; RUN: opt < %s -licm -gvn -instcombine -S | grep load @X = global i32 7 ; <i32*> [#uses=2] diff --git a/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll b/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll index e491c9a..67c3951 100644 --- a/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll +++ b/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm | lli +; RUN: opt < %s -licm | lli define i32 @main() { entry: diff --git a/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll b/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll index b9c9eb3..16f4fed 100644 --- a/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll +++ b/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalsmodref-aa -licm -disable-output +; RUN: opt < %s -globalsmodref-aa -licm -disable-output @PL_regcomp_parse = internal global i8* null ; <i8**> [#uses=2] diff --git a/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll b/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll index 9a53d95..a119865 100644 --- a/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll +++ b/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -disable-output +; RUN: opt < %s -licm -disable-output %struct.roadlet = type { i8*, %struct.vehicle*, [8 x %struct.roadlet*], [8 x %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)*] } %struct.vehicle = type { %struct.roadlet*, i8*, i32, i32, %union.._631., i32 } %union.._631. = type { i32 } diff --git a/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll b/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll index b001cd0..91740cf 100644 --- a/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll +++ b/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -disable-output +; RUN: opt < %s -licm -disable-output define void @test({ i32 }* %P) { br label %Loop diff --git a/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll b/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll index c2c4bcb..9763660 100644 --- a/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll +++ b/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -disable-output +; RUN: opt < %s -licm -disable-output ; PR908 ; END. diff --git a/test/Transforms/LICM/2007-05-22-VolatileSink.ll b/test/Transforms/LICM/2007-05-22-VolatileSink.ll index bf5d7bc..c12e13b 100644 --- a/test/Transforms/LICM/2007-05-22-VolatileSink.ll +++ b/test/Transforms/LICM/2007-05-22-VolatileSink.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm | llvm-dis | grep {volatile store} +; RUN: opt < %s -licm -S | grep {volatile store} ; PR1435 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/LICM/2007-07-30-AliasSet.ll b/test/Transforms/LICM/2007-07-30-AliasSet.ll index 110d884..8ecd1bc 100644 --- a/test/Transforms/LICM/2007-07-30-AliasSet.ll +++ b/test/Transforms/LICM/2007-07-30-AliasSet.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -loop-unswitch -disable-output +; RUN: opt < %s -licm -loop-unswitch -disable-output %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] } %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] } diff --git a/test/Transforms/LICM/2007-09-17-PromoteValue.ll b/test/Transforms/LICM/2007-09-17-PromoteValue.ll index e9ba9e1..31abd8c 100644 --- a/test/Transforms/LICM/2007-09-17-PromoteValue.ll +++ b/test/Transforms/LICM/2007-09-17-PromoteValue.ll @@ -2,7 +2,7 @@ ; Do not promote getelementptr because it may exposes load from a null pointer ; and store from a null pointer which are covered by ; icmp eq %struct.decision* null, null condition. -; RUN: llvm-as < %s | opt -licm | llvm-dis | not grep promoted +; RUN: opt < %s -licm -S | not grep promoted %struct.decision = type { i8, %struct.decision* } define i32 @main() { diff --git a/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll b/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll index f9f45f3..916f479 100644 --- a/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll +++ b/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll @@ -1,5 +1,5 @@ ; Do not promote null value because it may be unsafe to do so. -; RUN: llvm-as < %s | opt -licm | llvm-dis | not grep promoted +; RUN: opt < %s -licm -S | not grep promoted define i32 @f(i32 %foo, i32 %bar, i32 %com) { entry: diff --git a/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll b/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll index 7359cc0..59f1dcb 100644 --- a/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll +++ b/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm | llvm-dis | grep promoted +; RUN: opt < %s -licm -S | grep promoted ; Promote value if at least one use is safe diff --git a/test/Transforms/LICM/2008-05-20-AliasSetVAArg.ll b/test/Transforms/LICM/2008-05-20-AliasSetVAArg.ll index dcb20e7..a5a7bf8 100644 --- a/test/Transforms/LICM/2008-05-20-AliasSetVAArg.ll +++ b/test/Transforms/LICM/2008-05-20-AliasSetVAArg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -disable-output +; RUN: opt < %s -licm -disable-output ; PR2346 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll b/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll index 3824d53..7810309 100644 --- a/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll +++ b/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -enable-licm-constant-variables | llvm-dis | grep -A 1 entry | grep load.*@a +; RUN: opt < %s -licm -enable-licm-constant-variables -S | grep -A 1 entry | grep load.*@a @a = external constant float* define void @test(i32 %count) { diff --git a/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll b/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll index c3c9a81..d1fe48c 100644 --- a/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll +++ b/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -licm -loop-index-split -instcombine -disable-output +; RUN: opt < %s -licm -loop-index-split -instcombine -disable-output %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } diff --git a/test/Transforms/LICM/Preserve-LCSSA.ll b/test/Transforms/LICM/Preserve-LCSSA.ll index 850d071..24c4ad1 100644 --- a/test/Transforms/LICM/Preserve-LCSSA.ll +++ b/test/Transforms/LICM/Preserve-LCSSA.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output +; RUN: opt < %s -loop-rotate -licm -loop-unswitch -disable-output define i32 @stringSearch_Clib(i32 %count) { entry: diff --git a/test/Transforms/LICM/basictest.ll b/test/Transforms/LICM/basictest.ll index 0a57ce4..1dbb4dc 100644 --- a/test/Transforms/LICM/basictest.ll +++ b/test/Transforms/LICM/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm | llvm-dis +; RUN: opt < %s -licm | llvm-dis define void @testfunc(i32 %i) { ; <label>:0 diff --git a/test/Transforms/LICM/hoisting.ll b/test/Transforms/LICM/hoisting.ll new file mode 100644 index 0000000..e7d36af --- /dev/null +++ b/test/Transforms/LICM/hoisting.ll @@ -0,0 +1,50 @@ +; RUN: opt < %s -licm -S | FileCheck %s + +@X = global i32 0 ; <i32*> [#uses=1] + +declare void @foo() + +; This testcase tests for a problem where LICM hoists +; potentially trapping instructions when they are not guaranteed to execute. +define i32 @test1(i1 %c) { +; CHECK: @test1 + %A = load i32* @X ; <i32> [#uses=2] + br label %Loop +Loop: ; preds = %LoopTail, %0 + call void @foo( ) + br i1 %c, label %LoopTail, label %IfUnEqual + +IfUnEqual: ; preds = %Loop +; CHECK: IfUnEqual: +; CHECK-NEXT: sdiv i32 4, %A + %B1 = sdiv i32 4, %A ; <i32> [#uses=1] + br label %LoopTail + +LoopTail: ; preds = %IfUnEqual, %Loop + %B = phi i32 [ 0, %Loop ], [ %B1, %IfUnEqual ] ; <i32> [#uses=1] + br i1 %c, label %Loop, label %Out +Out: ; preds = %LoopTail + %C = sub i32 %A, %B ; <i32> [#uses=1] + ret i32 %C +} + + +declare void @foo2(i32) + + +;; It is ok and desirable to hoist this potentially trapping instruction. +define i32 @test2(i1 %c) { +; CHECK: @test2 +; CHECK-NEXT: load i32* @X +; CHECK-NEXT: %B = sdiv i32 4, %A + %A = load i32* @X ; <i32> [#uses=2] + br label %Loop +Loop: + ;; Should have hoisted this div! + %B = sdiv i32 4, %A ; <i32> [#uses=2] + call void @foo2( i32 %B ) + br i1 %c, label %Loop, label %Out +Out: ; preds = %Loop + %C = sub i32 %A, %B ; <i32> [#uses=1] + ret i32 %C +} diff --git a/test/Transforms/LICM/licm_preserve_dbginfo.ll b/test/Transforms/LICM/licm_preserve_dbginfo.ll new file mode 100644 index 0000000..e013c27 --- /dev/null +++ b/test/Transforms/LICM/licm_preserve_dbginfo.ll @@ -0,0 +1,55 @@ +; RUN: opt -licm -S <%s | FileCheck %s +; Test that licm doesn't sink/delete debug info. +define i32 @foo(i32 %a, i32 %j) nounwind { +entry: +;CHECK: entry: + call void @llvm.dbg.func.start(metadata !0) + call void @llvm.dbg.stoppoint(i32 3, i32 5, metadata !1) +;CHECK: %mul = mul i32 %j, %j + br label %for.cond + +for.cond: +;CHECK: for.cond: + %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] + %s.0 = phi i32 [ 0, %entry ], [ %add, %for.inc ] + call void @llvm.dbg.stoppoint(i32 4, i32 5, metadata !1) +; CHECK: call void @llvm.dbg.stoppoint(i32 4, i32 5, metadata !1) + %cmp = icmp slt i32 %i.0, %a + br i1 %cmp, label %for.body, label %for.end + +for.body: +;CHECK: for.body: + call void @llvm.dbg.stoppoint(i32 5, i32 2, metadata !1) +;CHECK: call void @llvm.dbg.stoppoint(i32 5, i32 2, metadata !1) + %mul = mul i32 %j, %j + %add = add nsw i32 %s.0, %mul + br label %for.inc + +for.inc: +;CHECK: for.inc: + call void @llvm.dbg.stoppoint(i32 4, i32 18, metadata !1) +;CHECK: call void @llvm.dbg.stoppoint(i32 4, i32 18, metadata !1) + %inc = add nsw i32 %i.0, 1 + br label %for.cond + +for.end: + call void @llvm.dbg.stoppoint(i32 7, i32 5, metadata !1) + br label %0 + +; <label>:0 ; preds = %for.end + call void @llvm.dbg.stoppoint(i32 8, i32 1, metadata !1) + call void @llvm.dbg.region.end(metadata !0) + ret i32 %s.0 +} + +declare void @llvm.dbg.func.start(metadata) nounwind readnone + +declare void @llvm.dbg.declare({ }*, metadata) nounwind readnone + +declare void @llvm.dbg.stoppoint(i32, i32, metadata) nounwind readnone + +declare void @llvm.dbg.region.end(metadata) nounwind readnone + +!0 = metadata !{i32 458798, i32 0, metadata !1, metadata !"foo", metadata !"foo", metadata !"foo", metadata !1, i32 2, metadata !2, i1 false, i1 true}; [DW_TAG_subprogram ] +!1 = metadata !{i32 458769, i32 0, i32 12, metadata !"licm.c", metadata !"/home/edwin", metadata !"clang 1.1", i1 true, i1 false, metadata !"", i32 0}; [DW_TAG_compile_unit ] +!2 = metadata !{i32 458788, metadata !1, metadata !"int", metadata !1, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5}; [DW_TAG_base_type ] diff --git a/test/Transforms/LICM/no-preheader-test.ll b/test/Transforms/LICM/no-preheader-test.ll index 6ea0861..bd3eea3 100644 --- a/test/Transforms/LICM/no-preheader-test.ll +++ b/test/Transforms/LICM/no-preheader-test.ll @@ -1,5 +1,5 @@ ; Test that LICM works when there is not a loop-preheader -; RUN: llvm-as < %s | opt -licm | llvm-dis +; RUN: opt < %s -licm | llvm-dis define void @testfunc(i32 %i.s, i1 %ifcond) { br i1 %ifcond, label %Then, label %Else diff --git a/test/Transforms/LICM/scalar_promote.ll b/test/Transforms/LICM/scalar_promote.ll index f6c0f08..ef28c38 100644 --- a/test/Transforms/LICM/scalar_promote.ll +++ b/test/Transforms/LICM/scalar_promote.ll @@ -1,13 +1,17 @@ -; RUN: llvm-as < %s | opt -licm -disable-output -stats |& \ -; RUN: grep {memory locations promoted to register} +; RUN: opt < %s -licm -S | FileCheck %s @X = global i32 7 ; <i32*> [#uses=4] -define void @testfunc(i32 %i) { -; <label>:0 +define void @test1(i32 %i) { +Entry: br label %Loop +; CHECK: @test1 +; CHECK: Entry: +; CHECK-NEXT: load i32* @X +; CHECK-NEXT: br label %Loop + Loop: ; preds = %Loop, %0 - %j = phi i32 [ 0, %0 ], [ %Next, %Loop ] ; <i32> [#uses=1] + %j = phi i32 [ 0, %Entry ], [ %Next, %Loop ] ; <i32> [#uses=1] %x = load i32* @X ; <i32> [#uses=1] %x2 = add i32 %x, 1 ; <i32> [#uses=1] store i32 %x2, i32* @X @@ -15,12 +19,23 @@ Loop: ; preds = %Loop, %0 %cond = icmp eq i32 %Next, 0 ; <i1> [#uses=1] br i1 %cond, label %Out, label %Loop -Out: ; preds = %Loop +Out: ret void +; CHECK: Out: +; CHECK-NEXT: store i32 %x2, i32* @X +; CHECK-NEXT: ret void + } -define void @testhard(i32 %i) { +define void @test2(i32 %i) { +Entry: br label %Loop +; CHECK: @test2 +; CHECK: Entry: +; CHECK-NEXT: %X1 = getelementptr i32* @X, i64 0 +; CHECK-NEXT: %X2 = getelementptr i32* @X, i64 0 +; CHECK-NEXT: %X1.promoted = load i32* %X1 +; CHECK-NEXT: br label %Loop Loop: ; preds = %Loop, %0 %X1 = getelementptr i32* @X, i64 0 ; <i32*> [#uses=1] @@ -32,4 +47,27 @@ Loop: ; preds = %Loop, %0 Exit: ; preds = %Loop ret void +; CHECK: Exit: +; CHECK-NEXT: store i32 %V, i32* %X1 +; CHECK-NEXT: ret void } + + + +define void @test3(i32 %i) { +; CHECK: @test3 + br label %Loop +Loop: + ; Should not promote this to a register + %x = volatile load i32* @X + %x2 = add i32 %x, 1 + store i32 %x2, i32* @X + br i1 true, label %Out, label %Loop + +; CHECK: Loop: +; CHECK-NEXT: volatile load + +Out: ; preds = %Loop + ret void +} + diff --git a/test/Transforms/LICM/sinking.ll b/test/Transforms/LICM/sinking.ll new file mode 100644 index 0000000..11112eb --- /dev/null +++ b/test/Transforms/LICM/sinking.ll @@ -0,0 +1,235 @@ +; RUN: opt < %s -basicaa -licm -S | FileCheck %s + +declare i32 @strlen(i8*) readonly + +declare void @foo() + +; Sink readonly function. +define i32 @test1(i8* %P) { + br label %Loop + +Loop: ; preds = %Loop, %0 + %A = call i32 @strlen( i8* %P ) readonly + br i1 false, label %Loop, label %Out + +Out: ; preds = %Loop + ret i32 %A +; CHECK: @test1 +; CHECK: Out: +; CHECK-NEXT: call i32 @strlen +; CHECK-NEXT: ret i32 %A +} + +declare double @sin(double) readnone + +; Sink readnone function out of loop with unknown memory behavior. +define double @test2(double %X) { + br label %Loop + +Loop: ; preds = %Loop, %0 + call void @foo( ) + %A = call double @sin( double %X ) readnone + br i1 true, label %Loop, label %Out + +Out: ; preds = %Loop + ret double %A +; CHECK: @test2 +; CHECK: Out: +; CHECK-NEXT: call double @sin +; CHECK-NEXT: ret double %A +} + +; This testcase checks to make sure the sinker does not cause problems with +; critical edges. +define void @test3() { +Entry: + br i1 false, label %Loop, label %Exit +Loop: + %X = add i32 0, 1 + br i1 false, label %Loop, label %Exit +Exit: + %Y = phi i32 [ 0, %Entry ], [ %X, %Loop ] + ret void + +; CHECK: @test3 +; CHECK: Exit.loopexit: +; CHECK-NEXT: %X = add i32 0, 1 +; CHECK-NEXT: br label %Exit + +} + +; If the result of an instruction is only used outside of the loop, sink +; the instruction to the exit blocks instead of executing it on every +; iteration of the loop. +; +define i32 @test4(i32 %N) { +Entry: + br label %Loop +Loop: ; preds = %Loop, %Entry + %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ] + %tmp.6 = mul i32 %N, %N_addr.0.pn ; <i32> [#uses=1] + %tmp.7 = sub i32 %tmp.6, %N ; <i32> [#uses=1] + %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1] + %tmp.1 = icmp ne i32 %N_addr.0.pn, 1 ; <i1> [#uses=1] + br i1 %tmp.1, label %Loop, label %Out +Out: ; preds = %Loop + ret i32 %tmp.7 +; CHECK: @test4 +; CHECK: Out: +; CHECK-NEXT: mul i32 %N, %N_addr.0.pn +; CHECK-NEXT: sub i32 %tmp.6, %N +; CHECK-NEXT: ret i32 +} + +; To reduce register pressure, if a load is hoistable out of the loop, and the +; result of the load is only used outside of the loop, sink the load instead of +; hoisting it! +; +@X = global i32 5 ; <i32*> [#uses=1] + +define i32 @test5(i32 %N) { +Entry: + br label %Loop +Loop: ; preds = %Loop, %Entry + %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ] + %tmp.6 = load i32* @X ; <i32> [#uses=1] + %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1] + %tmp.1 = icmp ne i32 %N_addr.0.pn, 1 ; <i1> [#uses=1] + br i1 %tmp.1, label %Loop, label %Out +Out: ; preds = %Loop + ret i32 %tmp.6 +; CHECK: @test5 +; CHECK: Out: +; CHECK-NEXT: %tmp.6 = load i32* @X +; CHECK-NEXT: ret i32 %tmp.6 +} + + + +; The loop sinker was running from the bottom of the loop to the top, causing +; it to miss opportunities to sink instructions that depended on sinking other +; instructions from the loop. Instead they got hoisted, which is better than +; leaving them in the loop, but increases register pressure pointlessly. + + %Ty = type { i32, i32 } +@X2 = external global %Ty + +define i32 @test6() { + br label %Loop +Loop: + %dead = getelementptr %Ty* @X2, i64 0, i32 0 + %sunk2 = load i32* %dead + br i1 false, label %Loop, label %Out +Out: ; preds = %Loop + ret i32 %sunk2 +; CHECK: @test6 +; CHECK: Out: +; CHECK-NEXT: %dead = getelementptr %Ty* @X2, i64 0, i32 0 +; CHECK-NEXT: %sunk2 = load i32* %dead +; CHECK-NEXT: ret i32 %sunk2 +} + + + +; This testcase ensures that we can sink instructions from loops with +; multiple exits. +; +define i32 @test7(i32 %N, i1 %C) { +Entry: + br label %Loop +Loop: ; preds = %ContLoop, %Entry + %N_addr.0.pn = phi i32 [ %dec, %ContLoop ], [ %N, %Entry ] + %tmp.6 = mul i32 %N, %N_addr.0.pn + %tmp.7 = sub i32 %tmp.6, %N ; <i32> [#uses=2] + %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1] + br i1 %C, label %ContLoop, label %Out1 +ContLoop: + %tmp.1 = icmp ne i32 %N_addr.0.pn, 1 + br i1 %tmp.1, label %Loop, label %Out2 +Out1: ; preds = %Loop + ret i32 %tmp.7 +Out2: ; preds = %ContLoop + ret i32 %tmp.7 +; CHECK: @test7 +; CHECK: Out1: +; CHECK-NEXT: mul i32 %N, %N_addr.0.pn +; CHECK-NEXT: sub i32 %tmp.6, %N +; CHECK-NEXT: ret +; CHECK: Out2: +; CHECK-NEXT: mul i32 %N, %N_addr.0.pn +; CHECK-NEXT: sub i32 %tmp.6 +; CHECK-NEXT: ret +} + + +; This testcase checks to make sure we can sink values which are only live on +; some exits out of the loop, and that we can do so without breaking dominator +; info. +define i32 @test8(i1 %C1, i1 %C2, i32* %P, i32* %Q) { +Entry: + br label %Loop +Loop: ; preds = %Cont, %Entry + br i1 %C1, label %Cont, label %exit1 +Cont: ; preds = %Loop + %X = load i32* %P ; <i32> [#uses=2] + store i32 %X, i32* %Q + %V = add i32 %X, 1 ; <i32> [#uses=1] + br i1 %C2, label %Loop, label %exit2 +exit1: ; preds = %Loop + ret i32 0 +exit2: ; preds = %Cont + ret i32 %V +; CHECK: @test8 +; CHECK: exit1: +; CHECK-NEXT: ret i32 0 +; CHECK: exit2: +; CHECK-NEXT: %V = add i32 %X, 1 +; CHECK-NEXT: ret i32 %V +} + + +define void @test9() { +loopentry.2.i: + br i1 false, label %no_exit.1.i.preheader, label %loopentry.3.i.preheader +no_exit.1.i.preheader: ; preds = %loopentry.2.i + br label %no_exit.1.i +no_exit.1.i: ; preds = %endif.8.i, %no_exit.1.i.preheader + br i1 false, label %return.i, label %endif.8.i +endif.8.i: ; preds = %no_exit.1.i + %inc.1.i = add i32 0, 1 ; <i32> [#uses=1] + br i1 false, label %no_exit.1.i, label %loopentry.3.i.preheader.loopexit +loopentry.3.i.preheader.loopexit: ; preds = %endif.8.i + br label %loopentry.3.i.preheader +loopentry.3.i.preheader: ; preds = %loopentry.3.i.preheader.loopexit, %loopentry.2.i + %arg_num.0.i.ph13000 = phi i32 [ 0, %loopentry.2.i ], [ %inc.1.i, %loopentry.3.i.preheader.loopexit ] ; <i32> [#uses=0] + ret void +return.i: ; preds = %no_exit.1.i + ret void + +; CHECK: @test9 +; CHECK: loopentry.3.i.preheader.loopexit: +; CHECK-NEXT: %inc.1.i = add i32 0, 1 +; CHECK-NEXT: br label %loopentry.3.i.preheader +} + + +; Potentially trapping instructions may be sunk as long as they are guaranteed +; to be executed. +define i32 @test10(i32 %N) { +Entry: + br label %Loop +Loop: ; preds = %Loop, %Entry + %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ] ; <i32> [#uses=3] + %tmp.6 = sdiv i32 %N, %N_addr.0.pn ; <i32> [#uses=1] + %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1] + %tmp.1 = icmp ne i32 %N_addr.0.pn, 0 ; <i1> [#uses=1] + br i1 %tmp.1, label %Loop, label %Out +Out: ; preds = %Loop + ret i32 %tmp.6 + +; CHECK: @test10 +; CHECK: Out: +; CHECK-NEXT: %tmp.6 = sdiv i32 %N, %N_addr.0.pn +; CHECK-NEXT: ret i32 %tmp.6 +} + diff --git a/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll b/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll index ecba2f4..bcc73fd 100644 --- a/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll +++ b/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-deletion | llvm-dis | grep switch +; RUN: opt < %s -loop-deletion -S | grep switch ; PR 1564 define fastcc void @out() { diff --git a/test/Transforms/LoopDeletion/2008-05-06-Phi.ll b/test/Transforms/LoopDeletion/2008-05-06-Phi.ll index bfb747a..4fc6378 100644 --- a/test/Transforms/LoopDeletion/2008-05-06-Phi.ll +++ b/test/Transforms/LoopDeletion/2008-05-06-Phi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -tailduplicate -instcombine -jump-threading -licm -loop-unswitch -instcombine -indvars -loop-deletion -gvn -simplifycfg -verify -disable-output +; RUN: opt < %s -inline -tailduplicate -instcombine -jump-threading -licm -loop-unswitch -instcombine -indvars -loop-deletion -gvn -simplifycfg -verify -disable-output 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" target triple = "i386-apple-darwin9" diff --git a/test/Transforms/LoopDeletion/dcetest.ll b/test/Transforms/LoopDeletion/dcetest.ll index c112cae..f1e793d 100644 --- a/test/Transforms/LoopDeletion/dcetest.ll +++ b/test/Transforms/LoopDeletion/dcetest.ll @@ -1,7 +1,7 @@ ; This is the test case taken from Appel's book that illustrates a hard case ; that SCCP gets right, and when followed by ADCE, is completely eliminated ; -; RUN: llvm-as < %s | opt -sccp -simplifycfg -indvars -loop-deletion -dce -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -sccp -simplifycfg -indvars -loop-deletion -dce -simplifycfg -S | not grep br define i32 @"test function"(i32 %i0, i32 %j0) { BB1: diff --git a/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll b/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll index fa1ab2d..d922ecb 100644 --- a/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll +++ b/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll @@ -1,5 +1,5 @@ ; PR1692 -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* } diff --git a/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll b/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll index 928fd95..3ebd9b3 100644 --- a/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll +++ b/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll @@ -1,6 +1,6 @@ ; Update loop iteraton space to eliminate condition inside loop. -; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep bothcond +; RUN: opt < %s -loop-index-split -S | not grep bothcond define void @test(float* %x, i32 %ndat, float** %y, float %xcen, i32 %xmin, i32 %xmax, float %sigmal, float %contribution) { entry: %tmp519 = icmp sgt i32 %xmin, %xmax ; <i1> [#uses=1] diff --git a/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll b/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll index 6619c7d..8f4ee24 100644 --- a/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll +++ b/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll @@ -1,6 +1,6 @@ ; PR714 ; Update loop iteraton space to eliminate condition inside loop. -; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep bothcond +; RUN: opt < %s -loop-index-split -S | not grep bothcond define void @test(float* %x, i32 %ndat, float** %y, float %xcen, i32 %xmin, i32 %xmax, float %sigmal, float %contribution) { entry: diff --git a/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll b/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll index a4966a9..1550bc7 100644 --- a/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll +++ b/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \ +; RUN: opt < %s -loop-index-split -disable-output -stats |& \ ; RUN: not grep "loop-index-split" ; Induction variable decrement is not yet handled. diff --git a/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll b/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll index 4ad9067..0847464 100644 --- a/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll +++ b/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output ; PR 1995 define void @add_blkdev_randomness(i32 %major) nounwind { diff --git a/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll b/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll index 9fa83e4..980a42f 100644 --- a/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll +++ b/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -loop-index-split +; RUN: opt < %s -disable-output -loop-index-split ; PR 2011 %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } diff --git a/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll b/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll index 0c67ea2..9351caf 100644 --- a/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll +++ b/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output ; PR 2011 %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } diff --git a/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll b/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll index 393299f..6d6defa 100644 --- a/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll +++ b/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output ; PR 2011 %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } diff --git a/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll b/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll index 2ee51e1..f1a03e2 100644 --- a/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll +++ b/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output ; PR 2030 %struct.FULL = type { i32, i32, [1000 x float*] } diff --git a/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll b/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll index 24f22ca..ca22e50 100644 --- a/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll +++ b/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output ; Handle Exit block phis that do not have any use inside the loop. %struct.ATOM = type { double, double, double, double, double, double, i32, double, double, double, double, i8*, i8, [9 x i8], double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, [200 x i8*], [32 x i8*], [32 x i8], i32 } diff --git a/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll b/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll index 5809918..7447e6d 100644 --- a/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll +++ b/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -stats -disable-output | not grep "loop-index-split" +; RUN: opt < %s -loop-index-split -stats -disable-output | not grep "loop-index-split" ;PR2294 @g_2 = external global i16 ; <i16*> [#uses=4] @g_5 = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll b/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll index 1f6876c..6f691de 100644 --- a/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll +++ b/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -loop-unswitch -loop-index-split -instcombine -disable-output +; RUN: opt < %s -loop-rotate -loop-unswitch -loop-index-split -instcombine -disable-output 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" target triple = "i386-apple-darwin9" %struct.__CFData = type opaque diff --git a/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll b/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll index 7592511..1fcd960 100644 --- a/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll +++ b/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -stats -disable-output | not grep "1 loop-index-split" +; RUN: opt < %s -loop-index-split -stats -disable-output | not grep "1 loop-index-split" ; PR 2487 @g_6 = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll b/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll index a7a7cc2..ee8e7a3 100644 --- a/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll +++ b/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -stats -disable-output | not grep "loop-index-split" +; RUN: opt < %s -loop-index-split -stats -disable-output | not grep "loop-index-split" ; PR 2791 @g_40 = common global i32 0 ; <i32*> [#uses=1] @g_192 = common global i32 0 ; <i32*> [#uses=2] diff --git a/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll b/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll index f66edcd..ef67736 100644 --- a/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll +++ b/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output ; PR 2805 @g_330 = common global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll b/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll index b477b73..cca54ad 100644 --- a/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll +++ b/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output %struct.RExC_state_t = type { i32, i8*, %struct.regexp*, i8*, i8*, i8*, i32, %struct.regnode*, %struct.regnode*, i32, i32, i32, i32, i32, i32, i32, i32, i32 } %struct.SV = type { i8*, i32, i32 } %struct.reg_data = type { i32, i8*, [1 x i8*] } diff --git a/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll b/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll index 417f091..372fee5 100644 --- a/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll +++ b/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -stats -disable-output |& grep "1 loop-index-split" +; RUN: opt < %s -loop-index-split -stats -disable-output |& grep "1 loop-index-split" ; PR 2869 @w = external global [2 x [2 x i32]] ; <[2 x [2 x i32]]*> [#uses=5] diff --git a/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll b/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll index 11ee0f5..217ff52 100644 --- a/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll +++ b/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -stats | not grep "loop-index-split" +; RUN: opt < %s -loop-index-split -stats | not grep "loop-index-split" ; PR3029 @g_138 = common global i32 0 ; <i32*> [#uses=3] diff --git a/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll b/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll index 73113e7..9acf391 100644 --- a/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll +++ b/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output %struct.CGPoint = type { double, double } %struct.IBCFMutableDictionary = type { %struct.NSMutableArray, %struct.__CFDictionary*, %struct.NSSortDescriptor*, %struct.NSSortDescriptor* } %struct.IBInspectorMode = type opaque diff --git a/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll b/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll index b34cb51..deef941 100644 --- a/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll +++ b/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep undef +; RUN: opt < %s -loop-index-split -S | not grep undef define i32 @main() { entry: br label %header diff --git a/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll b/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll index d77f55a..ad2b794 100644 --- a/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll +++ b/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output %struct._edit_script = type { %struct._edit_script*, i32, i8 } diff --git a/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll b/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll index 4b2cffd..187484a 100644 --- a/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll +++ b/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output ; PR1828.bc 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll b/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll index 241b7dc..098e407 100644 --- a/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll +++ b/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output %struct._edit_script = type { %struct._edit_script*, i32, i8 } diff --git a/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll b/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll index 9e79f48..a04715a 100644 --- a/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll +++ b/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-index-split -disable-output +; RUN: opt < %s -loop-index-split -disable-output @k = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll b/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll index e98f699..d18b3b7 100644 --- a/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll +++ b/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll @@ -1,5 +1,5 @@ ; Loop is elimianted -; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \ +; RUN: opt < %s -loop-index-split -disable-output -stats |& \ ; RUN: grep "loop-index-split" | count 1 %struct.anon = type { i32 } @S1 = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll b/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll index 31332bd..ff73a5b 100644 --- a/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll +++ b/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll @@ -1,5 +1,5 @@ ; Loop is elimianted. Save last value assignment. -; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \ +; RUN: opt < %s -loop-index-split -disable-output -stats |& \ ; RUN: grep "loop-index-split" | count 1 %struct.anon = type { i32 } diff --git a/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll b/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll index bf568e5..6adb268 100644 --- a/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll +++ b/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll @@ -1,5 +1,5 @@ ; Loop is elimianted. Save last value assignments, including induction variable. -; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats | not grep "loop-index-split" +; RUN: opt < %s -loop-index-split -disable-output -stats | not grep "loop-index-split" declare i32 @foo(i32) declare i32 @bar(i32, i32) diff --git a/test/Transforms/LoopIndexSplit/PR3913.ll b/test/Transforms/LoopIndexSplit/PR3913.ll new file mode 100644 index 0000000..a2bf57c --- /dev/null +++ b/test/Transforms/LoopIndexSplit/PR3913.ll @@ -0,0 +1,24 @@ +; RUN: opt < %s -loop-index-split -S | not grep "icmp ne" + +define i32 @main() { +entry: + br label %header + +header: + %r = phi i32 [ 0, %entry ], [ %r3, %skip ] + %i = phi i32 [ 0, %entry ], [ %i1, %skip ] + %cond = icmp eq i32 %i, 99 + br i1 %cond, label %body, label %skip + +body: + br label %skip + +skip: + %r3 = phi i32 [ %r, %header ], [ 3, %body ] + %i1 = add i32 %i, 1 + %exitcond = icmp eq i32 %i1, 10 + br i1 %exitcond, label %exit, label %header + +exit: + ret i32 %r3 +} diff --git a/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll b/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll index e19f22a..fc7d9e9 100644 --- a/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll +++ b/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll @@ -1,5 +1,5 @@ ; Split loop. Save last value. -; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \ +; RUN: opt < %s -loop-index-split -disable-output -stats |& \ ; RUN: grep "loop-index-split" | count 1 @k = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24-dbg.ll b/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24-dbg.ll index 3b237bb..09a6423 100644 --- a/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24-dbg.ll +++ b/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24-dbg.ll @@ -1,5 +1,5 @@ ; Split loop. Save last value. Split value is off by one in this example. -; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \ +; RUN: opt < %s -loop-index-split -disable-output -stats |& \ ; RUN: grep "loop-index-split" | count 1 %llvm.dbg.anchor.type = type { i32, i32 } diff --git a/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll b/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll index 27327a0..f61d967 100644 --- a/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll +++ b/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll @@ -1,5 +1,5 @@ ; Split loop. Save last value. Split value is off by one in this example. -; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \ +; RUN: opt < %s -loop-index-split -disable-output -stats |& \ ; RUN: grep "loop-index-split" | count 1 @k = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll b/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll index c506451..17f75d7 100644 --- a/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll +++ b/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll @@ -1,6 +1,6 @@ ; Split loop. Split value is a constant and greater then exit value. ; Check whether optimizer inserts proper checkfor split value or not. -; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | grep select +; RUN: opt < %s -loop-index-split -S | grep select @k = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll b/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll index caaa8ad..6eed981 100644 --- a/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll +++ b/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -reassociate -loop-rotate -loop-index-split -indvars -simplifycfg -verify +; RUN: opt < %s -inline -reassociate -loop-rotate -loop-index-split -indvars -simplifycfg -verify ; PR4471 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" diff --git a/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll b/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll index 7cc3951..3e170dc 100644 --- a/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll +++ b/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis +; RUN: opt < %s -loop-rotate | llvm-dis ; PR3408 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" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Transforms/LoopRotate/LRCrash-1.ll b/test/Transforms/LoopRotate/LRCrash-1.ll index e6c7667..7d148e7 100644 --- a/test/Transforms/LoopRotate/LRCrash-1.ll +++ b/test/Transforms/LoopRotate/LRCrash-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -disable-output +; RUN: opt < %s -loop-rotate -disable-output %struct.relation = type { [4 x i16], i32, [4 x i16], i32, i32 } diff --git a/test/Transforms/LoopRotate/LRCrash-2.ll b/test/Transforms/LoopRotate/LRCrash-2.ll index 6dbe76d..e117c11 100644 --- a/test/Transforms/LoopRotate/LRCrash-2.ll +++ b/test/Transforms/LoopRotate/LRCrash-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -disable-output +; RUN: opt < %s -loop-rotate -disable-output define void @findAllPairs() { entry: diff --git a/test/Transforms/LoopRotate/LRCrash-3.ll b/test/Transforms/LoopRotate/LRCrash-3.ll index 94991a5..617dd8e 100644 --- a/test/Transforms/LoopRotate/LRCrash-3.ll +++ b/test/Transforms/LoopRotate/LRCrash-3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -disable-output +; RUN: opt < %s -loop-rotate -disable-output define void @_ZN9Classfile4readEv() { entry: diff --git a/test/Transforms/LoopRotate/LRCrash-4.ll b/test/Transforms/LoopRotate/LRCrash-4.ll index ab43fc8..b2f3224 100644 --- a/test/Transforms/LoopRotate/LRCrash-4.ll +++ b/test/Transforms/LoopRotate/LRCrash-4.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -disable-output +; RUN: opt < %s -loop-rotate -disable-output define void @InterpretSEIMessage(i8* %msg) { entry: diff --git a/test/Transforms/LoopRotate/LRCrash-5.ll b/test/Transforms/LoopRotate/LRCrash-5.ll index d61e749..7b6085d 100644 --- a/test/Transforms/LoopRotate/LRCrash-5.ll +++ b/test/Transforms/LoopRotate/LRCrash-5.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -disable-output +; RUN: opt < %s -loop-rotate -disable-output 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" target triple = "x86_64-apple-darwin9" %struct.NSArray = type { %struct.NSObject } diff --git a/test/Transforms/LoopRotate/PhiRename-1.ll b/test/Transforms/LoopRotate/PhiRename-1.ll index 573e396..fe7eaf9 100644 --- a/test/Transforms/LoopRotate/PhiRename-1.ll +++ b/test/Transforms/LoopRotate/PhiRename-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep {\\\[ .tmp224} +; RUN: opt < %s -loop-rotate -S | not grep {\\\[ .tmp224} ; END. 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" diff --git a/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll b/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll index a55704b..b0d31bd 100644 --- a/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll +++ b/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-rotate -disable-output +; RUN: opt < %s -loop-rotate -disable-output ; ModuleID = 'PhiSelfRefernce-1.bc' define void @snrm2(i32 %incx) { diff --git a/test/Transforms/LoopRotate/pr2639.ll b/test/Transforms/LoopRotate/pr2639.ll index 67477ad..96f87d5 100644 --- a/test/Transforms/LoopRotate/pr2639.ll +++ b/test/Transforms/LoopRotate/pr2639.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-deletion -loop-rotate -disable-output +; RUN: opt < %s -loop-deletion -loop-rotate -disable-output ; PR 2639 %struct.HexxagonMove = type { i8, i8, i32 } diff --git a/test/Transforms/LoopRotate/preserve-scev.ll b/test/Transforms/LoopRotate/preserve-scev.ll new file mode 100644 index 0000000..9eedaa4 --- /dev/null +++ b/test/Transforms/LoopRotate/preserve-scev.ll @@ -0,0 +1,47 @@ +; RUN: opt < %s -loop-rotate -loop-reduce -disable-output + +define fastcc void @foo() nounwind { +BB: + br label %BB1 + +BB1: ; preds = %BB19, %BB + br label %BB4 + +BB2: ; preds = %BB4 + %tmp = bitcast i32 undef to i32 ; <i32> [#uses=1] + br label %BB4 + +BB4: ; preds = %BB3, %BB1 + %tmp5 = phi i32 [ undef, %BB1 ], [ %tmp, %BB2 ] ; <i32> [#uses=1] + br i1 false, label %BB8, label %BB2 + +BB8: ; preds = %BB6 + %tmp7 = bitcast i32 %tmp5 to i32 ; <i32> [#uses=2] + br i1 false, label %BB9, label %BB13 + +BB9: ; preds = %BB12, %BB8 + %tmp10 = phi i32 [ %tmp11, %BB12 ], [ %tmp7, %BB8 ] ; <i32> [#uses=2] + %tmp11 = add i32 %tmp10, 1 ; <i32> [#uses=1] + br label %BB12 + +BB12: ; preds = %BB9 + br i1 false, label %BB9, label %BB17 + +BB13: ; preds = %BB15, %BB8 + %tmp14 = phi i32 [ %tmp16, %BB15 ], [ %tmp7, %BB8 ] ; <i32> [#uses=1] + br label %BB15 + +BB15: ; preds = %BB13 + %tmp16 = add i32 %tmp14, -1 ; <i32> [#uses=1] + br i1 false, label %BB13, label %BB18 + +BB17: ; preds = %BB12 + br label %BB19 + +BB18: ; preds = %BB15 + br label %BB19 + +BB19: ; preds = %BB18, %BB17 + %tmp20 = phi i32 [ %tmp10, %BB17 ], [ undef, %BB18 ] ; <i32> [#uses=0] + br label %BB1 +} diff --git a/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll b/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll index 70445fb..bf862f6 100644 --- a/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll +++ b/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll @@ -1,7 +1,7 @@ ; This testcase exposed a problem with the loop identification pass (LoopInfo). ; Basically, it was incorrectly calculating the loop nesting information. ; -; RUN: llvm-as < %s | opt -loopsimplify +; RUN: opt < %s -loopsimplify define i32 @yylex() { br label %loopentry.0 diff --git a/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll b/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll index ba2eef7..cd9749b 100644 --- a/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll +++ b/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll @@ -2,7 +2,7 @@ ; inserted for the "fail" loop, but the exit block of a loop is not updated ; to be the preheader instead of the exit loop itself. -; RUN: llvm-as < %s | opt -loopsimplify +; RUN: opt < %s -loopsimplify define i32 @re_match_2() { br label %loopentry.1 loopentry.1: ; preds = %endif.82, %0 diff --git a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll index 53fc59e..11be694 100644 --- a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll +++ b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output +; RUN: opt < %s -tailduplicate -instcombine -simplifycfg -licm -disable-output target datalayout = "e-p:32:32" @yy_base = external global [787 x i16] ; <[787 x i16]*> [#uses=1] @yy_state_ptr = external global i32* ; <i32**> [#uses=3] diff --git a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll index bd39330c..fb39f05 100644 --- a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll +++ b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll @@ -4,7 +4,7 @@ ; ; This is distilled from a monsterous crafty example. -; RUN: llvm-as < %s | opt -licm -disable-output +; RUN: opt < %s -licm -disable-output @G = weak global i32 0 ; <i32*> [#uses=7] diff --git a/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll b/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll index b8ced96..a5d0ba7 100644 --- a/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll +++ b/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify -verify -licm -disable-output +; RUN: opt < %s -loopsimplify -verify -licm -disable-output define void @.subst_48() { entry: diff --git a/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll b/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll index 439ea7e..dc5c313 100644 --- a/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll +++ b/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify -licm -disable-output +; RUN: opt < %s -loopsimplify -licm -disable-output define void @main() { entry: br i1 false, label %Out, label %loop diff --git a/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll b/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll index e75b214..721f9b3 100644 --- a/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll +++ b/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify -licm -disable-output +; RUN: opt < %s -loopsimplify -licm -disable-output ; This is PR306 diff --git a/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll b/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll index ae11d80..cbdfe8b 100644 --- a/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll +++ b/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify -disable-output +; RUN: opt < %s -loopsimplify -disable-output define void @test() { loopentry.0: diff --git a/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll b/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll index bd0515c..4fe6e21 100644 --- a/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll +++ b/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -loopsimplify -licm -disable-output -verify-dom-info +; RUN: opt < %s -scalarrepl -loopsimplify -licm -disable-output -verify-dom-info -verify-loop-info define void @inflate() { entry: diff --git a/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll b/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll index 914fcd1..10202dc 100644 --- a/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll +++ b/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify -disable-output +; RUN: opt < %s -loopsimplify -disable-output ; PR1752 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-s0:0:64-f80:32:32" target triple = "i686-pc-mingw32" diff --git a/test/Transforms/LoopSimplify/basictest.ll b/test/Transforms/LoopSimplify/basictest.ll index 0388b0e..4241d8a 100644 --- a/test/Transforms/LoopSimplify/basictest.ll +++ b/test/Transforms/LoopSimplify/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify +; RUN: opt < %s -loopsimplify ; This function should get a preheader inserted before BB3, that is jumped ; to by BB1 & BB2 diff --git a/test/Transforms/LoopSimplify/hardertest.ll b/test/Transforms/LoopSimplify/hardertest.ll index 6ee0567..e0a7f81 100644 --- a/test/Transforms/LoopSimplify/hardertest.ll +++ b/test/Transforms/LoopSimplify/hardertest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify +; RUN: opt < %s -loopsimplify define void @foo(i1 %C) { br i1 %C, label %T, label %F diff --git a/test/Transforms/LoopSimplify/merge-exits.ll b/test/Transforms/LoopSimplify/merge-exits.ll index c5bf7fd..45f506a 100644 --- a/test/Transforms/LoopSimplify/merge-exits.ll +++ b/test/Transforms/LoopSimplify/merge-exits.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -loopsimplify -loop-rotate -instcombine -indvars \ -; RUN: | llvm-dis > %t +; RUN: opt < %s -loopsimplify -loop-rotate -instcombine -indvars -S > %t ; RUN: not grep sext %t ; RUN: grep {phi i64} %t | count 1 diff --git a/test/Transforms/LoopSimplify/phi-node-simplify.ll b/test/Transforms/LoopSimplify/phi-node-simplify.ll index a22fadb..5e957cc 100644 --- a/test/Transforms/LoopSimplify/phi-node-simplify.ll +++ b/test/Transforms/LoopSimplify/phi-node-simplify.ll @@ -1,5 +1,5 @@ ; Loop Simplify should turn phi nodes like X = phi [X, Y] into just Y, eliminating them. -; RUN: llvm-as < %s | opt -loopsimplify | llvm-dis | grep phi | count 6 +; RUN: opt < %s -loopsimplify -S | grep phi | count 6 @A = weak global [3000000 x i32] zeroinitializer ; <[3000000 x i32]*> [#uses=1] @B = weak global [20000 x i32] zeroinitializer ; <[20000 x i32]*> [#uses=1] diff --git a/test/Transforms/LoopSimplify/single-backedge.ll b/test/Transforms/LoopSimplify/single-backedge.ll index 8391048..f9567f1 100644 --- a/test/Transforms/LoopSimplify/single-backedge.ll +++ b/test/Transforms/LoopSimplify/single-backedge.ll @@ -2,7 +2,7 @@ ; for all loops. This allows the -indvars pass to recognize the %IV ; induction variable in this testcase. -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar +; RUN: opt < %s -indvars -S | grep indvar define i32 @test(i1 %C) { ; <label>:0 diff --git a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll index 75574c0..1f08a43 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output define void @try_swap() { entry: diff --git a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll index 83d4696..f1c523a 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output define i32 @image_to_texture(i32 %indvar454) { loopentry.1.outer: diff --git a/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll b/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll index 145551b..f56a553 100644 --- a/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll +++ b/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output define void @main() { entry: diff --git a/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll b/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll index 2d2dade..8c2cfaf 100644 --- a/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll +++ b/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output 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" diff --git a/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll b/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll index be95d4d..7c7a21c 100644 --- a/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll +++ b/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep ugt +; RUN: opt < %s -loop-reduce -S | grep ugt ; PR2535 @.str = internal constant [4 x i8] c"%d\0A\00" diff --git a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll index fbd3c1e..90477d1 100644 --- a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll +++ b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep add | count 2 +; RUN: opt < %s -loop-reduce -S | grep add | count 2 ; PR 2662 @g_3 = common global i16 0 ; <i16*> [#uses=2] @"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/2008-08-14-ShadowIV.ll b/test/Transforms/LoopStrengthReduce/2008-08-14-ShadowIV.ll index 2377589..c650d8c 100644 --- a/test/Transforms/LoopStrengthReduce/2008-08-14-ShadowIV.ll +++ b/test/Transforms/LoopStrengthReduce/2008-08-14-ShadowIV.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep "phi double" | count 1 +; RUN: opt < %s -loop-reduce -S | grep "phi double" | count 1 define void @foobar(i32 %n) nounwind { entry: diff --git a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll index 703aebe..1ee6b5c 100644 --- a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll +++ b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 2 +; RUN: opt < %s -loop-reduce -S | grep phi | count 2 ; PR 2779 @g_19 = common global i32 0 ; <i32*> [#uses=3] @"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll index a707285..b2cf818 100644 --- a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll +++ b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 1 -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep mul | count 1 +; RUN: opt < %s -loop-reduce -S | grep phi | count 1 +; RUN: opt < %s -loop-reduce -S | grep mul | count 1 ; ModuleID = '<stdin>' ; Make sure examining a fuller expression outside the loop doesn't cause us to create a second ; IV of stride %3. diff --git a/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll b/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll index 0235fa8..36cc535 100644 --- a/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll +++ b/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc +; RUN: llc < %s ; This used to crash. ; ModuleID = 'bugpoint-reduced-simplified.bc' 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" diff --git a/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll b/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll index e1c9642..3a7496e 100644 --- a/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll +++ b/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis \ +; RUN: opt < %s -loop-reduce -S \ ; RUN: | grep {getelementptr.*%lsr.iv.*%lsr.iv.*<i32\\*>} ; The multiply in bb2 must not be reduced to an add, as the sext causes the ; %1 argument to become negative after a while. diff --git a/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll b/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll index 33b0522..56a89f6 100644 --- a/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll +++ b/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc --x86-asm-syntax=att | grep {cmpl \$4} +; RUN: llc %s -o - --x86-asm-syntax=att | grep {cmpl \$4} 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" target triple = "x86_64-apple-darwin9" diff --git a/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll b/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll index cb2f3aa..8a3978b 100644 --- a/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll +++ b/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc --x86-asm-syntax=att | grep {cmpq \$8} +; RUN: llc %s -o - --x86-asm-syntax=att | grep {cmpq \$8} 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" target triple = "x86_64-apple-darwin9" diff --git a/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll b/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll index f77aea3..ae27383 100644 --- a/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll +++ b/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc +; RUN: llc < %s ; PR4222 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-f80:128:128" diff --git a/test/Transforms/LoopStrengthReduce/dead-phi.ll b/test/Transforms/LoopStrengthReduce/dead-phi.ll index a6aafa9..07a942f 100644 --- a/test/Transforms/LoopStrengthReduce/dead-phi.ll +++ b/test/Transforms/LoopStrengthReduce/dead-phi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 1 +; RUN: opt < %s -loop-reduce -S | grep phi | count 1 define void @foo(i32 %n) { entry: diff --git a/test/Transforms/LoopStrengthReduce/different-type-ivs.ll b/test/Transforms/LoopStrengthReduce/different-type-ivs.ll index e5225da..8cdd264 100644 --- a/test/Transforms/LoopStrengthReduce/different-type-ivs.ll +++ b/test/Transforms/LoopStrengthReduce/different-type-ivs.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output ; Test to make sure that loop-reduce never crashes on IV's ; with different types but identical strides. diff --git a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll index 5209507..4136486 100644 --- a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll +++ b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ +; RUN: opt < %s -loop-reduce -S | \ ; RUN: not grep {bitcast i32 1 to i32} ; END. ; The setlt wants to use a value that is incremented one more than the dominant diff --git a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll index 68eb107..90051e3 100644 --- a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll +++ b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll @@ -1,5 +1,5 @@ ; Check that this test makes INDVAR and related stuff dead. -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 2 +; RUN: opt < %s -loop-reduce -S | grep phi | count 2 declare i1 @pred() diff --git a/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll b/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll index bfbbecf..2030000 100644 --- a/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll +++ b/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll @@ -1,7 +1,7 @@ ; Don't reduce the byte access to P[i], at least not on targets that ; support an efficient 'mem[r1+r2]' addressing mode. -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output declare i1 @pred(i32) diff --git a/test/Transforms/LoopStrengthReduce/dont_reverse.ll b/test/Transforms/LoopStrengthReduce/dont_reverse.ll index 39eca6c..214f15a 100644 --- a/test/Transforms/LoopStrengthReduce/dont_reverse.ll +++ b/test/Transforms/LoopStrengthReduce/dont_reverse.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis \ +; RUN: opt < %s -loop-reduce -S \ ; RUN: | grep {icmp eq i2 %lsr.iv.next, %xmp4344} ; Don't reverse the iteration if the rhs of the compare is defined diff --git a/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll b/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll index d21498b..abbfda6 100644 --- a/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll +++ b/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll @@ -2,8 +2,7 @@ ; having overlapping live ranges that result in copies. We want the setcc ; instruction immediately before the conditional branch. ; -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ -; RUN: %prcontext {br i1} 1 | grep icmp +; RUN: opt -S -loop-reduce %s | FileCheck %s define void @foo(float* %D, i32 %E) { entry: @@ -12,6 +11,8 @@ no_exit: ; preds = %no_exit, %entry %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=1] volatile store float 0.000000e+00, float* %D %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2] +; CHECK: icmp +; CHECK-NEXT: br i1 %exitcond = icmp eq i32 %indvar.next, %E ; <i1> [#uses=1] br i1 %exitcond, label %loopexit, label %no_exit loopexit: ; preds = %no_exit diff --git a/test/Transforms/LoopStrengthReduce/invariant_value_first.ll b/test/Transforms/LoopStrengthReduce/invariant_value_first.ll index 86a1c25..f86638b 100644 --- a/test/Transforms/LoopStrengthReduce/invariant_value_first.ll +++ b/test/Transforms/LoopStrengthReduce/invariant_value_first.ll @@ -1,5 +1,5 @@ ; Check that the index of 'P[outer]' is pulled out of the loop. -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ +; RUN: opt < %s -loop-reduce -S | \ ; RUN: not grep {getelementptr.*%outer.*%INDVAR} declare i1 @pred() diff --git a/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll b/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll index 8e9cbc4..37acf0f 100644 --- a/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll +++ b/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll @@ -1,5 +1,5 @@ ; Check that the index of 'P[outer]' is pulled out of the loop. -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ +; RUN: opt < %s -loop-reduce -S | \ ; RUN: not grep {getelementptr.*%outer.*%INDVAR} declare i1 @pred() diff --git a/test/Transforms/LoopStrengthReduce/nested-reduce.ll b/test/Transforms/LoopStrengthReduce/nested-reduce.ll index c19e844..58b8d3e 100644 --- a/test/Transforms/LoopStrengthReduce/nested-reduce.ll +++ b/test/Transforms/LoopStrengthReduce/nested-reduce.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep mul +; RUN: opt < %s -loop-reduce -S | not grep mul ; Make sure we don't get a multiply by 6 in this loop. diff --git a/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll b/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll index 5880dc1..a032cc9 100644 --- a/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll +++ b/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll @@ -1,7 +1,7 @@ ; Check that this test makes INDVAR and related stuff dead, because P[indvar] ; gets reduced, making INDVAR dead. -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep INDVAR +; RUN: opt < %s -loop-reduce -S | not grep INDVAR declare i1 @pred() diff --git a/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll b/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll index 64d387a..7ef494d 100644 --- a/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll +++ b/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output ; LSR should not crash on this. define fastcc void @loadloop() { diff --git a/test/Transforms/LoopStrengthReduce/pr2537.ll b/test/Transforms/LoopStrengthReduce/pr2537.ll index e9be384..73c3152 100644 --- a/test/Transforms/LoopStrengthReduce/pr2537.ll +++ b/test/Transforms/LoopStrengthReduce/pr2537.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output +; RUN: opt < %s -loop-reduce -disable-output ; PR 2537 define void @a() { diff --git a/test/Transforms/LoopStrengthReduce/pr2570.ll b/test/Transforms/LoopStrengthReduce/pr2570.ll index ce0c3bf..aafd24e 100644 --- a/test/Transforms/LoopStrengthReduce/pr2570.ll +++ b/test/Transforms/LoopStrengthReduce/pr2570.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep {phi\\>} | count 10 +; RUN: opt < %s -loop-reduce -S | grep {phi\\>} | count 10 ; PR2570 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" diff --git a/test/Transforms/LoopStrengthReduce/pr3086.ll b/test/Transforms/LoopStrengthReduce/pr3086.ll index f92bfe2..9a5911f 100644 --- a/test/Transforms/LoopStrengthReduce/pr3086.ll +++ b/test/Transforms/LoopStrengthReduce/pr3086.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -loop-reduce -disable-output -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output +; RUN: opt < %s -loop-reduce -disable-output +; RUN: opt < %s -analyze -scalar-evolution -disable-output ; PR 3086 %struct.Cls = type { i32, i8, [2 x %struct.Cls*], [2 x %struct.Lit*] } diff --git a/test/Transforms/LoopStrengthReduce/pr3399.ll b/test/Transforms/LoopStrengthReduce/pr3399.ll index 9d2f5ed..b809007 100644 --- a/test/Transforms/LoopStrengthReduce/pr3399.ll +++ b/test/Transforms/LoopStrengthReduce/pr3399.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis +; RUN: opt < %s -loop-reduce | llvm-dis ; PR3399 @g_53 = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/pr3571.ll b/test/Transforms/LoopStrengthReduce/pr3571.ll index 79fcdb1..9ad27d5 100644 --- a/test/Transforms/LoopStrengthReduce/pr3571.ll +++ b/test/Transforms/LoopStrengthReduce/pr3571.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis +; RUN: opt < %s -loop-reduce | llvm-dis ; PR3571 target triple = "i386-mingw32" diff --git a/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll index be1372d..2302dba 100644 --- a/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll +++ b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -iv-users -disable-output | grep {Stride i64 {3,+,2}<loop>:} +; RUN: opt < %s -analyze -iv-users -disable-output | grep {Stride i64 {3,+,2}<loop>:} ; The value of %r is dependent on a polynomial iteration expression. diff --git a/test/Transforms/LoopStrengthReduce/related_indvars.ll b/test/Transforms/LoopStrengthReduce/related_indvars.ll index 434da99..2494378 100644 --- a/test/Transforms/LoopStrengthReduce/related_indvars.ll +++ b/test/Transforms/LoopStrengthReduce/related_indvars.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 1 +; RUN: opt < %s -loop-reduce -S | grep phi | count 1 ; This should only result in one PHI node! diff --git a/test/Transforms/LoopStrengthReduce/remove_indvar.ll b/test/Transforms/LoopStrengthReduce/remove_indvar.ll index 623c0b5..53f4b9d 100644 --- a/test/Transforms/LoopStrengthReduce/remove_indvar.ll +++ b/test/Transforms/LoopStrengthReduce/remove_indvar.ll @@ -1,5 +1,5 @@ ; Check that this test makes INDVAR and related stuff dead. -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep INDVAR +; RUN: opt < %s -loop-reduce -S | not grep INDVAR declare i1 @pred() diff --git a/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll b/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll index a78fa5f..412a716 100644 --- a/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll +++ b/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep mul | count 1 +; RUN: opt < %s -loop-reduce -S | grep mul | count 1 ; LSR should not make two copies of the Q*L expression in the preheader! define i8 @test(i8* %A, i8* %B, i32 %L, i32 %Q, i32 %N.s) { diff --git a/test/Transforms/LoopStrengthReduce/share_ivs.ll b/test/Transforms/LoopStrengthReduce/share_ivs.ll index b52d571..0459bc8 100644 --- a/test/Transforms/LoopStrengthReduce/share_ivs.ll +++ b/test/Transforms/LoopStrengthReduce/share_ivs.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 1 +; RUN: opt < %s -loop-reduce -S | grep phi | count 1 ; This testcase should have ONE stride 18 indvar, the other use should have a ; loop invariant value (B) added to it inside of the loop, instead of having diff --git a/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll b/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll index 2c9c70d..a99a823 100644 --- a/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll +++ b/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ +; RUN: opt < %s -loop-reduce -S | \ ; RUN: grep {add i32 %lsr.iv.next, 1} ; ; Make sure that the use of the IV outside of the loop (the store) uses the diff --git a/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll b/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll index 53eedd6..0a9fab0 100644 --- a/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll +++ b/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll @@ -1,9 +1,9 @@ ; Base should not be i*3, it should be i*2. -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ +; RUN: opt < %s -loop-reduce -S | \ ; RUN: not grep {mul.*%i, 3} ; Indvar should not start at zero: -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | \ +; RUN: opt < %s -loop-reduce -S | \ ; RUN: not grep {phi i32 .* 0} ; END. diff --git a/test/Transforms/LoopStrengthReduce/variable_stride.ll b/test/Transforms/LoopStrengthReduce/variable_stride.ll index 90d3947..7c0f053 100644 --- a/test/Transforms/LoopStrengthReduce/variable_stride.ll +++ b/test/Transforms/LoopStrengthReduce/variable_stride.ll @@ -1,5 +1,5 @@ ; Check that variable strides are reduced to adds instead of multiplies. -; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep mul +; RUN: opt < %s -loop-reduce -S | not grep mul declare i1 @pred(i32) diff --git a/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll b/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll index 13a26a2..3141bf1 100644 --- a/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll +++ b/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unroll -disable-output +; RUN: opt < %s -loop-unroll -disable-output define i32 @main() { entry: diff --git a/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll b/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll index db107fd..a26346b 100644 --- a/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll +++ b/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unroll -loopsimplify -disable-output +; RUN: opt < %s -loop-unroll -loopsimplify -disable-output define void @print_board() { entry: diff --git a/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll b/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll index 16419ca..8219a0c 100644 --- a/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll +++ b/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unroll | llvm-dis | grep bb72.2 +; RUN: opt < %s -loop-unroll -S | grep bb72.2 define void @vorbis_encode_noisebias_setup() { entry: diff --git a/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll b/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll index 26fa60a..40c9ce0 100644 --- a/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll +++ b/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll @@ -1,5 +1,5 @@ ; PR 1334 -; RUN: llvm-as < %s | opt -loop-unroll -disable-output +; RUN: opt < %s -loop-unroll -disable-output define void @sal__math_float_manipulator_7__math__joint_array_dcv_ops__Omultiply__3([6 x float]* %agg.result) { entry: diff --git a/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll b/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll index 44890a6..d4c8402 100644 --- a/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll +++ b/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unroll | llvm-dis | not grep undef +; RUN: opt < %s -loop-unroll -S | not grep undef ; PR1385 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" diff --git a/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll b/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll index 2086e96..68842a4 100644 --- a/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll +++ b/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unroll -unroll-count=3 | llvm-dis | grep bb72.2 +; RUN: opt < %s -loop-unroll -unroll-count=3 -S | grep bb72.2 define void @foo(i32 %trips) { entry: diff --git a/test/Transforms/LoopUnroll/2007-11-05-Crash.ll b/test/Transforms/LoopUnroll/2007-11-05-Crash.ll index a46c09e..1711f11 100644 --- a/test/Transforms/LoopUnroll/2007-11-05-Crash.ll +++ b/test/Transforms/LoopUnroll/2007-11-05-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -loop-unroll +; RUN: opt < %s -disable-output -loop-unroll ; PR1770 ; PR1947 diff --git a/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll b/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll index b80220a..b4cf406 100644 --- a/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll +++ b/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output ; END. target datalayout = "E-p:32:32" diff --git a/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll b/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll index 916cba2..a50bd54 100644 --- a/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll +++ b/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output define void @sort_Eq(i32* %S2) { entry: diff --git a/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll b/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll index 60e464f..e030157 100644 --- a/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll +++ b/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output %struct.BLEND_MAP = type { i16, i16, i16, i32, %struct.BLEND_MAP_ENTRY* } %struct.BLEND_MAP_ENTRY = type { float, i8, { [5 x float], [4 x i8] } } diff --git a/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll b/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll index 67da9ff..fd4d730 100644 --- a/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll +++ b/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output define void @init_caller_save() { entry: diff --git a/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll b/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll index 08cb9b6..468b194 100644 --- a/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll +++ b/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll @@ -1,5 +1,5 @@ ; PR1333 -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/LoopUnswitch/2007-05-09-tl.ll b/test/Transforms/LoopUnswitch/2007-05-09-tl.ll index c987dae..61615d0 100644 --- a/test/Transforms/LoopUnswitch/2007-05-09-tl.ll +++ b/test/Transforms/LoopUnswitch/2007-05-09-tl.ll @@ -1,5 +1,5 @@ +; RUN: opt < %s -loop-unswitch -disable-output ; PR1333 -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output define void @pp_cxx_expression() { entry: diff --git a/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll b/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll index c4080c1..bf5a61b 100644 --- a/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll +++ b/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -disable-output +; RUN: opt < %s -loop-unswitch -instcombine -disable-output @str3 = external constant [3 x i8] ; <[3 x i8]*> [#uses=1] diff --git a/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll b/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll index de3f670..5ae335b 100644 --- a/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll +++ b/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output define i32 @main(i32 %argc, i8** %argv) { entry: diff --git a/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll b/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll index edd7d1f..dfca154 100644 --- a/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll +++ b/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output ; PR1559 target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll b/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll index 9673e2e..fc92579 100644 --- a/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll +++ b/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -loop-unswitch -disable-output +; RUN: opt < %s -licm -loop-unswitch -disable-output ; PR 1589 %struct.QBasicAtomic = type { i32 } diff --git a/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll b/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll index 139cdbe..f83acaa 100644 --- a/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll +++ b/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -disable-output +; RUN: opt < %s -loop-unswitch -instcombine -disable-output %struct.ClassDef = type { %struct.QByteArray, %struct.QByteArray, %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", i8, i8, %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QList<ArgumentDef>", %"struct.QMap<QByteArray,QByteArray>", %"struct.QList<ArgumentDef>", %"struct.QMap<QByteArray,QByteArray>", i32, i32 } %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } %struct.Generator = type { %struct.FILE*, %struct.ClassDef*, %"struct.QList<ArgumentDef>", %struct.QByteArray, %"struct.QList<ArgumentDef>" } diff --git a/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll b/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll index b236edc..efbb761 100644 --- a/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll +++ b/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -loop-unroll -disable-output +; RUN: opt < %s -licm -loop-unroll -disable-output @resonant = external global i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll b/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll index dcf41c3..906c2c5 100644 --- a/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll +++ b/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -gvn -disable-output +; RUN: opt < %s -loop-unswitch -instcombine -gvn -disable-output ; PR2372 target triple = "i386-pc-linux-gnu" diff --git a/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll b/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll index 713a0bd..f74054a 100644 --- a/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll +++ b/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -loop-unswitch -disable-output +; RUN: opt < %s -licm -loop-unswitch -disable-output @g_56 = external global i16 ; <i16*> [#uses=2] define i32 @func_67(i32 %p_68, i8 signext %p_69, i8 signext %p_71) nounwind { diff --git a/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll b/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll index 383aa5b..20f2c2b 100644 --- a/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll +++ b/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -stats -disable-output |& grep "1 loop-unswitch - Number of branches unswitched" | count 1 +; RUN: opt < %s -loop-unswitch -stats -disable-output |& grep "1 loop-unswitch - Number of branches unswitched" | count 1 ; PR 3170 define i32 @a(i32 %x, i32 %y) nounwind { entry: diff --git a/test/Transforms/LoopUnswitch/basictest.ll b/test/Transforms/LoopUnswitch/basictest.ll index eeaf08d..1e6f2cf 100644 --- a/test/Transforms/LoopUnswitch/basictest.ll +++ b/test/Transforms/LoopUnswitch/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +; RUN: opt < %s -loop-unswitch -disable-output define i32 @test(i32* %A, i1 %C) { entry: diff --git a/test/Transforms/LoopUnswitch/preserve-analyses.ll b/test/Transforms/LoopUnswitch/preserve-analyses.ll new file mode 100644 index 0000000..3364fb2 --- /dev/null +++ b/test/Transforms/LoopUnswitch/preserve-analyses.ll @@ -0,0 +1,129 @@ +; RUN: opt -loop-unswitch -verify-loop-info -verify-dom-info %s -disable-output + +; Loop unswitch should be able to unswitch these loops and +; preserve LCSSA and LoopSimplify forms. + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "armv6-apple-darwin9" + +@delim1 = external global i32 ; <i32*> [#uses=1] +@delim2 = external global i32 ; <i32*> [#uses=1] + +define arm_apcscc i32 @ineqn(i8* %s, i8* %p) nounwind readonly { +entry: + %0 = load i32* @delim1, align 4 ; <i32> [#uses=1] + %1 = load i32* @delim2, align 4 ; <i32> [#uses=1] + br label %bb8.outer + +bb: ; preds = %bb8 + %2 = icmp eq i8* %p_addr.0, %s ; <i1> [#uses=1] + br i1 %2, label %bb10, label %bb2 + +bb2: ; preds = %bb + %3 = getelementptr inbounds i8* %p_addr.0, i32 1 ; <i8*> [#uses=3] + switch i32 %ineq.0.ph, label %bb8.backedge [ + i32 0, label %bb3 + i32 1, label %bb6 + ] + +bb8.backedge: ; preds = %bb6, %bb5, %bb2 + br label %bb8 + +bb3: ; preds = %bb2 + %4 = icmp eq i32 %8, %0 ; <i1> [#uses=1] + br i1 %4, label %bb8.outer.loopexit, label %bb5 + +bb5: ; preds = %bb3 + br i1 %6, label %bb6, label %bb8.backedge + +bb6: ; preds = %bb5, %bb2 + %5 = icmp eq i32 %8, %1 ; <i1> [#uses=1] + br i1 %5, label %bb7, label %bb8.backedge + +bb7: ; preds = %bb6 + %.lcssa1 = phi i8* [ %3, %bb6 ] ; <i8*> [#uses=1] + br label %bb8.outer.backedge + +bb8.outer.backedge: ; preds = %bb8.outer.loopexit, %bb7 + %.lcssa2 = phi i8* [ %.lcssa1, %bb7 ], [ %.lcssa, %bb8.outer.loopexit ] ; <i8*> [#uses=1] + %ineq.0.ph.be = phi i32 [ 0, %bb7 ], [ 1, %bb8.outer.loopexit ] ; <i32> [#uses=1] + br label %bb8.outer + +bb8.outer.loopexit: ; preds = %bb3 + %.lcssa = phi i8* [ %3, %bb3 ] ; <i8*> [#uses=1] + br label %bb8.outer.backedge + +bb8.outer: ; preds = %bb8.outer.backedge, %entry + %ineq.0.ph = phi i32 [ 0, %entry ], [ %ineq.0.ph.be, %bb8.outer.backedge ] ; <i32> [#uses=3] + %p_addr.0.ph = phi i8* [ %p, %entry ], [ %.lcssa2, %bb8.outer.backedge ] ; <i8*> [#uses=1] + %6 = icmp eq i32 %ineq.0.ph, 1 ; <i1> [#uses=1] + br label %bb8 + +bb8: ; preds = %bb8.outer, %bb8.backedge + %p_addr.0 = phi i8* [ %p_addr.0.ph, %bb8.outer ], [ %3, %bb8.backedge ] ; <i8*> [#uses=3] + %7 = load i8* %p_addr.0, align 1 ; <i8> [#uses=2] + %8 = sext i8 %7 to i32 ; <i32> [#uses=2] + %9 = icmp eq i8 %7, 0 ; <i1> [#uses=1] + br i1 %9, label %bb10, label %bb + +bb10: ; preds = %bb8, %bb + %.0 = phi i32 [ %ineq.0.ph, %bb ], [ 0, %bb8 ] ; <i32> [#uses=1] + ret i32 %.0 +} + +; This is a simplified form of ineqn from above. It triggers some +; different cases in the loop-unswitch code. + +define void @simplified_ineqn() nounwind readonly { +entry: + br label %bb8.outer + +bb8.outer: ; preds = %bb6, %bb2, %entry + %x = phi i32 [ 0, %entry ], [ 0, %bb6 ], [ 1, %bb2 ] ; <i32> [#uses=1] + br i1 undef, label %return, label %bb2 + +bb2: ; preds = %bb + switch i32 %x, label %bb6 [ + i32 0, label %bb8.outer + ] + +bb6: ; preds = %bb2 + br i1 undef, label %bb8.outer, label %bb2 + +return: ; preds = %bb8, %bb + ret void +} + +; This function requires special handling to preserve LCSSA form. +; PR4934 + +define void @pnp_check_irq() nounwind noredzone { +entry: + %conv56 = trunc i64 undef to i32 ; <i32> [#uses=1] + br label %while.cond.i + +while.cond.i: ; preds = %while.cond.i.backedge, %entry + %call.i25 = call i8* @pci_get_device() nounwind noredzone ; <i8*> [#uses=2] + br i1 undef, label %if.then65, label %while.body.i + +while.body.i: ; preds = %while.cond.i + br i1 undef, label %if.then31.i.i, label %while.cond.i.backedge + +while.cond.i.backedge: ; preds = %if.then31.i.i, %while.body.i + br label %while.cond.i + +if.then31.i.i: ; preds = %while.body.i + switch i32 %conv56, label %while.cond.i.backedge [ + i32 14, label %if.then42.i.i + i32 15, label %if.then42.i.i + ] + +if.then42.i.i: ; preds = %if.then31.i.i, %if.then31.i.i + %call.i25.lcssa48 = phi i8* [ %call.i25, %if.then31.i.i ], [ %call.i25, %if.then31.i.i ] ; <i8*> [#uses=0] + unreachable + +if.then65: ; preds = %while.cond.i + unreachable +} + +declare i8* @pci_get_device() noredzone diff --git a/test/Transforms/LowerInvoke/2003-12-10-Crash.ll b/test/Transforms/LowerInvoke/2003-12-10-Crash.ll index 1e8b880..31f3d42 100644 --- a/test/Transforms/LowerInvoke/2003-12-10-Crash.ll +++ b/test/Transforms/LowerInvoke/2003-12-10-Crash.ll @@ -1,6 +1,6 @@ ; This testcase was reduced from Shootout-C++/reversefile.cpp by bugpoint -; RUN: llvm-as < %s | opt -lowerinvoke -disable-output +; RUN: opt < %s -lowerinvoke -disable-output declare void @baz() diff --git a/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll b/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll index 0777013..bddb702 100644 --- a/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll +++ b/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output +; RUN: opt < %s -lowerinvoke -enable-correct-eh-support -disable-output define void @_ZNKSt11__use_cacheISt16__numpunct_cacheIcEEclERKSt6locale() { entry: diff --git a/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll b/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll index 10c8785..1057ad7 100644 --- a/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll +++ b/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output +; RUN: opt < %s -lowerinvoke -enable-correct-eh-support -disable-output declare void @ll_listnext__listiterPtr() diff --git a/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll b/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll index 0a8ccbe..9402046 100644 --- a/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll +++ b/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output +; RUN: opt < %s -lowerinvoke -enable-correct-eh-support -disable-output declare fastcc i32 @ll_listnext__listiterPtr() diff --git a/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll b/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll index fa82539..b46ccfb 100644 --- a/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll +++ b/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output +; RUN: opt < %s -lowerinvoke -enable-correct-eh-support -disable-output ; PR2029 define i32 @main(i32 %argc, i8** %argv) { bb470: diff --git a/test/Transforms/LowerInvoke/basictest.ll b/test/Transforms/LowerInvoke/basictest.ll index a9c19f2..f0ca5f4 100644 --- a/test/Transforms/LowerInvoke/basictest.ll +++ b/test/Transforms/LowerInvoke/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerinvoke -disable-output -enable-correct-eh-support +; RUN: opt < %s -lowerinvoke -disable-output -enable-correct-eh-support define i32 @foo() { diff --git a/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll b/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll index 3be2163..9180c15 100644 --- a/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll +++ b/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowersetjmp -disable-output +; RUN: opt < %s -lowersetjmp -disable-output %struct.jmpenv = type { i32, i8 } diff --git a/test/Transforms/LowerSetJmp/simpletest.ll b/test/Transforms/LowerSetJmp/simpletest.ll index 9ff5f29..1430dff 100644 --- a/test/Transforms/LowerSetJmp/simpletest.ll +++ b/test/Transforms/LowerSetJmp/simpletest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowersetjmp | llvm-dis | grep invoke +; RUN: opt < %s -lowersetjmp -S | grep invoke %JmpBuf = type i32 @.str_1 = internal constant [13 x i8] c"returned %d\0A\00" ; <[13 x i8]*> [#uses=1] diff --git a/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll b/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll index cb5f090..d143ab0 100644 --- a/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll +++ b/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerswitch +; RUN: opt < %s -lowerswitch define void @child(i32 %ct.1) { entry: diff --git a/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll b/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll index 71e5a4b..61e1dcd 100644 --- a/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll +++ b/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerswitch +; RUN: opt < %s -lowerswitch define void @test() { switch i32 0, label %Next [ diff --git a/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll b/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll index 2fc1c98..964b07e 100644 --- a/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll +++ b/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -lowerswitch -disable-output +; RUN: opt < %s -lowerswitch -disable-output define void @solve() { entry: diff --git a/test/Transforms/LowerSwitch/feature.ll b/test/Transforms/LowerSwitch/feature.ll index 7523ad2..cdfa0f3 100644 --- a/test/Transforms/LowerSwitch/feature.ll +++ b/test/Transforms/LowerSwitch/feature.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis > %t +; RUN: opt < %s -lowerswitch -S > %t ; RUN: grep slt %t | count 10 ; RUN: grep ule %t | count 3 ; RUN: grep eq %t | count 9 diff --git a/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll b/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll index b0d2c79..777f375 100644 --- a/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll +++ b/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll @@ -1,6 +1,6 @@ ; Uninitialized values are not handled correctly. ; -; RUN: llvm-as < %s | opt -mem2reg -disable-output +; RUN: opt < %s -mem2reg -disable-output ; define i32 @test() { diff --git a/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll b/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll index c649d6a..89bd492 100644 --- a/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll +++ b/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll @@ -1,7 +1,7 @@ ; This input caused the mem2reg pass to die because it was trying to promote ; the %r alloca, even though it is invalid to do so in this case! ; -; RUN: llvm-as < %s | opt -mem2reg +; RUN: opt < %s -mem2reg define void @test() { %r = alloca i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll b/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll index 0dd2761..3665483 100644 --- a/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll +++ b/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mem2reg +; RUN: opt < %s -mem2reg define void @_Z3barv() { %result = alloca i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll b/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll index 78bfcb4..36bd9e6 100644 --- a/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll +++ b/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll @@ -1,5 +1,5 @@ ; This testcases makes sure that mem2reg can handle unreachable blocks. -; RUN: llvm-as < %s | opt -mem2reg +; RUN: opt < %s -mem2reg define i32 @test() { %X = alloca i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll b/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll index 04e8db3..f5f1ee3 100644 --- a/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll +++ b/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll @@ -1,7 +1,7 @@ ; Mem2reg used to only add one incoming value to a PHI node, even if it had ; multiple incoming edges from a block. ; -; RUN: llvm-as < %s | opt -mem2reg -disable-output +; RUN: opt < %s -mem2reg -disable-output define i32 @test(i1 %c1, i1 %c2) { %X = alloca i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll b/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll index 27d0015..e82caa9 100644 --- a/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll +++ b/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll @@ -1,5 +1,5 @@ ; Promoting some values allows promotion of other values. -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca +; RUN: opt < %s -mem2reg -S | not grep alloca define i32 @test2() { %result = alloca i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll b/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll index 5a27b20..1d38efc 100644 --- a/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll +++ b/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll @@ -1,7 +1,7 @@ ; Mem2reg should not insert dead PHI nodes! The naive algorithm inserts a PHI ; node in L3, even though there is no load of %A in anything dominated by L3. -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi +; RUN: opt < %s -mem2reg -S | not grep phi define void @test(i32 %B, i1 %C) { %A = alloca i32 ; <i32*> [#uses=4] diff --git a/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll b/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll index b053aa1..7435596 100644 --- a/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll +++ b/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mem2reg -instcombine | llvm-dis | grep store +; RUN: opt < %s -mem2reg -instcombine -S | grep store ; PR590 diff --git a/test/Transforms/Mem2Reg/2005-11-28-Crash.ll b/test/Transforms/Mem2Reg/2005-11-28-Crash.ll index a985db3..8fd3351 100644 --- a/test/Transforms/Mem2Reg/2005-11-28-Crash.ll +++ b/test/Transforms/Mem2Reg/2005-11-28-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mem2reg -disable-output +; RUN: opt < %s -mem2reg -disable-output ; PR670 define void @printk(i32, ...) { diff --git a/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll b/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll index 579ed41..50683cf 100644 --- a/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll +++ b/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | grep volatile | count 3 +; RUN: opt < %s -std-compile-opts -S | grep volatile | count 3 ; PR1520 ; Don't promote volatile loads/stores. This is really needed to handle setjmp/lonjmp properly. diff --git a/test/Transforms/Mem2Reg/PromoteMemToRegister.ll b/test/Transforms/Mem2Reg/PromoteMemToRegister.ll index 63b8c78..1be6b03 100644 --- a/test/Transforms/Mem2Reg/PromoteMemToRegister.ll +++ b/test/Transforms/Mem2Reg/PromoteMemToRegister.ll @@ -1,5 +1,5 @@ ; Simple sanity check testcase. Both alloca's should be eliminated. -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca +; RUN: opt < %s -mem2reg -S | not grep alloca define double @testfunc(i32 %i, double %j) { %I = alloca i32 ; <i32*> [#uses=4] diff --git a/test/Transforms/Mem2Reg/UndefValuesMerge.ll b/test/Transforms/Mem2Reg/UndefValuesMerge.ll index 0d20d7d..5013229 100644 --- a/test/Transforms/Mem2Reg/UndefValuesMerge.ll +++ b/test/Transforms/Mem2Reg/UndefValuesMerge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi +; RUN: opt < %s -mem2reg -S | not grep phi define i32 @testfunc(i1 %C, i32 %i, i8 %j) { %I = alloca i32 ; <i32*> [#uses=2] diff --git a/test/Transforms/Mem2Reg/crash.ll b/test/Transforms/Mem2Reg/crash.ll new file mode 100644 index 0000000..ce795aa --- /dev/null +++ b/test/Transforms/Mem2Reg/crash.ll @@ -0,0 +1,24 @@ +; RUN: opt < %s -mem2reg -S +; PR5023 + +declare i32 @bar() + +define i32 @foo() { +entry: + %whichFlag = alloca i32 + %A = invoke i32 @bar() + to label %invcont2 unwind label %lpad86 + +invcont2: + store i32 %A, i32* %whichFlag + br label %bb15 + +bb15: + %B = load i32* %whichFlag + ret i32 %B + +lpad86: + br label %bb15 + +} + diff --git a/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll b/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll index 30d0a6d..30c2713 100644 --- a/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll +++ b/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -memcpyopt -dse | llvm-dis | grep {call.*initialize} | not grep memtmp +; RUN: opt < %s -memcpyopt -dse -S | grep {call.*initialize} | not grep memtmp ; PR2077 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" diff --git a/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll b/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll index 12c9a9d..13205e6 100644 --- a/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll +++ b/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep {call.*memcpy.} +; RUN: opt < %s -memcpyopt -S | not grep {call.*memcpy.} %a = type { i32 } %b = type { float } diff --git a/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll b/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll index 1d9a35d..4fec169 100644 --- a/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll +++ b/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | grep {call.*memcpy.*agg.result} +; RUN: opt < %s -memcpyopt -S | grep {call.*memcpy.*agg.result} 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" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/MemCpyOpt/align.ll b/test/Transforms/MemCpyOpt/align.ll new file mode 100644 index 0000000..a9d0337 --- /dev/null +++ b/test/Transforms/MemCpyOpt/align.ll @@ -0,0 +1,18 @@ +; RUN: opt < %s -S -memcpyopt | FileCheck %s + +; The resulting memset is only 4-byte aligned, despite containing +; a 16-byte alignmed store in the middle. + +; CHECK: call void @llvm.memset.i64(i8* %a01, i8 0, i64 16, i32 4) + +define void @foo(i32* %p) { + %a0 = getelementptr i32* %p, i64 0 + store i32 0, i32* %a0, align 4 + %a1 = getelementptr i32* %p, i64 1 + store i32 0, i32* %a1, align 16 + %a2 = getelementptr i32* %p, i64 2 + store i32 0, i32* %a2, align 4 + %a3 = getelementptr i32* %p, i64 3 + store i32 0, i32* %a3, align 4 + ret void +} diff --git a/test/Transforms/MemCpyOpt/crash.ll b/test/Transforms/MemCpyOpt/crash.ll new file mode 100644 index 0000000..bf5b234 --- /dev/null +++ b/test/Transforms/MemCpyOpt/crash.ll @@ -0,0 +1,45 @@ +; RUN: opt < %s -memcpyopt -disable-output +; PR4882 + +target datalayout = "e-p:32:32:32-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" +target triple = "armv7-eabi" + +%struct.qw = type { [4 x float] } +%struct.bar = type { %struct.qw, %struct.qw, %struct.qw, %struct.qw, %struct.qw, float, float} + +define arm_aapcs_vfpcc void @test1(%struct.bar* %this) { +entry: + %0 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 0 + store float 0.000000e+00, float* %0, align 4 + %1 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 1 + store float 0.000000e+00, float* %1, align 4 + %2 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 2 + store float 0.000000e+00, float* %2, align 4 + %3 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 3 + store float 0.000000e+00, float* %3, align 4 + %4 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 0 + store float 0.000000e+00, float* %4, align 4 + %5 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 1 + store float 0.000000e+00, float* %5, align 4 + %6 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 2 + store float 0.000000e+00, float* %6, align 4 + %7 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 3 + store float 0.000000e+00, float* %7, align 4 + %8 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 1 + store float 0.000000e+00, float* %8, align 4 + %9 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 2 + store float 0.000000e+00, float* %9, align 4 + %10 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 3 + store float 0.000000e+00, float* %10, align 4 + %11 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 0 + store float 0.000000e+00, float* %11, align 4 + %12 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 1 + store float 0.000000e+00, float* %12, align 4 + %13 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 2 + store float 0.000000e+00, float* %13, align 4 + %14 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 3 + store float 0.000000e+00, float* %14, align 4 + %15 = getelementptr inbounds %struct.bar* %this, i32 0, i32 5 + store float 0.000000e+00, float* %15, align 4 + unreachable +} diff --git a/test/Transforms/MemCpyOpt/form-memset.ll b/test/Transforms/MemCpyOpt/form-memset.ll index ffacb85..eb8dbe3 100644 --- a/test/Transforms/MemCpyOpt/form-memset.ll +++ b/test/Transforms/MemCpyOpt/form-memset.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep store -; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | grep {call.*llvm.memset} +; RUN: opt < %s -memcpyopt -S | not grep store +; RUN: opt < %s -memcpyopt -S | grep {call.*llvm.memset} ; All the stores in this example should be merged into a single memset. diff --git a/test/Transforms/MemCpyOpt/form-memset2.ll b/test/Transforms/MemCpyOpt/form-memset2.ll index 719cd47..c90af9c 100644 --- a/test/Transforms/MemCpyOpt/form-memset2.ll +++ b/test/Transforms/MemCpyOpt/form-memset2.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep store -; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | grep {call.*llvm.memset} | count 3 +; RUN: opt < %s -memcpyopt -S | not grep store +; RUN: opt < %s -memcpyopt -S | grep {call.*llvm.memset} | count 3 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" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/MemCpyOpt/memcpy.ll b/test/Transforms/MemCpyOpt/memcpy.ll index 94daee0..724acfa 100644 --- a/test/Transforms/MemCpyOpt/memcpy.ll +++ b/test/Transforms/MemCpyOpt/memcpy.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -memcpyopt -dse | llvm-dis | grep {call.*memcpy} | count 1 +; RUN: opt < %s -memcpyopt -dse -S | grep {call.*memcpy} | count 1 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" target triple = "i686-apple-darwin9" diff --git a/test/Transforms/MemCpyOpt/memmove.ll b/test/Transforms/MemCpyOpt/memmove.ll new file mode 100644 index 0000000..73bbf0b --- /dev/null +++ b/test/Transforms/MemCpyOpt/memmove.ll @@ -0,0 +1,37 @@ +; RUN: opt < %s -memcpyopt -S | FileCheck %s +; These memmoves should get optimized to memcpys. + +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" +target triple = "x86_64-apple-darwin9.0" + +declare void @llvm.memmove.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind + +define i8* @test1(i8* nocapture %src) nounwind { +entry: +; CHECK: @test1 +; CHECK: call void @llvm.memcpy + + %call3 = malloc [13 x i8] ; <[13 x i8]*> [#uses=1] + %call3.sub = getelementptr inbounds [13 x i8]* %call3, i64 0, i64 0 ; <i8*> [#uses=2] + tail call void @llvm.memmove.i64(i8* %call3.sub, i8* %src, i64 13, i32 1) + ret i8* %call3.sub +} + +define void @test2(i8* %P) nounwind { +entry: +; CHECK: @test2 +; CHECK: call void @llvm.memcpy + %add.ptr = getelementptr i8* %P, i64 16 ; <i8*> [#uses=1] + tail call void @llvm.memmove.i64(i8* %P, i8* %add.ptr, i64 16, i32 1) + ret void +} + +; This cannot be optimize because the src/dst really do overlap. +define void @test3(i8* %P) nounwind { +entry: +; CHECK: @test3 +; CHECK: call void @llvm.memmove + %add.ptr = getelementptr i8* %P, i64 16 ; <i8*> [#uses=1] + tail call void @llvm.memmove.i64(i8* %P, i8* %add.ptr, i64 17, i32 1) + ret void +} diff --git a/test/Transforms/MemCpyOpt/sret.ll b/test/Transforms/MemCpyOpt/sret.ll index ad9fb1b..5002875 100644 --- a/test/Transforms/MemCpyOpt/sret.ll +++ b/test/Transforms/MemCpyOpt/sret.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -memcpyopt | llvm-dis | not grep {call.*memcpy} +; RUN: opt < %s -memcpyopt -S | not grep {call.*memcpy} 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" target triple = "i686-apple-darwin9" diff --git a/test/Transforms/MergeFunc/fold-weak.ll b/test/Transforms/MergeFunc/fold-weak.ll index cea49fb..e124731 100644 --- a/test/Transforms/MergeFunc/fold-weak.ll +++ b/test/Transforms/MergeFunc/fold-weak.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mergefunc | llvm-dis > %t +; RUN: opt < %s -mergefunc -S > %t ; RUN: grep {define weak} %t | count 2 ; RUN: grep {call} %t | count 2 diff --git a/test/Transforms/MergeFunc/phi-speculation1.ll b/test/Transforms/MergeFunc/phi-speculation1.ll index 9ba3081..7b2a2fe 100644 --- a/test/Transforms/MergeFunc/phi-speculation1.ll +++ b/test/Transforms/MergeFunc/phi-speculation1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mergefunc -stats -disable-output |& not grep {functions merged} +; RUN: opt < %s -mergefunc -stats -disable-output |& not grep {functions merged} define i32 @foo1(i32 %x) { entry: diff --git a/test/Transforms/MergeFunc/phi-speculation2.ll b/test/Transforms/MergeFunc/phi-speculation2.ll index d8c6e30..f080191 100644 --- a/test/Transforms/MergeFunc/phi-speculation2.ll +++ b/test/Transforms/MergeFunc/phi-speculation2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mergefunc -stats -disable-output |& grep {functions merged} +; RUN: opt < %s -mergefunc -stats -disable-output |& grep {functions merged} define i32 @foo1(i32 %x) { entry: diff --git a/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll b/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll index 7fc9125..679eafd 100644 --- a/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll +++ b/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | grep invoke +; RUN: opt < %s -prune-eh -S | grep invoke declare void @External() diff --git a/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll b/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll index 8333cd8..a010703 100644 --- a/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll +++ b/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -prune-eh -disable-output +; RUN: opt < %s -prune-eh -disable-output define internal void @callee() { ret void diff --git a/test/Transforms/PruneEH/2008-06-02-Weak.ll b/test/Transforms/PruneEH/2008-06-02-Weak.ll index 133200f..fb97ae8 100644 --- a/test/Transforms/PruneEH/2008-06-02-Weak.ll +++ b/test/Transforms/PruneEH/2008-06-02-Weak.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep nounwind +; RUN: opt < %s -prune-eh -S | not grep nounwind define weak void @f() { entry: diff --git a/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll b/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll index 74434f4..347af8f 100644 --- a/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll +++ b/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -prune-eh -inline -print-callgraph \ +; RUN: opt < %s -prune-eh -inline -print-callgraph \ ; RUN: -disable-output |& \ ; RUN: grep {Calls.*ce3806g__fxio__put__put_int64__4.1339} | count 2 %struct.FRAME.ce3806g = type { %struct.string___XUB, %struct.string___XUB, %struct.string___XUB, %struct.string___XUB } diff --git a/test/Transforms/PruneEH/recursivetest.ll b/test/Transforms/PruneEH/recursivetest.ll index 231c7b3..724c7cf 100644 --- a/test/Transforms/PruneEH/recursivetest.ll +++ b/test/Transforms/PruneEH/recursivetest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep invoke +; RUN: opt < %s -prune-eh -S | not grep invoke define internal i32 @foo() { invoke i32 @foo( ) diff --git a/test/Transforms/PruneEH/simplenoreturntest.ll b/test/Transforms/PruneEH/simplenoreturntest.ll index d2bd50c..6cdd42f 100644 --- a/test/Transforms/PruneEH/simplenoreturntest.ll +++ b/test/Transforms/PruneEH/simplenoreturntest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep {ret i32} +; RUN: opt < %s -prune-eh -S | not grep {ret i32} declare void @noreturn() noreturn; diff --git a/test/Transforms/PruneEH/simpletest.ll b/test/Transforms/PruneEH/simpletest.ll index 678e8d7..77c429d 100644 --- a/test/Transforms/PruneEH/simpletest.ll +++ b/test/Transforms/PruneEH/simpletest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep invoke +; RUN: opt < %s -prune-eh -S | not grep invoke declare void @nounwind() nounwind diff --git a/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll b/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll index 10daa76..75e02e8 100644 --- a/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll +++ b/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -raiseallocs -disable-output +; RUN: opt < %s -raiseallocs -disable-output define void @main() { %tmp.13 = call i32 (...)* @free( i32 32 ) ; <i32> [#uses=1] diff --git a/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll b/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll index 513cf6f..675bb3d 100644 --- a/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll +++ b/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as <%s | opt -raiseallocs -stats -disable-output |& \ +; RUN: opt < %s -raiseallocs -stats -disable-output |& \ ; RUN: not grep {Number of allocations raised} define void @foo() { entry: diff --git a/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll b/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll index 4521581..1cf0729 100644 --- a/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll +++ b/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll @@ -1,6 +1,6 @@ ; This situation can occur due to the funcresolve pass. ; -; RUN: llvm-as < %s | opt -raiseallocs | llvm-dis | not grep call +; RUN: opt < %s -raiseallocs -S | not grep call declare void @free(i8*) diff --git a/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll b/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll index 5465418..5780990 100644 --- a/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll +++ b/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -instcombine -constprop -dce | llvm-dis | not grep add +; RUN: opt < %s -reassociate -instcombine -constprop -dce -S | not grep add define i32 @test(i32 %A) { %X = add i32 %A, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/2002-05-15-MissedTree.ll b/test/Transforms/Reassociate/2002-05-15-MissedTree.ll index 79afb6e..e8bccbd 100644 --- a/test/Transforms/Reassociate/2002-05-15-MissedTree.ll +++ b/test/Transforms/Reassociate/2002-05-15-MissedTree.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -instcombine -constprop -die | llvm-dis | not grep 5 +; RUN: opt < %s -reassociate -instcombine -constprop -die -S | not grep 5 define i32 @test(i32 %A, i32 %B) { %W = add i32 %B, -5 ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll b/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll index de0666e..c18af5e 100644 --- a/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll +++ b/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll @@ -1,6 +1,6 @@ ; With sub reassociation, constant folding can eliminate all of the constants. ; -; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -dce | llvm-dis | not grep add +; RUN: opt < %s -reassociate -constprop -instcombine -dce -S | not grep add define i32 @test(i32 %A, i32 %B) { %W = add i32 5, %B ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll b/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll index 070080a..5848821 100644 --- a/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll +++ b/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll @@ -1,6 +1,6 @@ ; With sub reassociation, constant folding can eliminate the two 12 constants. ; -; RUN: llvm-as < %s | opt -reassociate -constprop -dce | llvm-dis | not grep 12 +; RUN: opt < %s -reassociate -constprop -dce -S | not grep 12 define i32 @test(i32 %A, i32 %B, i32 %C, i32 %D) { %M = add i32 %A, 12 ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll b/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll index c19baea..bbb08f9 100644 --- a/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll +++ b/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll @@ -1,6 +1,6 @@ ; The reassociate pass is not preserving dominance properties correctly ; -; RUN: llvm-as < %s | opt -reassociate +; RUN: opt < %s -reassociate define i32 @compute_dist(i32 %i, i32 %j) { %reg119 = sub i32 %j, %i ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll b/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll index 41cba63..af7a821 100644 --- a/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll +++ b/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -disable-output +; RUN: opt < %s -reassociate -disable-output define i32 @test(i32 %A.1, i32 %B.1, i32 %C.1, i32 %D.1) { %tmp.16 = and i32 %A.1, %B.1 ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/2005-08-24-Crash.ll b/test/Transforms/Reassociate/2005-08-24-Crash.ll index 99c98ef..9864de4 100644 --- a/test/Transforms/Reassociate/2005-08-24-Crash.ll +++ b/test/Transforms/Reassociate/2005-08-24-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -disable-output +; RUN: opt < %s -reassociate -disable-output define void @test(i32 %a, i32 %b, i32 %c, i32 %d) { %tmp.2 = xor i32 %a, %b ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll b/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll index d11a2ea..33e44d4 100644 --- a/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll +++ b/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis |\ +; RUN: opt < %s -reassociate -instcombine -S |\ ; RUN: grep {ret i32 0} define i32 @f(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4) { diff --git a/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll b/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll index 3662e09..384cbc9 100644 --- a/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll +++ b/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -disable-output +; RUN: opt < %s -reassociate -disable-output define void @foo() { %tmp162 = fsub <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>> [#uses=1] diff --git a/test/Transforms/Reassociate/basictest.ll b/test/Transforms/Reassociate/basictest.ll index 09db47b..eca2d63 100644 --- a/test/Transforms/Reassociate/basictest.ll +++ b/test/Transforms/Reassociate/basictest.ll @@ -1,6 +1,6 @@ ; With reassociation, constant folding can eliminate the 12 and -12 constants. ; -; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep add +; RUN: opt < %s -reassociate -constprop -instcombine -die -S | not grep add define i32 @test(i32 %arg) { %tmp1 = sub i32 -12, %arg ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/basictest2.ll b/test/Transforms/Reassociate/basictest2.ll index dbde3af..ba1ff9e 100644 --- a/test/Transforms/Reassociate/basictest2.ll +++ b/test/Transforms/Reassociate/basictest2.ll @@ -1,6 +1,6 @@ ; With reassociation, constant folding can eliminate the +/- 30 constants. ; -; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 30 +; RUN: opt < %s -reassociate -constprop -instcombine -die -S | not grep 30 define i32 @test(i32 %reg109, i32 %reg1111) { %reg115 = add i32 %reg109, -30 ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/basictest3.ll b/test/Transforms/Reassociate/basictest3.ll index a88030d..92285fb 100644 --- a/test/Transforms/Reassociate/basictest3.ll +++ b/test/Transforms/Reassociate/basictest3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -gvn | llvm-dis | grep add | count 6 +; RUN: opt < %s -reassociate -gvn -S | grep add | count 6 ; Each of these functions should turn into two adds each. @e = external global i32 ; <i32*> [#uses=3] diff --git a/test/Transforms/Reassociate/basictest4.ll b/test/Transforms/Reassociate/basictest4.ll index 608becd..88dbdf7 100644 --- a/test/Transforms/Reassociate/basictest4.ll +++ b/test/Transforms/Reassociate/basictest4.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -gvn -instcombine | llvm-dis | not grep add +; RUN: opt < %s -reassociate -gvn -instcombine -S | not grep add @a = weak global i32 0 ; <i32*> [#uses=1] @b = weak global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/Reassociate/inverses.ll b/test/Transforms/Reassociate/inverses.ll index 5b08d0e..fa1a4bd 100644 --- a/test/Transforms/Reassociate/inverses.ll +++ b/test/Transforms/Reassociate/inverses.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -dce | llvm-dis | \ +; RUN: opt < %s -reassociate -dce -S | \ ; RUN: not grep {\\(and\\|sub\\)} define i32 @test1(i32 %a, i32 %b) { diff --git a/test/Transforms/Reassociate/looptest.ll b/test/Transforms/Reassociate/looptest.ll index 3b28c23..91723bc 100644 --- a/test/Transforms/Reassociate/looptest.ll +++ b/test/Transforms/Reassociate/looptest.ll @@ -12,7 +12,7 @@ ; In this case, we want to reassociate the specified expr so that i+j can be ; hoisted out of the inner most loop. ; -; RUN: llvm-as < %s | opt -reassociate | llvm-dis | grep 115 | not grep 117 +; RUN: opt < %s -reassociate -S | grep 115 | not grep 117 ; END. @.LC0 = internal global [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/Reassociate/mul-factor3.ll b/test/Transforms/Reassociate/mul-factor3.ll index e45e431..4d05176 100644 --- a/test/Transforms/Reassociate/mul-factor3.ll +++ b/test/Transforms/Reassociate/mul-factor3.ll @@ -1,7 +1,6 @@ ; This should be one add and two multiplies. -; RUN: llvm-as < %s | \ -; RUN: opt -reassociate -instcombine | llvm-dis > %t +; RUN: opt < %s -reassociate -instcombine -S > %t ; RUN: grep mul %t | count 2 ; RUN: grep add %t | count 1 diff --git a/test/Transforms/Reassociate/mul-neg-add.ll b/test/Transforms/Reassociate/mul-neg-add.ll index 1899be7..dd6ddd9 100644 --- a/test/Transforms/Reassociate/mul-neg-add.ll +++ b/test/Transforms/Reassociate/mul-neg-add.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis |\ +; RUN: opt < %s -reassociate -instcombine -S |\ ; RUN: not grep {sub i32 0} define i32 @test(i32 %X, i32 %Y, i32 %Z) { diff --git a/test/Transforms/Reassociate/mulfactor.ll b/test/Transforms/Reassociate/mulfactor.ll index f80019c..f279727 100644 --- a/test/Transforms/Reassociate/mulfactor.ll +++ b/test/Transforms/Reassociate/mulfactor.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep mul | count 2 +; RUN: opt < %s -reassociate -instcombine -S | grep mul | count 2 ; This should have exactly 2 multiplies when we're done. diff --git a/test/Transforms/Reassociate/mulfactor2.ll b/test/Transforms/Reassociate/mulfactor2.ll index 62a890b..8116554 100644 --- a/test/Transforms/Reassociate/mulfactor2.ll +++ b/test/Transforms/Reassociate/mulfactor2.ll @@ -1,7 +1,6 @@ ; This should turn into one multiply and one add. -; RUN: llvm-as < %s | \ -; RUN: opt -instcombine -reassociate -instcombine | llvm-dis > %t +; RUN: opt < %s -instcombine -reassociate -instcombine -S > %t ; RUN: grep mul %t | count 1 ; RUN: grep add %t | count 1 diff --git a/test/Transforms/Reassociate/negation.ll b/test/Transforms/Reassociate/negation.ll index 6b20418..6a3dfd3 100644 --- a/test/Transforms/Reassociate/negation.ll +++ b/test/Transforms/Reassociate/negation.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | not grep sub +; RUN: opt < %s -reassociate -instcombine -S | not grep sub ; Test that we can turn things like X*-(Y*Z) -> X*-1*Y*Z. diff --git a/test/Transforms/Reassociate/otherops.ll b/test/Transforms/Reassociate/otherops.ll index 3c9b074..d68d008 100644 --- a/test/Transforms/Reassociate/otherops.ll +++ b/test/Transforms/Reassociate/otherops.ll @@ -1,6 +1,6 @@ ; Reassociation should apply to Add, Mul, And, Or, & Xor ; -; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12 +; RUN: opt < %s -reassociate -constprop -instcombine -die -S | not grep 12 define i32 @test_mul(i32 %arg) { %tmp1 = mul i32 12, %arg ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/shift-factor.ll b/test/Transforms/Reassociate/shift-factor.ll index 05437fd..73af5e5 100644 --- a/test/Transforms/Reassociate/shift-factor.ll +++ b/test/Transforms/Reassociate/shift-factor.ll @@ -1,6 +1,5 @@ ; There should be exactly one shift and one add left. -; RUN: llvm-as < %s | \ -; RUN: opt -reassociate -instcombine | llvm-dis > %t +; RUN: opt < %s -reassociate -instcombine -S > %t ; RUN: grep shl %t | count 1 ; RUN: grep add %t | count 1 diff --git a/test/Transforms/Reassociate/shifttest.ll b/test/Transforms/Reassociate/shifttest.ll index fd49e7d..8b2cbc9 100644 --- a/test/Transforms/Reassociate/shifttest.ll +++ b/test/Transforms/Reassociate/shifttest.ll @@ -1,6 +1,6 @@ ; With shl->mul reassociation, we can see that this is (shl A, 9) * A ; -; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis |\ +; RUN: opt < %s -reassociate -instcombine -S |\ ; RUN: grep {shl .*, 9} define i32 @test(i32 %A, i32 %B) { diff --git a/test/Transforms/Reassociate/subtest.ll b/test/Transforms/Reassociate/subtest.ll index 513984e..4c63d12 100644 --- a/test/Transforms/Reassociate/subtest.ll +++ b/test/Transforms/Reassociate/subtest.ll @@ -1,6 +1,6 @@ ; With sub reassociation, constant folding can eliminate the 12 and -12 constants. ; -; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | not grep 12 +; RUN: opt < %s -reassociate -instcombine -S | not grep 12 define i32 @test(i32 %A, i32 %B) { %X = add i32 -12, %A ; <i32> [#uses=1] diff --git a/test/Transforms/Reassociate/subtest2.ll b/test/Transforms/Reassociate/subtest2.ll index c81e9b3..0513c5f 100644 --- a/test/Transforms/Reassociate/subtest2.ll +++ b/test/Transforms/Reassociate/subtest2.ll @@ -1,6 +1,6 @@ ; With sub reassociation, constant folding can eliminate the uses of %a. ; -; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep %a | count 1 +; RUN: opt < %s -reassociate -instcombine -S | grep %a | count 1 ; PR2047 define i32 @test(i32 %a, i32 %b, i32 %c) nounwind { diff --git a/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll b/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll index 13b45f5..bb0cf04 100644 --- a/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll +++ b/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll @@ -5,7 +5,7 @@ ; real benchmark (mst from Olden benchmark, MakeGraph function). When SCCP is ; fixed, this should be eliminated by a single SCCP application. ; -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep loop +; RUN: opt < %s -sccp -S | not grep loop define i32* @test() { bb1: diff --git a/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll b/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll index fd4083d..bb5b51d 100644 --- a/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll +++ b/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep sub +; RUN: opt < %s -sccp -S | not grep sub define void @test3(i32, i32) { add i32 0, 0 ; <i32>:3 [#uses=0] diff --git a/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll b/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll index 61bf5db..f619802 100644 --- a/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll +++ b/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll @@ -1,7 +1,7 @@ ; This test shows a case where SCCP is incorrectly eliminating the PHI node ; because it thinks it has a constant 0 value, when it really doesn't. -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi +; RUN: opt < %s -sccp -S | grep phi define i32 @test(i32 %A, i1 %c) { bb1: diff --git a/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll b/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll index b46d23a..f02a293 100644 --- a/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll +++ b/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll @@ -2,7 +2,7 @@ ; this is in fact NOT the case, so the return should still be alive in the code ; after sccp and CFG simplification have been performed. ; -; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | \ +; RUN: opt < %s -sccp -simplifycfg -S | \ ; RUN: grep ret define void @old_main() { diff --git a/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll b/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll index c5a7c79..6aaf33e 100644 --- a/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll +++ b/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep %X +; RUN: opt < %s -sccp -S | not grep %X @G = external global [40 x i32] ; <[40 x i32]*> [#uses=1] diff --git a/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll b/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll index 03ff4dd..576f5d6 100644 --- a/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll +++ b/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | \ +; RUN: opt < %s -sccp -simplifycfg -S | \ ; RUN: not grep then: define void @cprop_test11(i32* %data.1) { diff --git a/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll b/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll index 020af7d..9876375 100644 --- a/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll +++ b/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll @@ -1,5 +1,5 @@ ; The PHI cannot be eliminated from this testcase, SCCP is mishandling invoke's! -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi +; RUN: opt < %s -sccp -S | grep phi declare void @foo() diff --git a/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll b/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll index cf64677..5d2c78e 100644 --- a/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll +++ b/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp -disable-output +; RUN: opt < %s -sccp -disable-output declare i32 @foo() diff --git a/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll b/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll index 6592e8b..4adfde3 100644 --- a/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll +++ b/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 1} +; RUN: opt < %s -sccp -S | grep {ret i32 1} ; This function definitely returns 1, even if we don't know the direction ; of the branch. diff --git a/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll b/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll index 299b79f..47f9cb4 100644 --- a/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll +++ b/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp -disable-output +; RUN: opt < %s -sccp -disable-output ; END. target datalayout = "E-p:32:32" target triple = "powerpc-apple-darwin8.7.0" diff --git a/test/Transforms/SCCP/2006-12-04-PackedType.ll b/test/Transforms/SCCP/2006-12-04-PackedType.ll index 0e268c2..cee3349 100644 --- a/test/Transforms/SCCP/2006-12-04-PackedType.ll +++ b/test/Transforms/SCCP/2006-12-04-PackedType.ll @@ -1,7 +1,7 @@ ; Test VectorType handling by SCCP. ; SCCP ignores VectorTypes until PR 1034 is fixed ; -; RUN: llvm-as < %s | opt -sccp +; RUN: opt < %s -sccp ; END. target datalayout = "E-p:32:32" diff --git a/test/Transforms/SCCP/2006-12-19-UndefBug.ll b/test/Transforms/SCCP/2006-12-19-UndefBug.ll index 4d68669..ec69ce0 100644 --- a/test/Transforms/SCCP/2006-12-19-UndefBug.ll +++ b/test/Transforms/SCCP/2006-12-19-UndefBug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | \ +; RUN: opt < %s -sccp -S | \ ; RUN: grep {ret i1 false} define i1 @foo() { diff --git a/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll b/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll index c099b88..b84fe6d 100644 --- a/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll +++ b/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -sccp -disable-output -; PR 1431 +; RUN: opt < %s -sccp -disable-output +; PR1431 define void @_ada_bench() { entry: diff --git a/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll b/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll index 18ab5e8..aa613dc 100644 --- a/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll +++ b/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep undef | count 1 +; RUN: opt < %s -sccp -S | grep undef | count 1 ; PR1938 define i32 @main() { diff --git a/test/Transforms/SCCP/2008-03-10-sret.ll b/test/Transforms/SCCP/2008-03-10-sret.ll index 0f1c380..85bcaf4 100644 --- a/test/Transforms/SCCP/2008-03-10-sret.ll +++ b/test/Transforms/SCCP/2008-03-10-sret.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis > %t +; RUN: opt < %s -ipsccp -S > %t ; RUN: grep {ret i32 36} %t ; RUN: grep {%mrv = insertvalue %T undef, i32 18, 0} %t ; RUN: grep {%mrv1 = insertvalue %T %mrv, i32 17, 1} %t diff --git a/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll b/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll index 99f9136..1b26ca9 100644 --- a/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll +++ b/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 %Z} +; RUN: opt < %s -sccp -S | grep {ret i32 %Z} ; rdar://5778210 declare {i32, i32} @bar(i32 %A) diff --git a/test/Transforms/SCCP/2008-05-23-UndefCallFold.ll b/test/Transforms/SCCP/2008-05-23-UndefCallFold.ll index f85a362..cd6cf97 100644 --- a/test/Transforms/SCCP/2008-05-23-UndefCallFold.ll +++ b/test/Transforms/SCCP/2008-05-23-UndefCallFold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep {ret i32 undef} +; RUN: opt < %s -sccp -S | not grep {ret i32 undef} ; PR2358 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" diff --git a/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll b/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll index 20f7c21..d23ee2b 100644 --- a/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll +++ b/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep {ret i32 42} -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep {ret i32 undef} +; RUN: opt < %s -ipsccp -S | grep {ret i32 42} +; RUN: opt < %s -ipsccp -S | grep {ret i32 undef} ; PR3325 define i32 @main() { diff --git a/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll b/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll index 480aca0..7aced66 100644 --- a/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll +++ b/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp -disable-output +; RUN: opt < %s -sccp -disable-output ; PR4277 define i32 @main() nounwind { diff --git a/test/Transforms/SCCP/apint-array.ll b/test/Transforms/SCCP/apint-array.ll index ead3f6a..1e75878 100644 --- a/test/Transforms/SCCP/apint-array.ll +++ b/test/Transforms/SCCP/apint-array.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i101 12} +; RUN: opt < %s -sccp -S | grep {ret i101 12} @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,i101 -123456789000000, i101 0,i101 9123456789000000] diff --git a/test/Transforms/SCCP/apint-basictest.ll b/test/Transforms/SCCP/apint-basictest.ll index 12f8326..c03bfef 100644 --- a/test/Transforms/SCCP/apint-basictest.ll +++ b/test/Transforms/SCCP/apint-basictest.ll @@ -1,7 +1,7 @@ ; This is a basic sanity check for constant propogation. The add instruction ; should be eliminated. -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add +; RUN: opt < %s -sccp -S | not grep add define i128 @test(i1 %B) { br i1 %B, label %BB1, label %BB2 diff --git a/test/Transforms/SCCP/apint-basictest2.ll b/test/Transforms/SCCP/apint-basictest2.ll index 7db4e36..1734827 100644 --- a/test/Transforms/SCCP/apint-basictest2.ll +++ b/test/Transforms/SCCP/apint-basictest2.ll @@ -1,8 +1,8 @@ ; This is a basic sanity check for constant propogation. The add instruction ; and phi instruction should be eliminated. -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep phi -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add +; RUN: opt < %s -sccp -S | not grep phi +; RUN: opt < %s -sccp -S | not grep add define i128 @test(i1 %B) { br i1 %B, label %BB1, label %BB2 diff --git a/test/Transforms/SCCP/apint-basictest3.ll b/test/Transforms/SCCP/apint-basictest3.ll index 6e86764..47671bf 100644 --- a/test/Transforms/SCCP/apint-basictest3.ll +++ b/test/Transforms/SCCP/apint-basictest3.ll @@ -2,8 +2,8 @@ ; arithmatic operations. -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep mul -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep umod +; RUN: opt < %s -sccp -S | not grep mul +; RUN: opt < %s -sccp -S | not grep umod define i128 @test(i1 %B) { br i1 %B, label %BB1, label %BB2 diff --git a/test/Transforms/SCCP/apint-basictest4.ll b/test/Transforms/SCCP/apint-basictest4.ll index a90bd7d..41036ea 100644 --- a/test/Transforms/SCCP/apint-basictest4.ll +++ b/test/Transforms/SCCP/apint-basictest4.ll @@ -2,9 +2,9 @@ ; logic operations. -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep and -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep trunc -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i100 -1} +; RUN: opt < %s -sccp -S | not grep and +; RUN: opt < %s -sccp -S | not grep trunc +; RUN: opt < %s -sccp -S | grep {ret i100 -1} define i100 @test(i133 %A) { %B = and i133 0, %A diff --git a/test/Transforms/SCCP/apint-bigarray.ll b/test/Transforms/SCCP/apint-bigarray.ll index 5cd1107..0dd9ad3 100644 --- a/test/Transforms/SCCP/apint-bigarray.ll +++ b/test/Transforms/SCCP/apint-bigarray.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep %X +; RUN: opt < %s -sccp -S | not grep %X @G = global [1000000 x i10000] zeroinitializer diff --git a/test/Transforms/SCCP/apint-bigint.ll b/test/Transforms/SCCP/apint-bigint.ll index ebb0d07..36a96c3 100644 --- a/test/Transforms/SCCP/apint-bigint.ll +++ b/test/Transforms/SCCP/apint-bigint.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep xor +; RUN: opt < %s -sccp -S | not grep xor define i11129 @test1() { %B = shl i11129 1, 11128 diff --git a/test/Transforms/SCCP/apint-bigint2.ll b/test/Transforms/SCCP/apint-bigint2.ll index e95e9d0..660eaad 100644 --- a/test/Transforms/SCCP/apint-bigint2.ll +++ b/test/Transforms/SCCP/apint-bigint2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep load +; RUN: opt < %s -sccp -S | not grep load @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12, i101 -123456789000000, i101 0,i101 9123456789000000] diff --git a/test/Transforms/SCCP/apint-ipsccp1.ll b/test/Transforms/SCCP/apint-ipsccp1.ll index 59cfa3f..fda40f5 100644 --- a/test/Transforms/SCCP/apint-ipsccp1.ll +++ b/test/Transforms/SCCP/apint-ipsccp1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v {ret i512 undef} | \ +; RUN: opt < %s -ipsccp -S | grep -v {ret i512 undef} | \ ; RUN: grep {ret i8 2} define internal i512 @test(i1 %B) { diff --git a/test/Transforms/SCCP/apint-ipsccp2.ll b/test/Transforms/SCCP/apint-ipsccp2.ll index 65e5ee7..3c02e05 100644 --- a/test/Transforms/SCCP/apint-ipsccp2.ll +++ b/test/Transforms/SCCP/apint-ipsccp2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v {ret i101 0} | \ +; RUN: opt < %s -ipsccp -S | grep -v {ret i101 0} | \ ; RUN: grep -v {ret i101 undef} | not grep ret diff --git a/test/Transforms/SCCP/apint-ipsccp3.ll b/test/Transforms/SCCP/apint-ipsccp3.ll index c07a54f..68987ae 100644 --- a/test/Transforms/SCCP/apint-ipsccp3.ll +++ b/test/Transforms/SCCP/apint-ipsccp3.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep global +; RUN: opt < %s -ipsccp -S | not grep global @G = internal global i66 undef diff --git a/test/Transforms/SCCP/apint-ipsccp4.ll b/test/Transforms/SCCP/apint-ipsccp4.ll index a0656b7..75875ff 100644 --- a/test/Transforms/SCCP/apint-ipsccp4.ll +++ b/test/Transforms/SCCP/apint-ipsccp4.ll @@ -1,8 +1,8 @@ ; This test makes sure that these instructions are properly constant propagated. -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep load -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep add -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep phi +; RUN: opt < %s -ipsccp -S | not grep load +; RUN: opt < %s -ipsccp -S | not grep add +; RUN: opt < %s -ipsccp -S | not grep phi @Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, diff --git a/test/Transforms/SCCP/apint-load.ll b/test/Transforms/SCCP/apint-load.ll index 9650971..56fdb35 100644 --- a/test/Transforms/SCCP/apint-load.ll +++ b/test/Transforms/SCCP/apint-load.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly constant propagated. -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep load -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep fdiv +; RUN: opt < %s -ipsccp -S | not grep load +; RUN: opt < %s -ipsccp -S | not grep fdiv @X = constant i212 42 @Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, diff --git a/test/Transforms/SCCP/apint-phi.ll b/test/Transforms/SCCP/apint-phi.ll index 77f6bc8..50f0d1a 100644 --- a/test/Transforms/SCCP/apint-phi.ll +++ b/test/Transforms/SCCP/apint-phi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep phi +; RUN: opt < %s -sccp -S | not grep phi define i999 @test(i999%A, i1 %c) { bb1: diff --git a/test/Transforms/SCCP/apint-select.ll b/test/Transforms/SCCP/apint-select.ll index c856896..c797519 100644 --- a/test/Transforms/SCCP/apint-select.ll +++ b/test/Transforms/SCCP/apint-select.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep select +; RUN: opt < %s -sccp -S | not grep select @A = constant i32 10 diff --git a/test/Transforms/SCCP/basictest.ll b/test/Transforms/SCCP/basictest.ll index 08640a9..dc0f702 100644 --- a/test/Transforms/SCCP/basictest.ll +++ b/test/Transforms/SCCP/basictest.ll @@ -1,7 +1,7 @@ ; This is a basic sanity check for constant propogation. The add instruction ; should be eliminated. -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add +; RUN: opt < %s -sccp -S | not grep add define i32 @test(i1 %B) { br i1 %B, label %BB1, label %BB2 diff --git a/test/Transforms/SCCP/calltest.ll b/test/Transforms/SCCP/calltest.ll index ee6eb8e..9dec22f 100644 --- a/test/Transforms/SCCP/calltest.ll +++ b/test/Transforms/SCCP/calltest.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp -loop-deletion -simplifycfg | llvm-dis | \ -; RUN: not grep br +; RUN: opt < %s -sccp -loop-deletion -simplifycfg -S | not grep br ; No matter how hard you try, sqrt(1.0) is always 1.0. This allows the ; optimizer to delete this loop. diff --git a/test/Transforms/SCCP/ipsccp-basic.ll b/test/Transforms/SCCP/ipsccp-basic.ll index 1449ea7..7f0772e 100644 --- a/test/Transforms/SCCP/ipsccp-basic.ll +++ b/test/Transforms/SCCP/ipsccp-basic.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | \ +; RUN: opt < %s -ipsccp -S | \ ; RUN: grep -v {ret i32 17} | grep -v {ret i32 undef} | not grep ret define internal i32 @bar(i32 %A) { diff --git a/test/Transforms/SCCP/ipsccp-conditional.ll b/test/Transforms/SCCP/ipsccp-conditional.ll index b98bbf4..07a427e 100644 --- a/test/Transforms/SCCP/ipsccp-conditional.ll +++ b/test/Transforms/SCCP/ipsccp-conditional.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | \ +; RUN: opt < %s -ipsccp -S | \ ; RUN: grep -v {ret i32 0} | grep -v {ret i32 undef} | not grep ret define internal i32 @bar(i32 %A) { diff --git a/test/Transforms/SCCP/ipsccp-gvar.ll b/test/Transforms/SCCP/ipsccp-gvar.ll index 6f2ee1f..ecbd959 100644 --- a/test/Transforms/SCCP/ipsccp-gvar.ll +++ b/test/Transforms/SCCP/ipsccp-gvar.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep global +; RUN: opt < %s -ipsccp -S | not grep global @G = internal global i32 undef ; <i32*> [#uses=5] diff --git a/test/Transforms/SCCP/loadtest.ll b/test/Transforms/SCCP/loadtest.ll index 0cbbdf6..fd82aef 100644 --- a/test/Transforms/SCCP/loadtest.ll +++ b/test/Transforms/SCCP/loadtest.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly constant propagated. ; -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep load +; RUN: opt < %s -sccp -S | not grep load @X = constant i32 42 ; <i32*> [#uses=1] diff --git a/test/Transforms/SCCP/logical-nuke.ll b/test/Transforms/SCCP/logical-nuke.ll index 87454e4..b3d845c 100644 --- a/test/Transforms/SCCP/logical-nuke.ll +++ b/test/Transforms/SCCP/logical-nuke.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 0} +; RUN: opt < %s -sccp -S | grep {ret i32 0} ; Test that SCCP has basic knowledge of when and/or nuke overdefined values. diff --git a/test/Transforms/SCCP/phitest.ll b/test/Transforms/SCCP/phitest.ll index c75de5d..4c5c3dc 100644 --- a/test/Transforms/SCCP/phitest.ll +++ b/test/Transforms/SCCP/phitest.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp -dce -simplifycfg | llvm-dis | \ -; RUN: not grep br +; RUN: opt < %s -sccp -dce -simplifycfg -S | not grep br define i32 @test(i32 %param) { entry: diff --git a/test/Transforms/SCCP/sccptest.ll b/test/Transforms/SCCP/sccptest.ll index 84ba2d4..6f422f0 100644 --- a/test/Transforms/SCCP/sccptest.ll +++ b/test/Transforms/SCCP/sccptest.ll @@ -1,7 +1,7 @@ ; This is the test case taken from appel's book that illustrates a hard case ; that SCCP gets right. BB3 should be completely eliminated. ; -; RUN: llvm-as < %s | opt -sccp -constprop -dce -simplifycfg | \ +; RUN: opt < %s -sccp -constprop -dce -simplifycfg | \ ; RUN: llvm-dis | not grep BB3 define i32 @testfunction(i32 %i0, i32 %j0) { diff --git a/test/Transforms/SCCP/select.ll b/test/Transforms/SCCP/select.ll index 74b20d0..b2f1dd2 100644 --- a/test/Transforms/SCCP/select.ll +++ b/test/Transforms/SCCP/select.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep select +; RUN: opt < %s -sccp -S | not grep select define i32 @test1(i1 %C) { %X = select i1 %C, i32 0, i32 0 ; <i32> [#uses=1] diff --git a/test/Transforms/SRETPromotion/2008-03-11-attributes.ll b/test/Transforms/SRETPromotion/2008-03-11-attributes.ll index 81a1476..55abec5 100644 --- a/test/Transforms/SRETPromotion/2008-03-11-attributes.ll +++ b/test/Transforms/SRETPromotion/2008-03-11-attributes.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sretpromotion -disable-output +; RUN: opt < %s -sretpromotion -disable-output %struct.ObjPoint = type { double, double, double, double, double, double } define void @RotatePoint(%struct.ObjPoint* sret %agg.result, %struct.ObjPoint* byval %a, double %rx, double %ry, double %rz) nounwind { diff --git a/test/Transforms/SRETPromotion/2008-06-04-function-pointer-passing.ll b/test/Transforms/SRETPromotion/2008-06-04-function-pointer-passing.ll index 21701dd..1168b0b 100644 --- a/test/Transforms/SRETPromotion/2008-06-04-function-pointer-passing.ll +++ b/test/Transforms/SRETPromotion/2008-06-04-function-pointer-passing.ll @@ -5,7 +5,7 @@ ; We're mainly testing for opt not to crash, but we'll check to see if the sret ; attribute is still there for good measure. -; RUN: llvm-as < %s | opt -sretpromotion | llvm-dis | grep sret +; RUN: opt < %s -sretpromotion -S | grep sret %struct.S = type <{ i32, i32 }> diff --git a/test/Transforms/SRETPromotion/2008-06-05-non-call-use.ll b/test/Transforms/SRETPromotion/2008-06-05-non-call-use.ll index 10f92ef..26c6a6e 100644 --- a/test/Transforms/SRETPromotion/2008-06-05-non-call-use.ll +++ b/test/Transforms/SRETPromotion/2008-06-05-non-call-use.ll @@ -4,7 +4,7 @@ ; We're mainly testing for opt not to crash, but we'll check to see if the sret ; attribute is still there for good measure. -; RUN: llvm-as < %s | opt -sretpromotion | llvm-dis | grep sret +; RUN: opt < %s -sretpromotion -S | grep sret %struct.S = type <{ i32, i32 }> diff --git a/test/Transforms/SRETPromotion/basictest.ll b/test/Transforms/SRETPromotion/basictest.ll index 4146cce..ff047dc 100644 --- a/test/Transforms/SRETPromotion/basictest.ll +++ b/test/Transforms/SRETPromotion/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -sretpromotion | llvm-dis > %t +; RUN: opt < %s -sretpromotion -S > %t ; RUN: cat %t | grep sret | count 1 ; This function is promotable diff --git a/test/Transforms/SSI/2009-07-09-Invoke.ll b/test/Transforms/SSI/2009-07-09-Invoke.ll new file mode 100644 index 0000000..20a2217 --- /dev/null +++ b/test/Transforms/SSI/2009-07-09-Invoke.ll @@ -0,0 +1,71 @@ +; RUN: opt < %s -ssi-everything -disable-output +; PR4511 + + %"struct.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >" = type { %"struct.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_Vector_impl" } + %"struct.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_Vector_impl" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* } + %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" } + %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" = type { i8* } + %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" } + %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep_base" = type { i32, i32, i32 } + %"struct.std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >" = type { %"struct.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >" } + +declare void @_Unwind_Resume(i8*) + +declare fastcc %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* @_ZSt24__uninitialized_copy_auxIPSsS0_ET0_T_S2_S1_St12__false_type(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*) + +define fastcc void @_ZNSt6vectorISsSaISsEE9push_backERKSs(%"struct.std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >"* nocapture %this, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* nocapture %__x) { +entry: + br i1 undef, label %_ZNSt12_Vector_baseISsSaISsEE11_M_allocateEj.exit.i, label %bb + +bb: ; preds = %entry + ret void + +_ZNSt12_Vector_baseISsSaISsEE11_M_allocateEj.exit.i: ; preds = %entry + %0 = invoke fastcc %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* @_ZSt24__uninitialized_copy_auxIPSsS0_ET0_T_S2_S1_St12__false_type(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* undef, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* undef, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* undef) + to label %invcont14.i unwind label %ppad81.i ; <%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*> [#uses=3] + +invcont14.i: ; preds = %_ZNSt12_Vector_baseISsSaISsEE11_M_allocateEj.exit.i + %1 = icmp eq %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %0, null ; <i1> [#uses=1] + br i1 %1, label %bb19.i, label %bb.i17.i + +bb.i17.i: ; preds = %invcont14.i + %2 = invoke fastcc i8* @_ZNSs4_Rep8_M_cloneERKSaIcEj(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep"* undef, i32 0) + to label %bb2.i25.i unwind label %ppad.i.i.i23.i ; <i8*> [#uses=0] + +ppad.i.i.i23.i: ; preds = %bb.i17.i + invoke void @_Unwind_Resume(i8* undef) + to label %.noexc.i24.i unwind label %lpad.i29.i + +.noexc.i24.i: ; preds = %ppad.i.i.i23.i + unreachable + +bb2.i25.i: ; preds = %bb.i17.i + unreachable + +lpad.i29.i: ; preds = %ppad.i.i.i23.i + invoke void @_Unwind_Resume(i8* undef) + to label %.noexc.i9 unwind label %ppad81.i + +.noexc.i9: ; preds = %lpad.i29.i + unreachable + +bb19.i: ; preds = %invcont14.i + %3 = getelementptr %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %0, i32 1 ; <%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*> [#uses=2] + %4 = invoke fastcc %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* @_ZSt24__uninitialized_copy_auxIPSsS0_ET0_T_S2_S1_St12__false_type(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* undef, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* undef, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %3) + to label %invcont20.i unwind label %ppad81.i ; <%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*> [#uses=0] + +invcont20.i: ; preds = %bb19.i + unreachable + +invcont32.i: ; preds = %ppad81.i + unreachable + +ppad81.i: ; preds = %bb19.i, %lpad.i29.i, %_ZNSt12_Vector_baseISsSaISsEE11_M_allocateEj.exit.i + %__new_finish.0.i = phi %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* [ %0, %lpad.i29.i ], [ undef, %_ZNSt12_Vector_baseISsSaISsEE11_M_allocateEj.exit.i ], [ %3, %bb19.i ] ; <%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"*> [#uses=0] + br i1 undef, label %invcont32.i, label %bb.i.i.i.i + +bb.i.i.i.i: ; preds = %bb.i.i.i.i, %ppad81.i + br label %bb.i.i.i.i +} + +declare fastcc i8* @_ZNSs4_Rep8_M_cloneERKSaIcEj(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Rep"* nocapture, i32) diff --git a/test/Transforms/SSI/2009-08-15-UnreachableBB.ll b/test/Transforms/SSI/2009-08-15-UnreachableBB.ll new file mode 100644 index 0000000..0fe37ec --- /dev/null +++ b/test/Transforms/SSI/2009-08-15-UnreachableBB.ll @@ -0,0 +1,19 @@ +; RUN: opt < %s -ssi-everything -disable-output + +declare fastcc i32 @ras_Empty(i8** nocapture) nounwind readonly + +define i32 @cc_Tautology() nounwind { +entry: + unreachable + +cc_InitData.exit: ; No predecessors! + %0 = call fastcc i32 @ras_Empty(i8** undef) nounwind ; <i32> [#uses=1] + %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] + br i1 %1, label %bb2, label %bb6 + +bb2: ; preds = %cc_InitData.exit + unreachable + +bb6: ; preds = %cc_InitData.exit + ret i32 undef +} diff --git a/test/Transforms/SSI/2009-08-17-CritEdge.ll b/test/Transforms/SSI/2009-08-17-CritEdge.ll new file mode 100644 index 0000000..61bd2dc --- /dev/null +++ b/test/Transforms/SSI/2009-08-17-CritEdge.ll @@ -0,0 +1,15 @@ +; RUN: opt < %s -ssi-everything -disable-output + +define void @test(i32 %x) { +entry: + br label %label1 +label1: + %A = phi i32 [ 0, %entry ], [ %A.1, %label2 ] + %B = icmp slt i32 %A, %x + br i1 %B, label %label2, label %label2 +label2: + %A.1 = add i32 %A, 1 + br label %label1 +label3: ; No predecessors! + ret void +} diff --git a/test/Transforms/SSI/2009-08-19-UnreachableBB2.ll b/test/Transforms/SSI/2009-08-19-UnreachableBB2.ll new file mode 100644 index 0000000..64bed19 --- /dev/null +++ b/test/Transforms/SSI/2009-08-19-UnreachableBB2.ll @@ -0,0 +1,22 @@ +; RUN: opt < %s -ssi-everything -disable-output + +define void @foo() { +entry: + %tmp0 = load i64* undef, align 4 ; <i64> [#uses=3] + br i1 undef, label %end_stmt_playback, label %bb16 + +readJournalHdr.exit: ; No predecessors! + br label %end_stmt_playback + +bb16: ; preds = %bb7 + %tmp1 = icmp slt i64 0, %tmp0 ; <i1> [#uses=1] + br i1 %tmp1, label %bb16, label %bb17 + +bb17: ; preds = %bb16 + store i64 %tmp0, i64* undef, align 4 + br label %end_stmt_playback + +end_stmt_playback: ; preds = %bb17, %readJournalHdr.exit, %bb6, %bb2 + store i64 %tmp0, i64* undef, align 4 + ret void +} diff --git a/test/Transforms/SSI/dg.exp b/test/Transforms/SSI/dg.exp new file mode 100644 index 0000000..f200589 --- /dev/null +++ b/test/Transforms/SSI/dg.exp @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] diff --git a/test/Transforms/SSI/ssiphi.ll b/test/Transforms/SSI/ssiphi.ll new file mode 100644 index 0000000..a42b70c --- /dev/null +++ b/test/Transforms/SSI/ssiphi.ll @@ -0,0 +1,22 @@ +; RUN: opt < %s -ssi-everything -S | FileCheck %s + +declare void @use(i32) +declare i32 @create() + +define i32 @foo() { +entry: + %x = call i32 @create() + %y = icmp slt i32 %x, 10 + br i1 %y, label %T, label %F +T: +; CHECK: SSI_sigma + call void @use(i32 %x) + br label %join +F: +; CHECK: SSI_sigma + call void @use(i32 %x) + br label %join +join: +; CHECK: SSI_phi + ret i32 %x +} diff --git a/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll b/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll index 5a9f3a5..824e249 100644 --- a/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll +++ b/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -instcombine -S | not grep alloca ; Test that an array is not incorrectly deconstructed. diff --git a/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll b/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll index 83a18c1..b147ec9 100644 --- a/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll +++ b/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl +; RUN: opt < %s -scalarrepl define void @main() { %E = alloca { { i32, float, double, i64 }, { i32, float, double, i64 } } ; <{ { i32, float, double, i64 }, { i32, float, double, i64 } }*> [#uses=1] diff --git a/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll b/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll index 4220649..89c0b05 100644 --- a/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll +++ b/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl +; RUN: opt < %s -scalarrepl define i32 @test() { %X = alloca { [4 x i32] } ; <{ [4 x i32] }*> [#uses=1] diff --git a/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll b/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll index dbac15c..eb1c945 100644 --- a/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll +++ b/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll @@ -1,6 +1,6 @@ ; Scalar replacement was incorrectly promoting this alloca!! ; -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: sed {s/;.*//g} | grep {\\\[} define i8* @test() { diff --git a/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll b/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll index c5c059b..24e6a31 100644 --- a/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll +++ b/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {alloca %T} +; RUN: opt < %s -scalarrepl -S | grep {alloca %T} %T = type { [80 x i8], i32, i32 } declare i32 @.callback_1(i8*) diff --git a/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll b/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll index de6e297..ea23c31 100644 --- a/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll +++ b/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -disable-output +; RUN: opt < %s -scalarrepl -disable-output target datalayout = "E-p:32:32" %struct.rtx_def = type { [2 x i8], i32, [1 x %union.rtunion_def] } diff --git a/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll b/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll index bcb8457..03c7452 100644 --- a/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll +++ b/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -disable-output +; RUN: opt < %s -scalarrepl -disable-output target datalayout = "E-p:32:32" diff --git a/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll b/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll index 18493f5..63840f1 100644 --- a/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll +++ b/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -disable-output +; RUN: opt < %s -scalarrepl -disable-output define void @output_toc() { entry: diff --git a/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll b/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll index 0007665..dcd7e53 100644 --- a/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll +++ b/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -disable-output +; RUN: opt < %s -scalarrepl -disable-output ; END. target datalayout = "e-p:32:32" target triple = "i686-apple-darwin8.7.2" diff --git a/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll b/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll index f0253b7..4655d14 100644 --- a/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll +++ b/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -S | not grep alloca define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind { %vsiidx = alloca [2 x <4 x i32>], align 16 ; <[2 x <4 x i32>]*> [#uses=3] diff --git a/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll b/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll index ae870d3..2606203 100644 --- a/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll +++ b/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -disable-output +; RUN: opt < %s -scalarrepl -disable-output ; PR1045 target datalayout = "e-p:32:32" diff --git a/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll b/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll index 769ec19..bd49106 100644 --- a/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll +++ b/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -disable-output +; RUN: opt < %s -scalarrepl -disable-output target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" target triple = "arm-apple-darwin8" diff --git a/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll b/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll index 43b721b..e67b610 100644 --- a/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll +++ b/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {alloca.*client_t} +; RUN: opt < %s -scalarrepl -S | grep {alloca.*client_t} ; PR1446 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll b/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll index dc1198e..f1b8b80 100644 --- a/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll +++ b/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep memcpy +; RUN: opt < %s -scalarrepl -S | grep memcpy ; PR1421 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" diff --git a/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll b/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll index d2d2b24..81b6746 100644 --- a/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll +++ b/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep shr +; RUN: opt < %s -scalarrepl -S | not grep shr %struct.S = type { i16 } diff --git a/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll b/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll index 0675a96..d799bd7 100644 --- a/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll +++ b/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | grep {ret i8 17} +; RUN: opt < %s -scalarrepl -instcombine -S | grep {ret i8 17} ; rdar://5707076 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" target triple = "i386-apple-darwin9.1.0" diff --git a/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll b/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll index 9ec5fa3..7f8ef83 100644 --- a/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll +++ b/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -S | not grep alloca 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" target triple = "i686-apple-darwin8" %struct..0anon = type { <1 x i64> } diff --git a/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll b/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll index 73d92be..3ebafd0 100644 --- a/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll +++ b/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll @@ -3,7 +3,7 @@ ; instruction, which was not possible before aggregrates were first class ; values. This checks of scalarrepl splits up the struct and array properly. -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -S | not grep alloca define i32 @foo() { %target = alloca { i32, i32 } ; <{ i32, i32 }*> [#uses=1] diff --git a/test/Transforms/ScalarRepl/2008-06-22-LargeArray.ll b/test/Transforms/ScalarRepl/2008-06-22-LargeArray.ll index 8fbbb67..b704727 100644 --- a/test/Transforms/ScalarRepl/2008-06-22-LargeArray.ll +++ b/test/Transforms/ScalarRepl/2008-06-22-LargeArray.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {call.*mem} +; RUN: opt < %s -scalarrepl -S | grep {call.*mem} ; PR2369 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" diff --git a/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll b/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll index a2386fd..1df01c1 100644 --- a/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll +++ b/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {s = alloca .struct.x} +; RUN: opt < %s -scalarrepl -S | grep {s = alloca .struct.x} ; PR2423 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" target triple = "i386-apple-darwin8" diff --git a/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll b/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll index 6640383..e89be5a 100644 --- a/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll +++ b/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll @@ -3,7 +3,7 @@ ; this would not work when there was a vector involved in the struct, preventing ; scalarrepl from removing the alloca below. -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis > %t +; RUN: opt < %s -scalarrepl -S > %t ; RUN: cat %t | not grep alloca %struct.two = type <{ < 2 x i8 >, i16 }> diff --git a/test/Transforms/ScalarRepl/2009-01-09-scalarrepl-empty.ll b/test/Transforms/ScalarRepl/2009-01-09-scalarrepl-empty.ll index 9cdf4a0..725a9b6 100644 --- a/test/Transforms/ScalarRepl/2009-01-09-scalarrepl-empty.ll +++ b/test/Transforms/ScalarRepl/2009-01-09-scalarrepl-empty.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis +; RUN: opt < %s -scalarrepl | llvm-dis ; PR3304 %struct.c37304a__vrec = type { i8, %struct.c37304a__vrec___disc___XVN } diff --git a/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll b/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll index af34baa..9c0f203 100644 --- a/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll +++ b/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | grep {ret i32 %x} +; RUN: opt < %s -scalarrepl -instcombine -S | grep {ret i32 %x} 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" target triple = "i386-pc-linux-gnu" diff --git a/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll b/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll index 3bea573..f8ab875 100644 --- a/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll +++ b/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -instcombine -inline -instcombine | llvm-dis | grep {ret i32 42} +; RUN: opt < %s -scalarrepl -instcombine -inline -instcombine -S | grep {ret i32 42} ; PR3489 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-f80:128:128" target triple = "x86_64-apple-darwin10.0" diff --git a/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll b/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll index 4fc491b..d6eb75b 100644 --- a/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll +++ b/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll @@ -1,6 +1,6 @@ ; The store into %p should end up with a known alignment of 1, since the memcpy ; is only known to access it with 1-byte alignment. -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {store i16 1, .*, align 1} +; RUN: opt < %s -scalarrepl -S | grep {store i16 1, .*, align 1} ; PR3720 %struct.st = type { i16 } diff --git a/test/Transforms/ScalarRepl/2009-03-05-Aggre2Scalar-dbg.ll b/test/Transforms/ScalarRepl/2009-03-05-Aggre2Scalar-dbg.ll index 437e732..50e7f9a 100644 --- a/test/Transforms/ScalarRepl/2009-03-05-Aggre2Scalar-dbg.ll +++ b/test/Transforms/ScalarRepl/2009-03-05-Aggre2Scalar-dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -disable-output -stats |& grep "Number of aggregates converted to scalar" +; RUN: opt < %s -scalarrepl -disable-output -stats |& grep "Number of aggregates converted to scalar" 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" target triple = "i386-apple-darwin9.6" type { } ; type %0 diff --git a/test/Transforms/ScalarRepl/2009-03-17-CleanUp.ll b/test/Transforms/ScalarRepl/2009-03-17-CleanUp.ll index facb7c1..9c70aae 100644 --- a/test/Transforms/ScalarRepl/2009-03-17-CleanUp.ll +++ b/test/Transforms/ScalarRepl/2009-03-17-CleanUp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep store | not grep undef +; RUN: opt < %s -scalarrepl -S | grep store | not grep undef ; ModuleID = '<stdin>' 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" diff --git a/test/Transforms/ScalarRepl/2009-04-21-ZeroLengthMemSet.ll b/test/Transforms/ScalarRepl/2009-04-21-ZeroLengthMemSet.ll index 2342f05..c5ebf8e 100644 --- a/test/Transforms/ScalarRepl/2009-04-21-ZeroLengthMemSet.ll +++ b/test/Transforms/ScalarRepl/2009-04-21-ZeroLengthMemSet.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis +; RUN: opt < %s -scalarrepl | llvm-dis ; rdar://6808691 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-f80:128:128" target triple = "x86_64-apple-darwin9.0" diff --git a/test/Transforms/ScalarRepl/2009-05-08-I1Crash.ll b/test/Transforms/ScalarRepl/2009-05-08-I1Crash.ll index 0a604e9..aa3487b 100644 --- a/test/Transforms/ScalarRepl/2009-05-08-I1Crash.ll +++ b/test/Transforms/ScalarRepl/2009-05-08-I1Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis +; RUN: opt < %s -scalarrepl | llvm-dis ; PR4146 %wrapper = type { i1 } diff --git a/test/Transforms/ScalarRepl/2009-06-01-BitcastIntPadding.ll b/test/Transforms/ScalarRepl/2009-06-01-BitcastIntPadding.ll index ffdd679..cecbdd4 100644 --- a/test/Transforms/ScalarRepl/2009-06-01-BitcastIntPadding.ll +++ b/test/Transforms/ScalarRepl/2009-06-01-BitcastIntPadding.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl +; RUN: opt < %s -scalarrepl ; PR4286 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-f80:128:128" diff --git a/test/Transforms/ScalarRepl/2009-08-16-VLA.ll b/test/Transforms/ScalarRepl/2009-08-16-VLA.ll new file mode 100644 index 0000000..d69af11 --- /dev/null +++ b/test/Transforms/ScalarRepl/2009-08-16-VLA.ll @@ -0,0 +1,23 @@ +; RUN: opt < %s -scalarrepl -disable-opt + + %struct.Item = type { [4 x i16], %struct.rule* } + %struct.rule = type { [4 x i16], i32, i32, i32, %struct.nonterminal*, %struct.pattern*, i8 } + %struct.nonterminal = type { i8*, i32, i32, i32, %struct.plankMap*, %struct.rule* } + %struct.plankMap = type { %struct.list*, i32, %struct.stateMap* } + %struct.list = type { i8*, %struct.list* } + %struct.stateMap = type { i8*, %struct.plank*, i32, i16* } + %struct.plank = type { i8*, %struct.list*, i32 } + %struct.pattern = type { %struct.nonterminal*, %struct.operator*, [2 x %struct.nonterminal*] } + %struct.operator = type { i8*, i8, i32, i32, i32, i32, %struct.table* } + %struct.table = type { %struct.operator*, %struct.list*, i16*, [2 x %struct.dimension*], %struct.item_set** } + %struct.dimension = type { i16*, %struct.Index_Map, %struct.mapping*, i32, %struct.plankMap* } + %struct.Index_Map = type { i32, %struct.item_set** } + %struct.item_set = type { i32, i32, %struct.operator*, [2 x %struct.item_set*], %struct.item_set*, i16*, %struct.Item*, %struct.Item* } + %struct.mapping = type { %struct.list**, i32, i32, i32, %struct.item_set** } + +define void @addHP_2_0() { +bb4.i: + %0 = malloc [0 x %struct.Item] ; <[0 x %struct.Item]*> [#uses=1] + %.sub.i.c.i = getelementptr [0 x %struct.Item]* %0, i32 0, i32 0 ; <%struct.Item*> [#uses=0] + unreachable +} diff --git a/test/Transforms/ScalarRepl/AggregatePromote.ll b/test/Transforms/ScalarRepl/AggregatePromote.ll index 104a0f9..16b3273 100644 --- a/test/Transforms/ScalarRepl/AggregatePromote.ll +++ b/test/Transforms/ScalarRepl/AggregatePromote.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: not grep alloca target datalayout = "E-p:32:32" diff --git a/test/Transforms/ScalarRepl/DifferingTypes.ll b/test/Transforms/ScalarRepl/DifferingTypes.ll index c060414..eb56824 100644 --- a/test/Transforms/ScalarRepl/DifferingTypes.ll +++ b/test/Transforms/ScalarRepl/DifferingTypes.ll @@ -1,7 +1,7 @@ ; This is a feature test. Hopefully one day this will be implemented. The ; generated code should perform the appropriate masking operations required ; depending on the endianness of the target... -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: not grep alloca define i32 @testfunc(i32 %i, i8 %j) { diff --git a/test/Transforms/ScalarRepl/arraytest.ll b/test/Transforms/ScalarRepl/arraytest.ll index 911a8e3..2f68af8 100644 --- a/test/Transforms/ScalarRepl/arraytest.ll +++ b/test/Transforms/ScalarRepl/arraytest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -mem2reg -S | not grep alloca define i32 @test() { %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1] diff --git a/test/Transforms/ScalarRepl/badarray.ll b/test/Transforms/ScalarRepl/badarray.ll index c488486..909966f 100644 --- a/test/Transforms/ScalarRepl/badarray.ll +++ b/test/Transforms/ScalarRepl/badarray.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -instcombine -S | not grep alloca ; PR3466 define i32 @test() { diff --git a/test/Transforms/ScalarRepl/basictest.ll b/test/Transforms/ScalarRepl/basictest.ll index 11a1d51..a43243c 100644 --- a/test/Transforms/ScalarRepl/basictest.ll +++ b/test/Transforms/ScalarRepl/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -mem2reg -S | not grep alloca define i32 @test() { %X = alloca { i32, float } ; <{ i32, float }*> [#uses=1] diff --git a/test/Transforms/ScalarRepl/bitfield-sroa.ll b/test/Transforms/ScalarRepl/bitfield-sroa.ll index 34dd120..6b3d414 100644 --- a/test/Transforms/ScalarRepl/bitfield-sroa.ll +++ b/test/Transforms/ScalarRepl/bitfield-sroa.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -S | not grep alloca ; rdar://6532315 %t = type { { i32, i16, i8, i8 } } diff --git a/test/Transforms/ScalarRepl/copy-aggregate.ll b/test/Transforms/ScalarRepl/copy-aggregate.ll index a1ad3f9..26f007b 100644 --- a/test/Transforms/ScalarRepl/copy-aggregate.ll +++ b/test/Transforms/ScalarRepl/copy-aggregate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -S | not grep alloca ; PR3290 ;; Store of integer to whole alloca struct. diff --git a/test/Transforms/ScalarRepl/debuginfo.ll b/test/Transforms/ScalarRepl/debuginfo.ll index 63ecd68..903b1a2 100644 --- a/test/Transforms/ScalarRepl/debuginfo.ll +++ b/test/Transforms/ScalarRepl/debuginfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca +; RUN: opt < %s -scalarrepl -S | not grep alloca %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } diff --git a/test/Transforms/ScalarRepl/load-store-aggregate.ll b/test/Transforms/ScalarRepl/load-store-aggregate.ll index df13db7..9ea3895 100644 --- a/test/Transforms/ScalarRepl/load-store-aggregate.ll +++ b/test/Transforms/ScalarRepl/load-store-aggregate.ll @@ -2,7 +2,7 @@ ; are directly loaded from or stored to (using the first class aggregates ; feature). -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis > %t +; RUN: opt < %s -scalarrepl -S > %t ; RUN: cat %t | not grep alloca %struct.foo = type { i32, i32 } diff --git a/test/Transforms/ScalarRepl/memcpy-from-global.ll b/test/Transforms/ScalarRepl/memcpy-from-global.ll index e62ccc2..38a2ca0 100644 --- a/test/Transforms/ScalarRepl/memcpy-from-global.ll +++ b/test/Transforms/ScalarRepl/memcpy-from-global.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep {call.*memcpy} +; RUN: opt < %s -scalarrepl -S | not grep {call.*memcpy} @C.0.1248 = internal constant [128 x float] [ float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 ], align 32 ; <[128 x float]*> [#uses=1] define float @grad4(i32 %hash, float %x, float %y, float %z, float %w) { diff --git a/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll b/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll index 91d8ea9..0d61e5a 100644 --- a/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll +++ b/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll @@ -1,7 +1,7 @@ ; PR1226 -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: not grep {call void @llvm.memcpy.i32} -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep getelementptr +; RUN: opt < %s -scalarrepl -S | grep getelementptr ; END. target datalayout = "E-p:32:32" diff --git a/test/Transforms/ScalarRepl/memset-aggregate.ll b/test/Transforms/ScalarRepl/memset-aggregate.ll index b7b3352..5aeefcd 100644 --- a/test/Transforms/ScalarRepl/memset-aggregate.ll +++ b/test/Transforms/ScalarRepl/memset-aggregate.ll @@ -1,7 +1,7 @@ ; PR1226 -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {ret i32 16843009} -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca -; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | grep {ret i16 514} +; RUN: opt < %s -scalarrepl -S | grep {ret i32 16843009} +; RUN: opt < %s -scalarrepl -S | not grep alloca +; RUN: opt < %s -scalarrepl -instcombine -S | grep {ret i16 514} 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/ScalarRepl/not-a-vector.ll b/test/Transforms/ScalarRepl/not-a-vector.ll index e2111e7..7eba7c0 100644 --- a/test/Transforms/ScalarRepl/not-a-vector.ll +++ b/test/Transforms/ScalarRepl/not-a-vector.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep {7 x double} -; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | grep {ret double %B} +; RUN: opt < %s -scalarrepl -S | not grep alloca +; RUN: opt < %s -scalarrepl -S | not grep {7 x double} +; RUN: opt < %s -scalarrepl -instcombine -S | grep {ret double %B} define double @test(double %A, double %B) { %ARR = alloca [7 x i64] diff --git a/test/Transforms/ScalarRepl/phinodepromote.ll b/test/Transforms/ScalarRepl/phinodepromote.ll index 4eb8743..9c6e8b9 100644 --- a/test/Transforms/ScalarRepl/phinodepromote.ll +++ b/test/Transforms/ScalarRepl/phinodepromote.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -instcombine -mem2reg | llvm-dis | not grep alloca +; RUN: opt < %s -simplifycfg -instcombine -mem2reg -S | not grep alloca ; ; This tests to see if mem2reg can promote alloca instructions whose addresses ; are used by PHI nodes that are immediately loaded. The LLVM C++ front-end diff --git a/test/Transforms/ScalarRepl/select_promote.ll b/test/Transforms/ScalarRepl/select_promote.ll index 901fa90..d6b2b753 100644 --- a/test/Transforms/ScalarRepl/select_promote.ll +++ b/test/Transforms/ScalarRepl/select_promote.ll @@ -1,7 +1,7 @@ ; Test promotion of loads that use the result of a select instruction. This ; should be simplified by the instcombine pass. -; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep alloca +; RUN: opt < %s -instcombine -mem2reg -S | not grep alloca define i32 @main() { %mem_tmp.0 = alloca i32 ; <i32*> [#uses=3] diff --git a/test/Transforms/ScalarRepl/sroa-fca.ll b/test/Transforms/ScalarRepl/sroa-fca.ll index 1bfdacc..2df3b9b 100644 --- a/test/Transforms/ScalarRepl/sroa-fca.ll +++ b/test/Transforms/ScalarRepl/sroa-fca.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis +; RUN: opt < %s -scalarrepl | llvm-dis ; Make sure that SROA "scalar conversion" can handle first class aggregates. define i64 @test({i32, i32} %A) { diff --git a/test/Transforms/ScalarRepl/sroa_two.ll b/test/Transforms/ScalarRepl/sroa_two.ll index e0ea2bc..d8aa26d 100644 --- a/test/Transforms/ScalarRepl/sroa_two.ll +++ b/test/Transforms/ScalarRepl/sroa_two.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis +; RUN: opt < %s -scalarrepl | llvm-dis define i32 @test(i32 %X) { %Arr = alloca [2 x i32] ; <[2 x i32]*> [#uses=3] diff --git a/test/Transforms/ScalarRepl/union-fp-int.ll b/test/Transforms/ScalarRepl/union-fp-int.ll index 1c3b18b..0e1cd23 100644 --- a/test/Transforms/ScalarRepl/union-fp-int.ll +++ b/test/Transforms/ScalarRepl/union-fp-int.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: not grep alloca -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: grep {bitcast.*float.*i32} define i32 @test(float %X) { diff --git a/test/Transforms/ScalarRepl/union-packed.ll b/test/Transforms/ScalarRepl/union-packed.ll index 10d8a5d..63752c8 100644 --- a/test/Transforms/ScalarRepl/union-packed.ll +++ b/test/Transforms/ScalarRepl/union-packed.ll @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: not grep alloca -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: grep bitcast define <4 x i32> @test(<4 x float> %X) { diff --git a/test/Transforms/ScalarRepl/union-pointer.ll b/test/Transforms/ScalarRepl/union-pointer.ll index 269b4b9..fe702fa 100644 --- a/test/Transforms/ScalarRepl/union-pointer.ll +++ b/test/Transforms/ScalarRepl/union-pointer.ll @@ -1,7 +1,7 @@ ; PR892 -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | \ +; RUN: opt < %s -scalarrepl -S | \ ; RUN: not grep alloca -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {ret i8} +; RUN: opt < %s -scalarrepl -S | grep {ret i8} target datalayout = "e-p:32:32" target triple = "i686-apple-darwin8.7.2" diff --git a/test/Transforms/ScalarRepl/vector_memcpy.ll b/test/Transforms/ScalarRepl/vector_memcpy.ll index 5678578..3af79bc 100644 --- a/test/Transforms/ScalarRepl/vector_memcpy.ll +++ b/test/Transforms/ScalarRepl/vector_memcpy.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis > %t +; RUN: opt < %s -scalarrepl -S > %t ; RUN: grep {ret <16 x float> %A} %t ; RUN: grep {ret <16 x float> zeroinitializer} %t diff --git a/test/Transforms/ScalarRepl/vector_promote.ll b/test/Transforms/ScalarRepl/vector_promote.ll index 4b6555b..0284b3d 100644 --- a/test/Transforms/ScalarRepl/vector_promote.ll +++ b/test/Transforms/ScalarRepl/vector_promote.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {load <4 x float>} +; RUN: opt < %s -scalarrepl -S | not grep alloca +; RUN: opt < %s -scalarrepl -S | grep {load <4 x float>} define void @test(<4 x float>* %F, float %f) { entry: diff --git a/test/Transforms/ScalarRepl/volatile.ll b/test/Transforms/ScalarRepl/volatile.ll index 5f9fe0d..3ff322e 100644 --- a/test/Transforms/ScalarRepl/volatile.ll +++ b/test/Transforms/ScalarRepl/volatile.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {volatile load} -; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {volatile store} +; RUN: opt < %s -scalarrepl -S | grep {volatile load} +; RUN: opt < %s -scalarrepl -S | grep {volatile store} define i32 @voltest(i32 %T) { %A = alloca {i32, i32} diff --git a/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll b/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll index 5682ff4..414235b 100644 --- a/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll +++ b/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll @@ -1,6 +1,6 @@ ; Basic block #2 should not be merged into BB #3! ; -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: grep {br label} ; diff --git a/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll b/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll index c955d66..055386b 100644 --- a/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll +++ b/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll @@ -4,7 +4,7 @@ ; ; Which is not valid SSA ; -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis +; RUN: opt < %s -simplifycfg | llvm-dis define void @test() { ; <label>:0 diff --git a/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll b/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll index 87b4286..88f32bc 100644 --- a/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll +++ b/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll @@ -1,7 +1,7 @@ ; -simplifycfg is not folding blocks if there is a PHI node involved. This ; should be fixed eventually -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br define i32 @main(i32 %argc) { ; <label>:0 diff --git a/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll b/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll index 75beb34..9a12062 100644 --- a/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll +++ b/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg +; RUN: opt < %s -simplifycfg define i32 @test(i32 %A, i32 %B, i1 %cond) { J: diff --git a/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll b/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll index c45a5c9..8762046 100644 --- a/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll +++ b/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output define void @test(i32* %ldo, i1 %c, i1 %d) { bb9: diff --git a/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll index 74e74284..c019931 100644 --- a/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll +++ b/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll @@ -1,6 +1,6 @@ ; Do not remove the invoke! ; -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output define i32 @test() { %A = invoke i32 @test( ) diff --git a/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll b/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll index 9f56e07..15cd773 100644 --- a/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll +++ b/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll @@ -1,6 +1,6 @@ ; Do not remove the invoke! ; -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep invoke +; RUN: opt < %s -simplifycfg -S | grep invoke define i32 @test() { invoke i32 @test( ) diff --git a/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll b/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll index ea74692..8ac9ae4 100644 --- a/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll +++ b/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll @@ -1,7 +1,7 @@ ; This test checks to make sure that 'br X, Dest, Dest' is folded into ; 'br Dest' -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep {br i1 %c2} declare void @noop() diff --git a/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll b/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll index a307573..888e187 100644 --- a/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll +++ b/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll @@ -3,7 +3,7 @@ ; due to the fact that the SimplifyCFG function does not use ; the ConstantFoldTerminator function. -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep {br i1 %c2} declare void @noop() diff --git a/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll b/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll index c9f5090..577d650 100644 --- a/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll +++ b/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep switch diff --git a/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll b/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll index cd22e1e..93f851c 100644 --- a/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll +++ b/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep switch ; Test normal folding diff --git a/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll b/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll index de0d262..fafe73b 100644 --- a/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll +++ b/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output define void @symhash_add() { entry: diff --git a/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll b/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll index 7fea292..90be680 100644 --- a/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll +++ b/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; PR584 @g_38098584 = external global i32 ; <i32*> [#uses=1] @g_60187400 = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll b/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll index 8314321..c30bfa1 100644 --- a/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll +++ b/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; END. define void @main() { diff --git a/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll b/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll index 51490a0..477c9c9 100644 --- a/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll +++ b/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; END. %arraytype.1.Char = type { i32, [0 x i8] } diff --git a/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll b/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll index a0fe781..778aa3b 100644 --- a/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll +++ b/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output define i1 @foo() { %X = invoke i1 @foo( ) diff --git a/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll b/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll index 27413fc..760aa13 100644 --- a/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll +++ b/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll @@ -1,6 +1,6 @@ ; Make sure this doesn't turn into an infinite loop -; RUN: llvm-as < %s | opt -simplifycfg -constprop -simplifycfg |\ +; RUN: opt < %s -simplifycfg -constprop -simplifycfg |\ ; RUN: llvm-dis | grep bb86 ; END. diff --git a/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll b/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll index 4400624..32f49e6 100644 --- a/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll +++ b/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output define void @polnel_() { entry: diff --git a/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll b/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll index 4981cf3..21cfb26 100644 --- a/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll +++ b/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; END. define void @main(i32 %c) { diff --git a/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll b/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll index e410c35..2c84c93 100644 --- a/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll +++ b/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -simplifycfg \ +; RUN: opt < %s -gvn -simplifycfg \ ; RUN: -disable-output ; PR867 ; END. diff --git a/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll b/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll index 0d056ee..009d1c8 100644 --- a/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll +++ b/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll @@ -1,5 +1,5 @@ ; PR957 -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep select @G = extern_weak global i32 diff --git a/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll index 6bfef02..dba41c9 100644 --- a/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll +++ b/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; END. %struct..4._102 = type { %struct.QVectorData* } %struct..5._125 = type { %struct.QMapData* } diff --git a/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll b/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll index d433f04..af865ce 100644 --- a/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll +++ b/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis +; RUN: opt < %s -simplifycfg | llvm-dis ; END. ; ModuleID = '2006-12-08-Ptr-ICmp-Branch.ll' diff --git a/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll b/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll index 449047b..a20c46e 100644 --- a/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll +++ b/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep invoke +; RUN: opt < %s -simplifycfg -S | not grep invoke declare i32 @func(i8*) nounwind diff --git a/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll b/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll index fe1ca80..46df0f0 100644 --- a/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll +++ b/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll @@ -1,4 +1,4 @@ -;RUN: llvm-as < %s | opt -simplifycfg -disable-output +;RUN: opt < %s -simplifycfg -disable-output 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" define i32 @bork() nounwind { diff --git a/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll b/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll index 4c9c9e8..00f2d5b 100644 --- a/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll +++ b/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll @@ -1,5 +1,5 @@ ; The phi should not be eliminated in this case, because the fp op could trap. -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {= phi double} +; RUN: opt < %s -simplifycfg -S | grep {= phi double} 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" target triple = "i686-apple-darwin8" diff --git a/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll b/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll index 5ee1352..8e05a3c 100644 --- a/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll +++ b/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; rdar://5882392 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" target triple = "x86_64-apple-darwin9" diff --git a/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll b/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll index be3410c..ba33d84 100644 --- a/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll +++ b/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; PR2256 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" target triple = "x86_64-mingw32" diff --git a/test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll b/test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll index 8af2640..59e886b 100644 --- a/test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll +++ b/test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis > %t +; RUN: opt < %s -simplifycfg -S > %t ; RUN: not grep {^BB.tomerge} %t ; RUN grep {^BB.nomerge} %t | count 2 diff --git a/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll b/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll index 0678e20..d025dee 100644 --- a/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll +++ b/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {%outval = phi i32 .*mux} +; RUN: opt < %s -simplifycfg -S | grep {%outval = phi i32 .*mux} ; PR2540 ; Outval should end up with a select from 0/2, not all constants. diff --git a/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll b/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll index 82a2cc0..ac9622d 100644 --- a/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll +++ b/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; PR 2777 @g_103 = common global i32 0 ; <i32*> [#uses=1] diff --git a/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll b/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll index b2d671d..f864184 100644 --- a/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll +++ b/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; PR 2800 define void @foo() { diff --git a/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll b/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll index a061a82..bb137c1 100644 --- a/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll +++ b/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg +; RUN: opt < %s -simplifycfg ; PR2855 define i32 @_Z1fPii(i32* %b, i32 %f) nounwind { diff --git a/test/Transforms/SimplifyCFG/2008-12-06-SingleEntryPhi.ll b/test/Transforms/SimplifyCFG/2008-12-06-SingleEntryPhi.ll index 7b4aee4..d3c7c32 100644 --- a/test/Transforms/SimplifyCFG/2008-12-06-SingleEntryPhi.ll +++ b/test/Transforms/SimplifyCFG/2008-12-06-SingleEntryPhi.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis +; RUN: opt < %s -simplifycfg | llvm-dis define i32 @test() { entry: br label %T diff --git a/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll b/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll index b52d10d..7271024 100644 --- a/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll +++ b/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep icmp +; RUN: opt < %s -simplifycfg -S | not grep icmp ; ModuleID = '/tmp/x.bc' 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/SimplifyCFG/2009-01-18-PHIPropCrash.ll b/test/Transforms/SimplifyCFG/2009-01-18-PHIPropCrash.ll index fc34f51..7b8a918 100644 --- a/test/Transforms/SimplifyCFG/2009-01-18-PHIPropCrash.ll +++ b/test/Transforms/SimplifyCFG/2009-01-18-PHIPropCrash.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis -; XFAIL: * +; RUN: opt < %s -simplifycfg | llvm-dis ; PR3016 ; Dead use caused invariant violation. diff --git a/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll b/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll index e65bafa..33167bd 100644 --- a/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll +++ b/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {br i1 } | count 4 +; RUN: opt < %s -simplifycfg -S | grep {br i1 } | count 4 ; PR3354 ; Do not merge bb1 into the entry block, it might trap. diff --git a/test/Transforms/SimplifyCFG/2009-03-05-Speculative-Hoist-Dbg.ll b/test/Transforms/SimplifyCFG/2009-03-05-Speculative-Hoist-Dbg.ll index 9033976..9caa9a1 100644 --- a/test/Transforms/SimplifyCFG/2009-03-05-Speculative-Hoist-Dbg.ll +++ b/test/Transforms/SimplifyCFG/2009-03-05-Speculative-Hoist-Dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep select +; RUN: opt < %s -simplifycfg -S | grep select %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } diff --git a/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll b/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll index dc0cbbe..419feb6 100644 --- a/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll +++ b/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep select +; RUN: opt < %s -simplifycfg -S | not grep select ; ModuleID = '<stdin>' 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" target triple = "i386-apple-darwin10.0" diff --git a/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll index d0e7ed7..72a15b1 100644 --- a/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll +++ b/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output ; END. %struct..4._102 = type { %struct.QVectorData* } %struct..5._125 = type { %struct.QMapData* } diff --git a/test/Transforms/SimplifyCFG/BrUnwind.ll b/test/Transforms/SimplifyCFG/BrUnwind.ll index 1acdecd..b19a27d 100644 --- a/test/Transforms/SimplifyCFG/BrUnwind.ll +++ b/test/Transforms/SimplifyCFG/BrUnwind.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep {br label} define void @test(i1 %C) { diff --git a/test/Transforms/SimplifyCFG/DeadSetCC.ll b/test/Transforms/SimplifyCFG/DeadSetCC.ll index a4c8366..8339462 100644 --- a/test/Transforms/SimplifyCFG/DeadSetCC.ll +++ b/test/Transforms/SimplifyCFG/DeadSetCC.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep {icmp eq} ; Check that simplifycfg deletes a dead 'seteq' instruction when it diff --git a/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll b/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll index 55db788..912c755 100644 --- a/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll +++ b/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll @@ -1,6 +1,6 @@ ; Test merging of blocks with phi nodes. ; -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N: +; RUN: opt < %s -simplifycfg -S | not grep N: ; define i32 @test(i1 %a) { diff --git a/test/Transforms/SimplifyCFG/HoistCode.ll b/test/Transforms/SimplifyCFG/HoistCode.ll index d8894a6f..9697e56 100644 --- a/test/Transforms/SimplifyCFG/HoistCode.ll +++ b/test/Transforms/SimplifyCFG/HoistCode.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br define void @foo(i1 %C, i32* %P) { br i1 %C, label %T, label %F diff --git a/test/Transforms/SimplifyCFG/PhiBlockMerge.ll b/test/Transforms/SimplifyCFG/PhiBlockMerge.ll index f3844f7..a648efd 100644 --- a/test/Transforms/SimplifyCFG/PhiBlockMerge.ll +++ b/test/Transforms/SimplifyCFG/PhiBlockMerge.ll @@ -1,6 +1,6 @@ ; Test merging of blocks that only have PHI nodes in them ; -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N: +; RUN: opt < %s -simplifycfg -S | not grep N: ; define i32 @test(i1 %a, i1 %b) { diff --git a/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll b/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll index 24b3d11..fb5d600 100644 --- a/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll +++ b/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll @@ -2,7 +2,7 @@ ; where the mergedinto block doesn't have any PHI nodes, and is in fact ; dominated by the block-to-be-eliminated ; -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N: +; RUN: opt < %s -simplifycfg -S | not grep N: ; declare i1 @foo() diff --git a/test/Transforms/SimplifyCFG/PhiEliminate.ll b/test/Transforms/SimplifyCFG/PhiEliminate.ll index 94697c9..73cf466 100644 --- a/test/Transforms/SimplifyCFG/PhiEliminate.ll +++ b/test/Transforms/SimplifyCFG/PhiEliminate.ll @@ -3,7 +3,7 @@ ; nodes away allows the branches to be eliminated, performing a simple form of ; 'if conversion'. -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis > %t.xform +; RUN: opt < %s -simplifycfg -S > %t.xform ; RUN: not grep phi %t.xform ; RUN: grep ret %t.xform diff --git a/test/Transforms/SimplifyCFG/PhiEliminate2.ll b/test/Transforms/SimplifyCFG/PhiEliminate2.ll index ec1b91a..c0f6781 100644 --- a/test/Transforms/SimplifyCFG/PhiEliminate2.ll +++ b/test/Transforms/SimplifyCFG/PhiEliminate2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br define i32 @test(i1 %C, i32 %V1, i32 %V2) { entry: diff --git a/test/Transforms/SimplifyCFG/PhiNoEliminate.ll b/test/Transforms/SimplifyCFG/PhiNoEliminate.ll index dfe122a..e9902e0 100644 --- a/test/Transforms/SimplifyCFG/PhiNoEliminate.ll +++ b/test/Transforms/SimplifyCFG/PhiNoEliminate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep select ;; The PHI node in this example should not be turned into a select, as we are diff --git a/test/Transforms/SimplifyCFG/SpeculativeExec.ll b/test/Transforms/SimplifyCFG/SpeculativeExec.ll index 2be9124..5cfc77c 100644 --- a/test/Transforms/SimplifyCFG/SpeculativeExec.ll +++ b/test/Transforms/SimplifyCFG/SpeculativeExec.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep select -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep br | count 2 +; RUN: opt < %s -simplifycfg -S | grep select +; RUN: opt < %s -simplifycfg -S | grep br | count 2 define i32 @t2(i32 %a, i32 %b, i32 %c) nounwind { entry: diff --git a/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll b/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll index e6c05f3..bf9d953 100644 --- a/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll +++ b/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll @@ -2,7 +2,7 @@ ; a PHI node and a return. Make sure the simplify cfg can straighten out this ; important case. This is basically the most trivial form of tail-duplication. -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep {br label} define i32 @test(i1 %B, i32 %A, i32 %B.upgrd.1) { diff --git a/test/Transforms/SimplifyCFG/UnreachableEliminate.ll b/test/Transforms/SimplifyCFG/UnreachableEliminate.ll index 3c44919..7133d98 100644 --- a/test/Transforms/SimplifyCFG/UnreachableEliminate.ll +++ b/test/Transforms/SimplifyCFG/UnreachableEliminate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep unreachable +; RUN: opt < %s -simplifycfg -S | not grep unreachable define void @test1(i1 %C, i1* %BP) { br i1 %C, label %T, label %F diff --git a/test/Transforms/SimplifyCFG/basictest.ll b/test/Transforms/SimplifyCFG/basictest.ll index 1fd629a..468b6ed 100644 --- a/test/Transforms/SimplifyCFG/basictest.ll +++ b/test/Transforms/SimplifyCFG/basictest.ll @@ -1,6 +1,6 @@ ; Test CFG simplify removal of branch instructions... ; -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br define void @test1() { br label %BB1 diff --git a/test/Transforms/SimplifyCFG/branch-branch-dbginfo.ll b/test/Transforms/SimplifyCFG/branch-branch-dbginfo.ll index b2f53a3..761f0d5 100644 --- a/test/Transforms/SimplifyCFG/branch-branch-dbginfo.ll +++ b/test/Transforms/SimplifyCFG/branch-branch-dbginfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {br i1} | count 1 +; RUN: opt < %s -simplifycfg -S | grep {br i1} | count 1 ; ModuleID = '<stdin>' 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" diff --git a/test/Transforms/SimplifyCFG/branch-cond-merge.ll b/test/Transforms/SimplifyCFG/branch-cond-merge.ll index ae46503..f73e01c 100644 --- a/test/Transforms/SimplifyCFG/branch-cond-merge.ll +++ b/test/Transforms/SimplifyCFG/branch-cond-merge.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -simplifycfg -instcombine \ -; RUN: -simplifycfg | llvm-dis | not grep call +; RUN: opt < %s -simplifycfg -instcombine \ +; RUN: -simplifycfg -S | not grep call declare void @bar() diff --git a/test/Transforms/SimplifyCFG/branch-cond-prop.ll b/test/Transforms/SimplifyCFG/branch-cond-prop.ll index a7cd359..448934e 100644 --- a/test/Transforms/SimplifyCFG/branch-cond-prop.ll +++ b/test/Transforms/SimplifyCFG/branch-cond-prop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep call +; RUN: opt < %s -simplifycfg -S | not grep call declare void @bar() diff --git a/test/Transforms/SimplifyCFG/branch-fold-test.ll b/test/Transforms/SimplifyCFG/branch-fold-test.ll index 444741f..460f245 100644 --- a/test/Transforms/SimplifyCFG/branch-fold-test.ll +++ b/test/Transforms/SimplifyCFG/branch-fold-test.ll @@ -1,7 +1,7 @@ ; This test ensures that the simplifycfg pass continues to constant fold ; terminator instructions. -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br define i32 @test(i32 %A, i32 %B) { J: diff --git a/test/Transforms/SimplifyCFG/branch-fold.ll b/test/Transforms/SimplifyCFG/branch-fold.ll index d671b6e..266609b5 100644 --- a/test/Transforms/SimplifyCFG/branch-fold.ll +++ b/test/Transforms/SimplifyCFG/branch-fold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {br i1} | count 1 +; RUN: opt < %s -simplifycfg -S | grep {br i1} | count 1 define void @test(i32* %P, i32* %Q, i1 %A, i1 %B) { br i1 %A, label %a, label %b diff --git a/test/Transforms/SimplifyCFG/branch-phi-thread.ll b/test/Transforms/SimplifyCFG/branch-phi-thread.ll index c536b6c..f52d979 100644 --- a/test/Transforms/SimplifyCFG/branch-phi-thread.ll +++ b/test/Transforms/SimplifyCFG/branch-phi-thread.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -adce | llvm-dis | \ +; RUN: opt < %s -simplifycfg -adce -S | \ ; RUN: not grep {call void @f1} ; END. diff --git a/test/Transforms/SimplifyCFG/branch_fold_dbg.ll b/test/Transforms/SimplifyCFG/branch_fold_dbg.ll index d1d00b3..c91a87ef 100644 --- a/test/Transforms/SimplifyCFG/branch_fold_dbg.ll +++ b/test/Transforms/SimplifyCFG/branch_fold_dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br ; END. %llvm.dbg.anchor.type = type { i32, i32 } diff --git a/test/Transforms/SimplifyCFG/dbginfo.ll b/test/Transforms/SimplifyCFG/dbginfo.ll index 38ecbb8..1a9f20a 100644 --- a/test/Transforms/SimplifyCFG/dbginfo.ll +++ b/test/Transforms/SimplifyCFG/dbginfo.ll @@ -1,6 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep region | count 2 -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep func.start | count 2 -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep "br label" +; RUN: opt < %s -simplifycfg -S | not grep "br label" %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } diff --git a/test/Transforms/SimplifyCFG/hoist-common-code.dbg.ll b/test/Transforms/SimplifyCFG/hoist-common-code.dbg.ll index ad5cd93..2e7ef7a 100644 --- a/test/Transforms/SimplifyCFG/hoist-common-code.dbg.ll +++ b/test/Transforms/SimplifyCFG/hoist-common-code.dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br %llvm.dbg.anchor.type = type { i32, i32 } diff --git a/test/Transforms/SimplifyCFG/hoist-common-code.ll b/test/Transforms/SimplifyCFG/hoist-common-code.ll index 7512da2..5c83e2a 100644 --- a/test/Transforms/SimplifyCFG/hoist-common-code.ll +++ b/test/Transforms/SimplifyCFG/hoist-common-code.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br declare void @bar(i32) diff --git a/test/Transforms/SimplifyCFG/invoke_unwind.ll b/test/Transforms/SimplifyCFG/invoke_unwind.ll new file mode 100644 index 0000000..bbd779b --- /dev/null +++ b/test/Transforms/SimplifyCFG/invoke_unwind.ll @@ -0,0 +1,33 @@ +; RUN: opt < %s -simplifycfg -S | FileCheck %s + +declare void @bar() + +; This testcase checks to see if the simplifycfg pass is converting invoke +; instructions to call instructions if the handler just rethrows the exception. +define i32 @test1() { +; CHECK: @test1 +; CHECK-NEXT: call void @bar() +; CHECK-NEXT: ret i32 0 + invoke void @bar( ) + to label %Ok unwind label %Rethrow +Ok: ; preds = %0 + ret i32 0 +Rethrow: ; preds = %0 + unwind +} + + +; Verify that simplifycfg isn't duplicating 'unwind' instructions. Doing this +; is bad because it discourages commoning. +define i32 @test2(i1 %c) { +; CHECK: @test2 +; CHECK: T: +; CHECK-NEXT: call void @bar() +; CHECK-NEXT: br label %F + br i1 %c, label %T, label %F +T: + call void @bar() + br label %F +F: + unwind +} diff --git a/test/Transforms/SimplifyCFG/iterative-simplify.ll b/test/Transforms/SimplifyCFG/iterative-simplify.ll index 9081b01..a397411 100644 --- a/test/Transforms/SimplifyCFG/iterative-simplify.ll +++ b/test/Transforms/SimplifyCFG/iterative-simplify.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep bb17 +; RUN: opt < %s -simplifycfg -S | not grep bb17 ; PR1786 define i32 @main() { diff --git a/test/Transforms/SimplifyCFG/noreturn-call.ll b/test/Transforms/SimplifyCFG/noreturn-call.ll index 0e1c632..b454778 100644 --- a/test/Transforms/SimplifyCFG/noreturn-call.ll +++ b/test/Transforms/SimplifyCFG/noreturn-call.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep unreachable +; RUN: opt < %s -simplifycfg -S | grep unreachable ; PR1796 declare void @Finisher(i32) noreturn diff --git a/test/Transforms/SimplifyCFG/return-merge.ll b/test/Transforms/SimplifyCFG/return-merge.ll index 60267e9..977b6df 100644 --- a/test/Transforms/SimplifyCFG/return-merge.ll +++ b/test/Transforms/SimplifyCFG/return-merge.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br define i32 @test1(i1 %C) { entry: diff --git a/test/Transforms/SimplifyCFG/switch-simplify-crash.ll b/test/Transforms/SimplifyCFG/switch-simplify-crash.ll index 74559a0..bbc0bd7 100644 --- a/test/Transforms/SimplifyCFG/switch-simplify-crash.ll +++ b/test/Transforms/SimplifyCFG/switch-simplify-crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; RUN: opt < %s -simplifycfg -disable-output define void @NewExtractNames() { entry: diff --git a/test/Transforms/SimplifyCFG/switch_create.ll b/test/Transforms/SimplifyCFG/switch_create.ll index 4994cd3..9b3aaf7 100644 --- a/test/Transforms/SimplifyCFG/switch_create.ll +++ b/test/Transforms/SimplifyCFG/switch_create.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br declare void @foo1() diff --git a/test/Transforms/SimplifyCFG/switch_formation.dbg.ll b/test/Transforms/SimplifyCFG/switch_formation.dbg.ll index 0ce01f1..f5f4c93 100644 --- a/test/Transforms/SimplifyCFG/switch_formation.dbg.ll +++ b/test/Transforms/SimplifyCFG/switch_formation.dbg.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br -; END. +; RUN: opt < %s -simplifycfg -S | not grep br %llvm.dbg.anchor.type = type { i32, i32 } diff --git a/test/Transforms/SimplifyCFG/switch_formation.ll b/test/Transforms/SimplifyCFG/switch_formation.ll index 534c471..787904a 100644 --- a/test/Transforms/SimplifyCFG/switch_formation.ll +++ b/test/Transforms/SimplifyCFG/switch_formation.ll @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br -; END. +; RUN: opt < %s -simplifycfg -S | not grep br define i1 @_ZN4llvm11SetCondInst7classofEPKNS_11InstructionE({ i32, i32 }* %I) { entry: diff --git a/test/Transforms/SimplifyCFG/switch_switch_fold.ll b/test/Transforms/SimplifyCFG/switch_switch_fold.ll index 1590f34..2e2e310 100644 --- a/test/Transforms/SimplifyCFG/switch_switch_fold.ll +++ b/test/Transforms/SimplifyCFG/switch_switch_fold.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: grep switch | count 1 ; Test that a switch going to a switch on the same value can be merged. All diff --git a/test/Transforms/SimplifyCFG/switch_switch_fold_dbginfo.ll b/test/Transforms/SimplifyCFG/switch_switch_fold_dbginfo.ll index 3654b28..7d7391a 100644 --- a/test/Transforms/SimplifyCFG/switch_switch_fold_dbginfo.ll +++ b/test/Transforms/SimplifyCFG/switch_switch_fold_dbginfo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: grep switch | count 1 ; ModuleID = '<stdin>' diff --git a/test/Transforms/SimplifyCFG/switch_thread.ll b/test/Transforms/SimplifyCFG/switch_thread.ll index a92528a..bd85fcc 100644 --- a/test/Transforms/SimplifyCFG/switch_thread.ll +++ b/test/Transforms/SimplifyCFG/switch_thread.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \ +; RUN: opt < %s -simplifycfg -S | \ ; RUN: not grep {call void @DEAD} ; Test that we can thread a simple known condition through switch statements. diff --git a/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll b/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll index a73a82b..0c9cc8b 100644 --- a/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll +++ b/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {volatile load} +; RUN: opt < %s -simplifycfg -S | grep {volatile load} ; PR2967 target datalayout = diff --git a/test/Transforms/SimplifyCFG/two-entry-phi-return.dbg.ll b/test/Transforms/SimplifyCFG/two-entry-phi-return.dbg.ll index 62d4a43..3a6c2ed 100644 --- a/test/Transforms/SimplifyCFG/two-entry-phi-return.dbg.ll +++ b/test/Transforms/SimplifyCFG/two-entry-phi-return.dbg.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } diff --git a/test/Transforms/SimplifyCFG/two-entry-phi-return.ll b/test/Transforms/SimplifyCFG/two-entry-phi-return.ll index 19814ad..fb18624 100644 --- a/test/Transforms/SimplifyCFG/two-entry-phi-return.ll +++ b/test/Transforms/SimplifyCFG/two-entry-phi-return.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br +; RUN: opt < %s -simplifycfg -S | not grep br define i1 @qux(i8* %m, i8* %n, i8* %o, i8* %p) nounwind { entry: diff --git a/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll b/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll index 860a6eb..8816579 100644 --- a/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll +++ b/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls -disable-output +; RUN: opt < %s -simplify-libcalls -disable-output @G = constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll b/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll index 5a56d24..8e9f206 100644 --- a/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll +++ b/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll @@ -1,5 +1,5 @@ ; PR1307 -; RUN: llvm-as < %s | opt -simplify-libcalls -instcombine | llvm-dis > %t +; RUN: opt < %s -simplify-libcalls -instcombine -S > %t ; RUN: grep {@str,.*i64 3} %t ; RUN: grep {@str1,.*i64 7} %t ; RUN: grep {ret i8.*null} %t diff --git a/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll b/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll index b6c0ffd..b687432 100644 --- a/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll +++ b/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep i32 +; RUN: opt < %s -simplify-libcalls -S | grep i32 ; PR2341 @_2E_str = external constant [5 x i8] ; <[5 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll b/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll index fcaf12e..73eb05b 100644 --- a/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll +++ b/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis > %t +; RUN: opt < %s -simplify-libcalls -S > %t ; RUN: grep noalias %t | count 2 ; RUN: grep nocapture %t | count 3 ; RUN: grep nounwind %t | count 3 diff --git a/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll b/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll index 551a2bb..ac89199 100644 --- a/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll +++ b/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -simplify-libcalls -functionattrs | \ +; RUN: opt < %s -inline -simplify-libcalls -functionattrs | \ ; RUN: llvm-dis | grep nocapture | count 2 ; Check that nocapture attributes are added when run after an SCC pass. ; PR3520 diff --git a/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll b/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll index 4aeff1c..cb9819c 100644 --- a/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll +++ b/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis > %t +; RUN: opt < %s -simplify-libcalls -S > %t ; RUN: grep nocapture %t | count 2 ; RUN: grep null %t | grep nocapture | count 1 ; RUN: grep null %t | grep call | grep readonly | count 1 diff --git a/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll b/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll index f720993..9056499 100644 --- a/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll +++ b/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls -instcombine | llvm-dis | grep {ret i32 -65} +; RUN: opt < %s -simplify-libcalls -instcombine -S | grep {ret i32 -65} ; PR4284 define i32 @test() nounwind { diff --git a/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll b/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll new file mode 100644 index 0000000..7af0a26 --- /dev/null +++ b/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll @@ -0,0 +1,22 @@ +; RUN: opt < %s -simplify-libcalls -disable-output +; PR4641 + + %struct.__sFILE = 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, i8*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64, %struct.pthread_mutex*, %struct.pthread*, i32, i32, %union.anon } + %struct.__sbuf = type { i8*, i32, [4 x i8] } + %struct.pthread = type opaque + %struct.pthread_mutex = type opaque + %union.anon = type { i64, [120 x i8] } +@.str13 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1] +@.str14 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1] + +define i32 @main(i32 %argc, i8** %argv) nounwind { +entry: + call void @exit(i32 0) nounwind + %cond392 = select i1 undef, i8* getelementptr ([2 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str14, i32 0, i32 0) ; <i8*> [#uses=1] + %call393 = call %struct.__sFILE* @fopen(i8* undef, i8* %cond392) nounwind ; <%struct.__sFILE*> [#uses=0] + unreachable +} + +declare %struct.__sFILE* @fopen(i8*, i8*) + +declare void @exit(i32) diff --git a/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll b/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll new file mode 100644 index 0000000..b5a788e --- /dev/null +++ b/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll @@ -0,0 +1,24 @@ +; RUN: opt < %s -simplify-libcalls -disable-output +; PR4645 + +define i32 @main() { +entry: + br label %if.then + +lor.lhs.false: ; preds = %while.body + br i1 undef, label %if.then, label %for.cond + +if.then: ; preds = %lor.lhs.false, %while.body + call void @exit(i32 1) + br label %for.cond + +for.cond: ; preds = %for.end, %if.then, %lor.lhs.false + %j.0 = phi i32 [ %inc47, %for.end ], [ 0, %if.then ], [ 0, %lor.lhs.false ] ; <i32> [#uses=1] + unreachable + +for.end: ; preds = %for.cond20 + %inc47 = add i32 %j.0, 1 ; <i32> [#uses=1] + br label %for.cond +} + +declare void @exit(i32) diff --git a/test/Transforms/SimplifyLibCalls/FFS.ll b/test/Transforms/SimplifyLibCalls/FFS.ll index d6a504a..ab45f18 100644 --- a/test/Transforms/SimplifyLibCalls/FFS.ll +++ b/test/Transforms/SimplifyLibCalls/FFS.ll @@ -1,5 +1,5 @@ ; Test that the ToAsciiOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*@ffs} @non_const = external global i32 ; <i32*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/FPrintF.ll b/test/Transforms/SimplifyLibCalls/FPrintF.ll index ac6b3c1..4a0d232 100644 --- a/test/Transforms/SimplifyLibCalls/FPrintF.ll +++ b/test/Transforms/SimplifyLibCalls/FPrintF.ll @@ -1,7 +1,10 @@ ; Test that the FPrintFOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*fprintf} -; + +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] } %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 } diff --git a/test/Transforms/SimplifyLibCalls/IsDigit.ll b/test/Transforms/SimplifyLibCalls/IsDigit.ll index a290e01..51a769d 100644 --- a/test/Transforms/SimplifyLibCalls/IsDigit.ll +++ b/test/Transforms/SimplifyLibCalls/IsDigit.ll @@ -1,5 +1,5 @@ ; Test that the IsDigitOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep call declare i32 @isdigit(i32) diff --git a/test/Transforms/SimplifyLibCalls/MemCpy.ll b/test/Transforms/SimplifyLibCalls/MemCpy.ll index 4e33b07..39662b1 100644 --- a/test/Transforms/SimplifyLibCalls/MemCpy.ll +++ b/test/Transforms/SimplifyLibCalls/MemCpy.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constprop -instcombine | llvm-dis | not grep {call.*llvm.memcpy.i32} +; RUN: opt < %s -constprop -instcombine -S | not grep {call.*llvm.memcpy.i32} @h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1] @hel = constant [4 x i8] c"hel\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/Printf.ll b/test/Transforms/SimplifyLibCalls/Printf.ll index c892f03..858a09c 100644 --- a/test/Transforms/SimplifyLibCalls/Printf.ll +++ b/test/Transforms/SimplifyLibCalls/Printf.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep putchar -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | grep putchar +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*printf} @str = internal constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/Puts.ll b/test/Transforms/SimplifyLibCalls/Puts.ll index e9bb2b3..47a33c2 100644 --- a/test/Transforms/SimplifyLibCalls/Puts.ll +++ b/test/Transforms/SimplifyLibCalls/Puts.ll @@ -1,7 +1,10 @@ ; Test that the PutsCatOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*fputs} -; + +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] } %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 } diff --git a/test/Transforms/SimplifyLibCalls/SPrintF.ll b/test/Transforms/SimplifyLibCalls/SPrintF.ll index 53f5ef1..847e363 100644 --- a/test/Transforms/SimplifyLibCalls/SPrintF.ll +++ b/test/Transforms/SimplifyLibCalls/SPrintF.ll @@ -1,7 +1,11 @@ ; Test that the SPrintFOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*sprintf} +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" + @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] @null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] @null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/StrCat.ll b/test/Transforms/SimplifyLibCalls/StrCat.ll index 89ef4ea..4e3d0ab 100644 --- a/test/Transforms/SimplifyLibCalls/StrCat.ll +++ b/test/Transforms/SimplifyLibCalls/StrCat.ll @@ -1,10 +1,14 @@ ; Test that the StrCatOptimizer works correctly ; PR3661 -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*strcat} -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: grep {puts.*%arg1} +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" + @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] @null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] @null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/StrChr.ll b/test/Transforms/SimplifyLibCalls/StrChr.ll index 802639f..50ca0a6 100644 --- a/test/Transforms/SimplifyLibCalls/StrChr.ll +++ b/test/Transforms/SimplifyLibCalls/StrChr.ll @@ -1,7 +1,11 @@ ; Test that the StrChrOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*@strchr} +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" + @hello = constant [14 x i8] c"hello world\5Cn\00" ; <[14 x i8]*> [#uses=1] @null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/StrCmp.ll b/test/Transforms/SimplifyLibCalls/StrCmp.ll index ae28e4a..7359635 100644 --- a/test/Transforms/SimplifyLibCalls/StrCmp.ll +++ b/test/Transforms/SimplifyLibCalls/StrCmp.ll @@ -1,5 +1,5 @@ ; Test that the StrCmpOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*strcmp} @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/StrCpy.ll b/test/Transforms/SimplifyLibCalls/StrCpy.ll index f23582c..7542984 100644 --- a/test/Transforms/SimplifyLibCalls/StrCpy.ll +++ b/test/Transforms/SimplifyLibCalls/StrCpy.ll @@ -1,7 +1,11 @@ ; Test that the StrCpyOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*strcpy} +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" + @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] @null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] @null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/StrLen.ll b/test/Transforms/SimplifyLibCalls/StrLen.ll index 521a224..45b349d 100644 --- a/test/Transforms/SimplifyLibCalls/StrLen.ll +++ b/test/Transforms/SimplifyLibCalls/StrLen.ll @@ -1,5 +1,5 @@ ; Test that the StrCatOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*strlen} target datalayout = "e-p:32:32" diff --git a/test/Transforms/SimplifyLibCalls/StrNCat.ll b/test/Transforms/SimplifyLibCalls/StrNCat.ll index 0ce319c..d09c022 100644 --- a/test/Transforms/SimplifyLibCalls/StrNCat.ll +++ b/test/Transforms/SimplifyLibCalls/StrNCat.ll @@ -1,9 +1,13 @@ ; Test that the StrNCatOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*strncat} -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: grep {puts.*%arg1} +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" + @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] @null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] @null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/StrNCmp.ll b/test/Transforms/SimplifyLibCalls/StrNCmp.ll index f85394d..ba77385 100644 --- a/test/Transforms/SimplifyLibCalls/StrNCmp.ll +++ b/test/Transforms/SimplifyLibCalls/StrNCmp.ll @@ -1,5 +1,5 @@ ; Test that the StrNCmpOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*strncmp} @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/StrNCpy.ll b/test/Transforms/SimplifyLibCalls/StrNCpy.ll index 011e9be..c8af3ca 100644 --- a/test/Transforms/SimplifyLibCalls/StrNCpy.ll +++ b/test/Transforms/SimplifyLibCalls/StrNCpy.ll @@ -1,7 +1,11 @@ ; Test that the StrNCpyOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*strncpy} +; This transformation requires the pointer size, as it assumes that size_t is +; the size of a pointer. +target datalayout = "-p:64:64:64" + @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] @null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] @null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1] diff --git a/test/Transforms/SimplifyLibCalls/ToAscii.ll b/test/Transforms/SimplifyLibCalls/ToAscii.ll index 9200d2f..e2b5683 100644 --- a/test/Transforms/SimplifyLibCalls/ToAscii.ll +++ b/test/Transforms/SimplifyLibCalls/ToAscii.ll @@ -1,5 +1,5 @@ ; Test that the ToAsciiOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \ +; RUN: opt < %s -simplify-libcalls -S | \ ; RUN: not grep {call.*toascii} declare i32 @toascii(i32) diff --git a/test/Transforms/SimplifyLibCalls/abs.ll b/test/Transforms/SimplifyLibCalls/abs.ll index 520189b..6fbe0b9 100644 --- a/test/Transforms/SimplifyLibCalls/abs.ll +++ b/test/Transforms/SimplifyLibCalls/abs.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep {select i1 %ispos} +; RUN: opt < %s -simplify-libcalls -S | grep {select i1 %ispos} ; PR2337 define i32 @test(i32 %x) { diff --git a/test/Transforms/SimplifyLibCalls/exp2.ll b/test/Transforms/SimplifyLibCalls/exp2.ll index dea3df4..2f5d910 100644 --- a/test/Transforms/SimplifyLibCalls/exp2.ll +++ b/test/Transforms/SimplifyLibCalls/exp2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep {call.*ldexp} | count 4 +; RUN: opt < %s -simplify-libcalls -S | grep {call.*ldexp} | count 4 ; rdar://5852514 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" diff --git a/test/Transforms/SimplifyLibCalls/floor.ll b/test/Transforms/SimplifyLibCalls/floor.ll index 31eb3f6..a7af5a9 100644 --- a/test/Transforms/SimplifyLibCalls/floor.ll +++ b/test/Transforms/SimplifyLibCalls/floor.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis > %t +; RUN: opt < %s -simplify-libcalls -S > %t ; RUN: not grep {call.*floor(} %t ; RUN: grep {call.*floorf(} %t ; RUN: not grep {call.*ceil(} %t diff --git a/test/Transforms/SimplifyLibCalls/half-powr.ll b/test/Transforms/SimplifyLibCalls/half-powr.ll index 890e788..5d317fe 100644 --- a/test/Transforms/SimplifyLibCalls/half-powr.ll +++ b/test/Transforms/SimplifyLibCalls/half-powr.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls-halfpowr | llvm-dis | %prcontext {mul float} 1 | grep {mul float} | count 8 +; RUN: opt -simplify-libcalls-halfpowr %s -S | FileCheck %s define float @__half_powrf4(float %f, float %g) nounwind readnone { entry: @@ -12,6 +12,11 @@ bb: ; preds = %entry bb1: ; preds = %bb, %entry %f_addr.0 = phi float [ %1, %bb ], [ %f, %entry ] ; <float> [#uses=1] %2 = fmul float %f_addr.0, %g ; <float> [#uses=1] +; CHECK: fmul float %f_addr +; CHECK: fmul float %f_addr +; CHECK: fmul float %f_addr +; CHECK: fmul float %f_addr + ret float %2 } diff --git a/test/Transforms/SimplifyLibCalls/memcmp.ll b/test/Transforms/SimplifyLibCalls/memcmp.ll index 7bdbc8d..7008736 100644 --- a/test/Transforms/SimplifyLibCalls/memcmp.ll +++ b/test/Transforms/SimplifyLibCalls/memcmp.ll @@ -1,5 +1,5 @@ ; Test that the memcmpOptimizer works correctly -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep {call.*memcmp} +; RUN: opt < %s -simplify-libcalls -S | not grep {call.*memcmp} @h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=0] @hel = constant [4 x i8] c"hel\00" ; <[4 x i8]*> [#uses=0] diff --git a/test/Transforms/SimplifyLibCalls/memmove.ll b/test/Transforms/SimplifyLibCalls/memmove.ll index d960960..c0c0050 100644 --- a/test/Transforms/SimplifyLibCalls/memmove.ll +++ b/test/Transforms/SimplifyLibCalls/memmove.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep {llvm.memmove} +; RUN: opt < %s -simplify-libcalls -S | grep {llvm.memmove} 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/SimplifyLibCalls/memset-64.ll b/test/Transforms/SimplifyLibCalls/memset-64.ll new file mode 100644 index 0000000..fb752c4 --- /dev/null +++ b/test/Transforms/SimplifyLibCalls/memset-64.ll @@ -0,0 +1,12 @@ +; RUN: opt < %s -simplify-libcalls -S | grep {llvm.memset} +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" +target triple = "x86_64-pc-linux-gnu" + +define void @a(i8* %x) nounwind { +entry: + %call = call i8* @memset(i8* %x, i32 1, i64 100) ; <i8*> [#uses=0] + ret void +} + +declare i8* @memset(i8*, i32, i64) + diff --git a/test/Transforms/SimplifyLibCalls/memset.ll b/test/Transforms/SimplifyLibCalls/memset.ll index 0c10915..0aede06 100644 --- a/test/Transforms/SimplifyLibCalls/memset.ll +++ b/test/Transforms/SimplifyLibCalls/memset.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep {llvm.memset} +; RUN: opt < %s -simplify-libcalls -S | grep {llvm.memset} 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" target triple = "i686-pc-linux-gnu" diff --git a/test/Transforms/SimplifyLibCalls/pow-to-sqrt.ll b/test/Transforms/SimplifyLibCalls/pow-to-sqrt.ll new file mode 100644 index 0000000..669b414 --- /dev/null +++ b/test/Transforms/SimplifyLibCalls/pow-to-sqrt.ll @@ -0,0 +1,33 @@ +; RUN: opt < %s -simplify-libcalls -S | FileCheck %s +; rdar://7251832 + +; SimplifyLibcalls should optimize pow(x, 0.5) to sqrt plus code to handle +; special cases. The readonly attribute on the call should be preserved. + +; CHECK: define float @foo(float %x) nounwind { +; CHECK: %sqrtf = call float @sqrtf(float %x) nounwind readonly +; CHECK: %fabsf = call float @fabsf(float %sqrtf) nounwind readonly +; CHECK: %tmp = fcmp oeq float %x, 0xFFF0000000000000 +; CHECK: %tmp1 = select i1 %tmp, float 0x7FF0000000000000, float %fabsf +; CHECK: ret float %tmp1 + +define float @foo(float %x) nounwind { + %retval = call float @powf(float %x, float 0.5) + ret float %retval +} + +; CHECK: define double @doo(double %x) nounwind { +; CHECK: %sqrt = call double @sqrt(double %x) nounwind readonly +; CHECK: %fabs = call double @fabs(double %sqrt) nounwind readonly +; CHECK: %tmp = fcmp oeq double %x, 0xFFF0000000000000 +; CHECK: %tmp1 = select i1 %tmp, double 0x7FF0000000000000, double %fabs +; CHECK: ret double %tmp1 +; CHECK: } + +define double @doo(double %x) nounwind { + %retval = call double @pow(double %x, double 0.5) + ret double %retval +} + +declare float @powf(float, float) nounwind readonly +declare double @pow(double, double) nounwind readonly diff --git a/test/Transforms/SimplifyLibCalls/pow2.ll b/test/Transforms/SimplifyLibCalls/pow2.ll index a48abba..f8364f7 100644 --- a/test/Transforms/SimplifyLibCalls/pow2.ll +++ b/test/Transforms/SimplifyLibCalls/pow2.ll @@ -1,6 +1,6 @@ ; Testcase for calls to the standard C "pow" function ; -; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep {call .pow} +; RUN: opt < %s -simplify-libcalls -S | not grep {call .pow} declare double @pow(double, double) diff --git a/test/Transforms/SimplifyLibCalls/weak-symbols.ll b/test/Transforms/SimplifyLibCalls/weak-symbols.ll new file mode 100644 index 0000000..5875b21 --- /dev/null +++ b/test/Transforms/SimplifyLibCalls/weak-symbols.ll @@ -0,0 +1,26 @@ +; RUN: opt < %s -simplify-libcalls -S | FileCheck %s +; PR4738 + +; SimplifyLibcalls shouldn't assume anything about weak symbols. + +@real_init = weak_odr constant [2 x i8] c"y\00" +@fake_init = weak constant [2 x i8] c"y\00" +@.str = private constant [2 x i8] c"y\00" + +; CHECK: define i32 @foo +; CHECK: call i32 @strcmp +define i32 @foo() nounwind { +entry: + %t0 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8]* @fake_init, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8]* @.str, i64 0, i64 0)) nounwind readonly + ret i32 %t0 +} + +; CHECK: define i32 @bar +; CHECK: ret i32 0 +define i32 @bar() nounwind { +entry: + %t0 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8]* @real_init, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8]* @.str, i64 0, i64 0)) nounwind readonly + ret i32 %t0 +} + +declare i32 @strcmp(i8*, i8*) nounwind readonly diff --git a/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll b/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll index 16cee15..69febc3 100644 --- a/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll +++ b/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -strip | llvm-dis | grep foo | count 2 -; RUN: llvm-as < %s | opt -strip | llvm-dis | grep bar | count 2 +; RUN: opt < %s -strip -S | grep foo | count 2 +; RUN: opt < %s -strip -S | grep bar | count 2 @llvm.used = appending global [2 x i8*] [ i8* bitcast (i32* @foo to i8*), i8* bitcast (i32 ()* @bar to i8*) ], section "llvm.metadata" ; <[2 x i8*]*> [#uses=0] @foo = internal constant i32 41 ; <i32*> [#uses=1] diff --git a/test/Transforms/TailCallElim/accum_recursion.ll b/test/Transforms/TailCallElim/accum_recursion.ll index e8c28ec..b2a9ed2 100644 --- a/test/Transforms/TailCallElim/accum_recursion.ll +++ b/test/Transforms/TailCallElim/accum_recursion.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call +; RUN: opt < %s -tailcallelim -S | not grep call define i32 @factorial(i32 %x) { entry: diff --git a/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll b/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll index 4d63b59..2a90cf3 100644 --- a/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll +++ b/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll @@ -3,7 +3,7 @@ ; go out to the anonymous users of the demo script for "suggesting" ; optimizations that should be done. :) -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call +; RUN: opt < %s -tailcallelim -S | not grep call define i32 @mul(i32 %x, i32 %y) { entry: diff --git a/test/Transforms/TailCallElim/ackermann.ll b/test/Transforms/TailCallElim/ackermann.ll index f65c666..0c140ad 100644 --- a/test/Transforms/TailCallElim/ackermann.ll +++ b/test/Transforms/TailCallElim/ackermann.ll @@ -1,6 +1,5 @@ ; This function contains two tail calls, which should be eliminated -; RUN: llvm-as < %s | \ -; RUN: opt -tailcallelim -stats -disable-output |& grep {2 tailcallelim} +; RUN: opt < %s -tailcallelim -stats -disable-output |& grep {2 tailcallelim} define i32 @Ack(i32 %M.1, i32 %N.1) { entry: diff --git a/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll b/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll index e20fe18..5cc92e1 100644 --- a/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll +++ b/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | \ +; RUN: opt < %s -tailcallelim -S | \ ; RUN: grep {call i32 @foo} declare void @bar(i32*) diff --git a/test/Transforms/TailCallElim/dont_reorder_load.ll b/test/Transforms/TailCallElim/dont_reorder_load.ll index 8fbe008..7b3b232 100644 --- a/test/Transforms/TailCallElim/dont_reorder_load.ll +++ b/test/Transforms/TailCallElim/dont_reorder_load.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as <%s | opt -tailcallelim | llvm-dis | grep call | count 3 +; RUN: opt < %s -tailcallelim -S | grep call | count 3 ; PR4323 ; Several cases where tail call elimination should not move the load above the diff --git a/test/Transforms/TailCallElim/inf-recursion.ll b/test/Transforms/TailCallElim/inf-recursion.ll index fe00f4a..a5f246d 100644 --- a/test/Transforms/TailCallElim/inf-recursion.ll +++ b/test/Transforms/TailCallElim/inf-recursion.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | grep call +; RUN: opt < %s -tailcallelim -S | grep call ; Don't turn this into an infinite loop, this is probably the implementation ; of fabs and we expect the codegen to lower fabs. diff --git a/test/Transforms/TailCallElim/intervening-inst.ll b/test/Transforms/TailCallElim/intervening-inst.ll index ae4f509..0c40bd5 100644 --- a/test/Transforms/TailCallElim/intervening-inst.ll +++ b/test/Transforms/TailCallElim/intervening-inst.ll @@ -1,5 +1,5 @@ ; This function contains intervening instructions which should be moved out of the way -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call +; RUN: opt < %s -tailcallelim -S | not grep call define i32 @Test(i32 %X) { entry: diff --git a/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll b/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll index bd2b93f..a556ddb 100644 --- a/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll +++ b/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll @@ -1,9 +1,11 @@ -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | \ -; RUN: %prcontext alloca 1 | grep {i32 @foo} +; RUN: opt -tailcallelim %s -S | FileCheck %s +; PR615 declare void @bar(i32*) define i32 @foo() { +; CHECK: i32 @foo() +; CHECK-NEXT: alloca %A = alloca i32 ; <i32*> [#uses=2] store i32 17, i32* %A call void @bar( i32* %A ) diff --git a/test/Transforms/TailCallElim/reorder_load.ll b/test/Transforms/TailCallElim/reorder_load.ll index aeb9042..7f8af7e 100644 --- a/test/Transforms/TailCallElim/reorder_load.ll +++ b/test/Transforms/TailCallElim/reorder_load.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as <%s | opt -tailcallelim | llvm-dis | not grep call +; RUN: opt < %s -tailcallelim -S | not grep call ; PR4323 ; Several cases where tail call elimination should move the load above the call, diff --git a/test/Transforms/TailCallElim/return_constant.ll b/test/Transforms/TailCallElim/return_constant.ll index ab69a42..48e5641 100644 --- a/test/Transforms/TailCallElim/return_constant.ll +++ b/test/Transforms/TailCallElim/return_constant.ll @@ -1,7 +1,7 @@ ; Though this case seems to be fairly unlikely to occur in the wild, someone ; plunked it into the demo script, so maybe they care about it. ; -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call +; RUN: opt < %s -tailcallelim -S | not grep call define i32 @aaa(i32 %c) { entry: diff --git a/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll b/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll index 90a8163..3dddb01 100644 --- a/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll +++ b/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | \ +; RUN: opt < %s -tailcallelim -S | \ ; RUN: grep {tail call void @foo} diff --git a/test/Transforms/TailDup/2003-06-24-Simpleloop.ll b/test/Transforms/TailDup/2003-06-24-Simpleloop.ll index 5c3b539..d7e45af 100644 --- a/test/Transforms/TailDup/2003-06-24-Simpleloop.ll +++ b/test/Transforms/TailDup/2003-06-24-Simpleloop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output define void @motion_result7() { entry: diff --git a/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll b/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll index 705f8bc..90f4990 100644 --- a/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll +++ b/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output define i32 @sum() { entry: diff --git a/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll b/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll index 1fae77b..efe9eae 100644 --- a/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll +++ b/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output define i32 @sell_haggle() { entry: diff --git a/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll b/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll index e464713..dc64923 100644 --- a/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll +++ b/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output define i32 @foo() { entry: diff --git a/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll b/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll index 81624ff..c1e5f73 100644 --- a/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll +++ b/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output define void @interpret() { entry: diff --git a/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll b/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll index a67e8cd..3e4f0b7 100644 --- a/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll +++ b/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate | llc +; RUN: opt < %s -tailduplicate | llc ; PR2323 define i32 @func_27(i32 %p_28) nounwind { diff --git a/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll b/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll index c29e7d4..88a5656 100644 --- a/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll +++ b/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -taildup-threshold=3 -stats -disable-output | not grep tailduplicate +; RUN: opt < %s -tailduplicate -taildup-threshold=3 -stats -disable-output | not grep tailduplicate ; XFAIL: * define i32 @foo(i32 %l) nounwind { diff --git a/test/Transforms/TailDup/2009-07-31-phicrash.ll b/test/Transforms/TailDup/2009-07-31-phicrash.ll new file mode 100644 index 0000000..ad1a040 --- /dev/null +++ b/test/Transforms/TailDup/2009-07-31-phicrash.ll @@ -0,0 +1,14 @@ +; RUN: opt < %s -tailduplicate -disable-output +; PR4662 + +define void @a() { +BB: + br label %BB6 + +BB6: + %tmp9 = phi i64 [ 0, %BB ], [ 5, %BB34 ] + br label %BB34 + +BB34: + br label %BB6 +} diff --git a/test/Transforms/TailDup/MergeTest.ll b/test/Transforms/TailDup/MergeTest.ll index 0a3ab6d..2224283 100644 --- a/test/Transforms/TailDup/MergeTest.ll +++ b/test/Transforms/TailDup/MergeTest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -taildup-threshold=2 | llvm-dis | grep add | not grep uses=1 +; RUN: opt < %s -tailduplicate -taildup-threshold=2 -S | grep add | not grep uses=1 define i32 @test1(i1 %C, i32 %A, i32* %P) { entry: diff --git a/test/Transforms/TailDup/PHIUpdateTest.ll b/test/Transforms/TailDup/PHIUpdateTest.ll index 6f86587..38d8ebf 100644 --- a/test/Transforms/TailDup/PHIUpdateTest.ll +++ b/test/Transforms/TailDup/PHIUpdateTest.ll @@ -1,6 +1,6 @@ ; This test checks to make sure phi nodes are updated properly ; -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output define i32 @test(i1 %c, i32 %X, i32 %Y) { br label %L diff --git a/test/Transforms/TailDup/basictest.ll b/test/Transforms/TailDup/basictest.ll index ef36890..94f5d87 100644 --- a/test/Transforms/TailDup/basictest.ll +++ b/test/Transforms/TailDup/basictest.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output declare void @__main() diff --git a/test/Transforms/TailDup/basictest2.ll b/test/Transforms/TailDup/basictest2.ll index f79d718..81a996a 100644 --- a/test/Transforms/TailDup/basictest2.ll +++ b/test/Transforms/TailDup/basictest2.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -tailduplicate -disable-output +; RUN: opt < %s -tailduplicate -disable-output define void @ab() { entry: diff --git a/test/Transforms/TailDup/if-tail-dup.ll b/test/Transforms/TailDup/if-tail-dup.ll index 7c4d9c2..2e4f5be 100644 --- a/test/Transforms/TailDup/if-tail-dup.ll +++ b/test/Transforms/TailDup/if-tail-dup.ll @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -tailduplicate | \ -; RUN: llc -march=x86 -o %t -f +; RUN: opt < %s -tailduplicate | \ +; RUN: llc -march=x86 -o %t ; RUN: grep {\\\<je\\\>} %t ; RUN: not grep jmp %t ; END. |