llvm.org GIT mirror llvm / e78760e
Renamed `as' => `llvm-as', `dis' => `llvm-dis', `link' => `llvm-link'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8558 91177308-0d34-0410-b5e6-96231b3b80d8 Misha Brukman 16 years ago
251 changed file(s) with 251 addition(s) and 251 deletion(s). Raw diff Collapse all Expand all
11 ; is performed. It is not legal to delete the second load instruction because
22 ; the value computed by the first load instruction is changed by the store.
33
4 ; RUN: as < %s | opt -load-vn -gcse -instcombine | dis | grep DONOTREMOVE
4 ; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep DONOTREMOVE
55
66 int %test() {
77 %A = alloca int
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11 ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
22 void %test({[2 x int],[2 x int]}* %A, long %X, long %Y) {
33 %P1 = getelementptr {[2 x int],[2 x int]}* %A, long 0, ubyte 0, long %X
None ; RUN: as < %s | opt -load-vn -gcse -instcombine | dis | grep sub
0 ; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
11
22 ; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
33
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11 ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
22 void %test([17 x ushort]* %mask_bits) {
33 %P1 = getelementptr [17 x ushort]* %mask_bits, long 0, long 0
None ; RUN: as < %s | opt -licm -disable-output
0 ; RUN: llvm-as < %s | opt -licm -disable-output
11 %struct..apr_array_header_t = type { int*, int, int, int, sbyte* }
22 %struct..apr_table_t = type { %struct..apr_array_header_t, uint, [32 x int], [32 x int] }
33
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11
22 int %MTConcat([3 x int]* %a.1) {
33 %tmp.961 = getelementptr [3 x int]* %a.1, long 0, long 4
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11
22 %struct..RefPoint = type { int, { uint, ushort, ushort } }
33 %struct..RefRect = type { %struct..RefPoint, %struct..RefPoint }
0 ; This testcase tests for various features the basicaa test should be able to
11 ; determine, as noted in the comments.
22
3 ; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep REMOVE
3 ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | llvm-dis | not grep REMOVE
44
55 %Global = external global { int }
66
11 ; disambiguating some obvious cases. All loads should be removable in
22 ; this testcase.
33
4 ; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep load
4 ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | llvm-dis | not grep load
55
66 %A = global int 7
77 %B = global int 8
22 ; two pointers, then the load should be hoisted, and the store sunk. Thus
33 ; the loop becomes empty and can be deleted by ADCE.
44
5 ; RUN: as < %s | opt -basicaa -licm --adce | dis | not grep Loop
5 ; RUN: llvm-as < %s | opt -basicaa -licm --adce | llvm-dis | not grep Loop
66
77 %A = global int 7
88 %B = global int 8
0 ; This testcase ensures that redundant loads are eliminated when they should
11 ; be. All RL variables (redundant loads) should be eliminated.
22 ;
3 ; RUN: as < %s | opt -load-vn -gcse | dis | not grep %RL
3 ; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep %RL
44 ;
55 int "test1"(int* %P) {
66 %A = load int* %P
0
1 ; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | dis | grep sub
1 ; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
22
33 int %test(int* %P) {
44 %X = volatile load int* %P
0 ; This testcase ensures that redundant loads are preserved when they are not
11 ; allowed to be eliminated.
2 ; RUN: as < %s | opt -load-vn -gcse | dis | grep sub
2 ; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | grep sub
33 ;
44 int %test1(int* %P) {
55 %A = load int* %P
0 ; Inlining used to break PHI nodes. This tests that they are correctly updated
11 ; when a node is split around the call instruction. The verifier caught the error.
22 ;
3 ; RUN: as < %s | opt -inline
3 ; RUN: llvm-as < %s | opt -inline
44 ;
55 implementation
66
44 ;
55 ; Fixed by adding new arguments to ConstantFoldTerminator
66 ;
7 ; RUN: as < %s | opt -constprop
7 ; RUN: llvm-as < %s | opt -constprop
88
99 implementation
1010
None ; RUN: as < %s | opt -adce
0 ; RUN: llvm-as < %s | opt -adce
11
22 implementation
33
0 ; It is illegal to remove BB1 because it will mess up the PHI node!
11 ;
2 ; RUN: as < %s | opt -adce | dis | grep BB1
2 ; RUN: llvm-as < %s | opt -adce | llvm-dis | grep BB1
33
44
55 int "test"(bool %C, int %A, int %B) {
33 ; removed even though there were uses still around. Now the uses are filled
44 ; in with a dummy value before the PHI is deleted.
55 ;
6 ; RUN: as < %s | opt -adce
6 ; RUN: llvm-as < %s | opt -adce
77
88 %node_t = type { double*, %node_t*, %node_t**, double**, double*, int, int }
99
0 ; This testcase is a distilled form of: 2002-05-28-Crash.ll
11
2 ; RUN: as < %s | opt -adce
2 ; RUN: llvm-as < %s | opt -adce
33
44 float "test"(int %i) {
55 %F = cast int %i to float ; This BB is not dead
1010 ; return !s;
1111 ;}
1212 ;
13 ; RUN: as < %s | opt -adce
13 ; RUN: llvm-as < %s | opt -adce
1414
1515 implementation ; Functions:
1616
22 ; block in this function, it would work fine, but that would be the part we
33 ; have to fix now, wouldn't it....
44 ;
5 ; RUN: as < %s | opt -adce
5 ; RUN: llvm-as < %s | opt -adce
66
77 void %foo(sbyte* %reg5481) {
88 %cast611 = cast sbyte* %reg5481 to sbyte** ; [#uses=1]
0 ; This testcase was extracted from the gzip SPEC benchmark
11 ;
2 ; RUN: as < %s | opt -adce
2 ; RUN: llvm-as < %s | opt -adce
33
44 %bk = external global uint ; [#uses=2]
55 %hufts = external global uint ; [#uses=1]
0 ; Testcase reduced from 197.parser by bugpoint
1 ; RUN: as < %s | opt -adce
1 ; RUN: llvm-as < %s | opt -adce
22 implementation ; Functions:
33
44 void %conjunction_prune() {
11 ; entries for it's postdominator. But I think this can only happen when the
22 ; PHI node is dead, so we just avoid patching up dead PHI nodes.
33
4 ; RUN: as < %s | opt -adce
4 ; RUN: llvm-as < %s | opt -adce
55
66 target endian = little
77 target pointersize = 32
None ; RUN: as < %s | opt -adce -disable-output
0 ; RUN: llvm-as < %s | opt -adce -disable-output
11 %G = external global int*
22
33 implementation ; Functions:
None ; RUN: as < %s | opt -adce -disable-output
0 ; RUN: llvm-as < %s | opt -adce -disable-output
11
22 target endian = little
33 target pointersize = 32
None ; RUN: as < %s | opt -adce -simplifycfg | dis | not grep then:
0 ; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis | not grep then:
11
22 void %dead_test8(int* %data.1, int %idx.1) {
33 entry: ; No predecessors!
None ; RUN: as < %s | opt -adce -disable-output
0 ; RUN: llvm-as < %s | opt -adce -disable-output
11
22 implementation ; Functions:
33
0 ; This is the test case taken from Appel's book that illustrates a hard case
11 ; that SCCP gets right, and when followed by ADCE, is completely eliminated
22 ;
3 ; RUN: as < %s | opt -sccp -adce -simplifycfg | dis | not grep br
3 ; RUN: llvm-as < %s | opt -sccp -adce -simplifycfg | llvm-dis | not grep br
44
55 int "test function"(int %i0, int %j0) {
66 BB1:
None ; RUN: as < %s | opt -adce -simplifycfg | dis
0 ; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis
11
22 int "Test"(int %A, int %B) {
33 BB1:
None ; RUN: as < %s | opt -adce -simplifycfg | dis
0 ; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis
11
22 %FILE = type { int, ubyte*, ubyte*, ubyte, ubyte, uint, uint, uint }
33 %spec_fd_t = type { int, int, int, ubyte* }
None ; RUN: as < %s | opt -adce -simplifycfg | dis
0 ; RUN: llvm-as < %s | opt -adce -simplifycfg | llvm-dis
11
22 %FILE = type { int, ubyte*, ubyte*, ubyte, ubyte, uint, uint, uint }
33 %spec_fd_t = type { int, int, int, ubyte* }
11 ; is performed. It is not legal to delete the second load instruction because
22 ; the value computed by the first load instruction is changed by the store.
33
4 ; RUN: as < %s | opt -load-vn -gcse -instcombine | dis | grep DONOTREMOVE
4 ; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep DONOTREMOVE
55
66 int %test() {
77 %A = alloca int
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11 ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
22 void %test({[2 x int],[2 x int]}* %A, long %X, long %Y) {
33 %P1 = getelementptr {[2 x int],[2 x int]}* %A, long 0, ubyte 0, long %X
None ; RUN: as < %s | opt -load-vn -gcse -instcombine | dis | grep sub
0 ; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
11
22 ; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
33
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11 ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
22 void %test([17 x ushort]* %mask_bits) {
33 %P1 = getelementptr [17 x ushort]* %mask_bits, long 0, long 0
None ; RUN: as < %s | opt -licm -disable-output
0 ; RUN: llvm-as < %s | opt -licm -disable-output
11 %struct..apr_array_header_t = type { int*, int, int, int, sbyte* }
22 %struct..apr_table_t = type { %struct..apr_array_header_t, uint, [32 x int], [32 x int] }
33
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11
22 int %MTConcat([3 x int]* %a.1) {
33 %tmp.961 = getelementptr [3 x int]* %a.1, long 0, long 4
None ; RUN: as < %s | opt -basicaa -aa-eval -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
11
22 %struct..RefPoint = type { int, { uint, ushort, ushort } }
33 %struct..RefRect = type { %struct..RefPoint, %struct..RefPoint }
0 ; This testcase tests for various features the basicaa test should be able to
11 ; determine, as noted in the comments.
22
3 ; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep REMOVE
3 ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | llvm-dis | not grep REMOVE
44
55 %Global = external global { int }
66
11 ; disambiguating some obvious cases. All loads should be removable in
22 ; this testcase.
33
4 ; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep load
4 ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | llvm-dis | not grep load
55
66 %A = global int 7
77 %B = global int 8
22 ; two pointers, then the load should be hoisted, and the store sunk. Thus
33 ; the loop becomes empty and can be deleted by ADCE.
44
5 ; RUN: as < %s | opt -basicaa -licm --adce | dis | not grep Loop
5 ; RUN: llvm-as < %s | opt -basicaa -licm --adce | llvm-dis | not grep Loop
66
77 %A = global int 7
88 %B = global int 8
0 ; Make sure that the constant propogator doesn't divide by zero!
11 ;
2 ; RUN: as < %s | opt -constprop
2 ; RUN: llvm-as < %s | opt -constprop
33 ;
44
55 int "test"() {
33
44 ; Fix #2: The unary not instruction now no longer exists. Change to xor.
55
6 ; RUN: as < %s | opt -constprop | dis | not grep 'int 0'
6 ; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep 'int 0'
77
88 int "test1"() {
99 %R = xor int 123, -1
0 ; SetCC on boolean values was not implemented!
11
2 ; RUN: as < %s | opt -constprop -die | dis | not grep 'set'
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep 'set'
33
44 bool "test1"() {
55 %A = setle bool true, false
0 ; Make sure that the constant propagator doesn't cause a sigfpe
11 ;
2 ; RUN: as < %s | opt -constprop
2 ; RUN: llvm-as < %s | opt -constprop
33 ;
44
55 int "test"() {
0 ; This is a basic sanity check for constant propogation. The add instruction
11 ; should be eliminated.
22
3 ; RUN: as < %s | opt -constprop -die | dis | not grep add
3 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep add
44
55 int %test(bool %B) {
66 br bool %B, label %BB1, label %BB2
0 ; Ensure constant propogation of logical instructions is working correctly.
11
2 ; RUN: as < %s | opt -constprop -die | dis | not ggrep -E 'and|or|xor'
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not ggrep -E 'and|or|xor'
33
44
55 int "test1"() { %R = and int 4,1234 ret int %R }
0 ; Ensure constant propogation of 'not' instructions is working correctly.
11
2 ; RUN: as < %s | opt -constprop -die | dis | not grep xor
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep xor
33
44 int "test1"() {
55 %R = xor int 4, -1
0 ; This is a basic sanity check for constant propogation. The add instruction
11 ; should be eliminated.
22
3 ; RUN: as < %s | opt -constprop -die | dis | not grep phi
3 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep phi
44
55 int %test(bool %B) {
66 BB0:
0 ; Ensure constant propagation of remainder instructions is working correctly.
11
2 ; RUN: as < %s | opt -constprop -die | dis | not grep rem
2 ; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | not grep rem
33
44 int %test1() {
55 %R = rem int 4, 3
None ; RUN: as < %s | opt -constmerge > /dev/null
0 ; RUN: llvm-as < %s | opt -constmerge > /dev/null
11
22 %foo = internal constant {int} {int 7}
33 %bar = internal constant {int} {int 7}
None ; RUN: as < %s | opt -cee
0 ; RUN: llvm-as < %s | opt -cee
11
22 implementation
33
1111 ; }
1212 ; }
1313 ;
14 ; RUN: as < %s | opt -cee -simplifycfg | dis | not grep bb3
14 ; RUN: llvm-as < %s | opt -cee -simplifycfg | llvm-dis | not grep bb3
1515
1616 implementation
1717 declare void %bar()
0 ; Testcase distilled from bisort where we tried to perform branch target
11 ; forwarding where it was not safe.
2 ; RUN: as < %s | opt -cee
2 ; RUN: llvm-as < %s | opt -cee
33 ;
44 %HANDLE = type { int, %HANDLE*, %HANDLE* }
55 %struct.node = type { int, %HANDLE*, %HANDLE* }
None ; RUN: as < %s | opt -cee
0 ; RUN: llvm-as < %s | opt -cee
11 ;
22 ; The 'cee' pass is breaking SSA form when it blindly forwards the branch from
33 ; Eq to branch to "Forwarded" instead.
None ; RUN: as < %s | opt -cee
0 ; RUN: llvm-as < %s | opt -cee
11 ;
22 ; This testcase causes an assertion error.
33 ;
0 ; Test to make sure that SSA is correctly updated
1 ; RUN: as < %s | opt -cee
1 ; RUN: llvm-as < %s | opt -cee
22 ;
33 implementation ; Functions:
44
0 ; Simple test to make sure dominators are updated properly
1 ; RUN: as < %s | opt -cee
1 ; RUN: llvm-as < %s | opt -cee
22
33 implementation ; Functions:
44
None ; RUN: as < %s | opt -cee -constprop -instcombine -dce | dis | not grep 'REMOVE'
0 ; RUN: llvm-as < %s | opt -cee -constprop -instcombine -dce | llvm-dis | not grep 'REMOVE'
11
22 int %test1(int %A) {
33 %cond = seteq int %A, 40
None ; RUN: as < %s | opt -cee -simplifycfg | dis | not grep 'REMOVE'
0 ; RUN: llvm-as < %s | opt -cee -simplifycfg | llvm-dis | not grep 'REMOVE'
11
22 implementation
33
1010 ;
1111 ; Note that this is a "feature" test, not a correctness test.
1212 ;
13 ; RUN: as < %s | opt -cee -simplifycfg | dis | not grep cond213
13 ; RUN: llvm-as < %s | opt -cee -simplifycfg | llvm-dis | not grep cond213
1414 ;
1515 implementation ; Functions:
1616
0 ; a load or store of a pointer indicates that the pointer is not null.
11 ; Any succeeding uses of the pointer should get this info
22
3 ; RUN: as < %s | opt -cee -instcombine -simplifycfg | dis | not grep br
3 ; RUN: llvm-as < %s | opt -cee -instcombine -simplifycfg | llvm-dis | not grep br
44
55 implementation ; Functions:
66
1010 ;
1111 ; This should eliminate all BB's except BB0, BB9, BB10
1212 ;
13 ; RUN: as < %s | opt -cee -instcombine -simplifycfg | dis | not grep 'bb[2-8]'
13 ; RUN: llvm-as < %s | opt -cee -instcombine -simplifycfg | llvm-dis | not grep 'bb[2-8]'
1414
1515 implementation ; Functions:
1616
None ; RUN: as < %s | opt -deadargelim | dis | not grep DEADARG
0 ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEADARG
11
22 implementation
33
None ; RUN: as < %s | opt -f -lowerrefs -o Output/%s.bc
0 ; RUN: llvm-as < %s | opt -f -lowerrefs -o Output/%s.bc
11 ;
22 %Flat_struct = type { sbyte, float }
33 %Flat_t = type { sbyte, float }
0 ; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved
11 ; correctly.
22 ;
3 ; RUN: as < %s | opt -funcresolve | dis | not grep external
3 ; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep external
44
55 %X = external global [0 x int]
66 %X = global [4 x int] [ int 1, int 2, int 3, int 4 ]
0 ; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved
11 ; correctly. This doesn't have constantexprs
22 ;
3 ; RUN: as < %s | opt -funcresolve | dis | not grep external
3 ; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep external
44 ;
55
66 %X = external global [0 x int]
None ; RUN: as < %s | opt -funcresolve -funcresolve | dis | not grep declare
0 ; RUN: llvm-as < %s | opt -funcresolve -funcresolve | llvm-dis | not grep declare
11
22 declare void %qsortg(sbyte*, int, int)
33
0 ;
1 ; RUN: as < %s | opt -funcresolve -instcombine | dis | not grep '\.\.\.'
1 ; RUN: llvm-as < %s | opt -funcresolve -instcombine | llvm-dis | not grep '\.\.\.'
22
33 declare int %foo(...)
44 declare int %foo(int)
None ; RUN: as < %s | opt -funcresolve -disable-output 2>&1 | not grep WARNING
0 ; RUN: llvm-as < %s | opt -funcresolve -disable-output 2>&1 | not grep WARNING
11
22 %__popcount_tab = external constant [0 x ubyte]
33 %__popcount_tab = constant [4 x ubyte] c"\00\01\01\02"
None ; RUN: as < %s | opt -funcresolve -disable-output
0 ; RUN: llvm-as < %s | opt -funcresolve -disable-output
11
22 void %foo(int, int) {
33 ret void
None ; RUN: as < %s | opt -funcresolve | dis | not grep declare
0 ; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep declare
11
22 %Table = constant int(...)* %foo
33
None ; RUN: as < %s | opt -funcresolve | dis | not grep declare
0 ; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep declare
11
22 declare void %test(...)
33
None ; RUN: as < %s | opt -funcresolve | dis | not grep foo
0 ; RUN: llvm-as < %s | opt -funcresolve | llvm-dis | not grep foo
11
22 ; The funcresolve pass was resolving the two foo's together in this test,
33 ; adding a ConstantPointerRef to one of them. Then because of this
None ; RUN: as < %s | opt -funcresolve -disable-output 2>&1 | not grep WARNING
0 ; RUN: llvm-as < %s | opt -funcresolve -disable-output 2>&1 | not grep WARNING
11
22 declare int %foo(int *%X)
33 declare int %foo(float *%X)
None ; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
0 ; RUN: llvm-as < %s | opt -funcresolve -instcombine | llvm-dis | grep '\.\.\.' | not grep call
11
22 declare int %foo(...)
33
0 ; This shows where the function is called with the prototype indicating a
11 ; return type exists, but it really doesn't.
2 ; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
2 ; RUN: llvm-as < %s | opt -funcresolve -instcombine | llvm-dis | grep '\.\.\.' | not grep call
33
44 declare int %foo(...)
55
0 ; This shows where the function is called with the prototype indicating a
11 ; return type doesn't exists, but it really does.
22 ;
3 ; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
3 ; RUN: llvm-as < %s | opt -funcresolve -instcombine | llvm-dis | grep '\.\.\.' | not grep call
44
55 declare void %foo(...)
66
None ; RUN: as < %s | opt -funcresolve
0 ; RUN: llvm-as < %s | opt -funcresolve
11
22 declare int %read(...)
33
0 ; This entire chain of computation should be optimized away, but
11 ; wasn't because the two multiplies were not detected as being identical.
22 ;
3 ; RUN: as < %s | opt -gcse -instcombine -dce | dis | not grep sub
3 ; RUN: llvm-as < %s | opt -gcse -instcombine -dce | llvm-dis | not grep sub
44
55 implementation ; Functions:
66
0 ; This testcase shows a bug where an common subexpression exists, but there
11 ; is no shared dominator block that the expression can be hoisted out to.
22 ;
3 ; RUN: as < %s | opt -gcse | dis
3 ; RUN: llvm-as < %s | opt -gcse | llvm-dis
44
55 int "test"(int %X, int %Y) {
66 %Z = add int %X, %Y
0 ; This testcase shows a bug where an common subexpression exists, but there
11 ; is no shared dominator block that the expression can be hoisted out to.
22 ;
3 ; RUN: as < %s | opt -load-vn -gcse | dis | not grep load
3 ; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep load
44
55 int %test(int* %P) {
66 store int 5, int* %P
0 ; Various test cases to ensure basic functionality is working for GCSE
11
2 ; RUN: as < %s | opt -gcse
2 ; RUN: llvm-as < %s | opt -gcse
33
44 implementation
55
None ; RUN: as < %s | opt -globaldce
0 ; RUN: llvm-as < %s | opt -globaldce
11 ;
22 implementation
33
None ; RUN: as < %s | opt -globaldce
0 ; RUN: llvm-as < %s | opt -globaldce
11 ;
22 %X = global void() * %func
33 implementation
0 ; Make sure that functions are removed successfully if they are referred to by
11 ; a global that is dead. Make sure any globals they refer to die as well.
22
3 ; RUN: as < %s | opt -globaldce | dis | not grep foo
3 ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep foo
44
55 %b = internal global int ()* %foo ;; Unused, kills %foo
66
0 ; This testcase tests that a worklist is being used, and that globals can be
11 ; removed if they are the subject of a constexpr and ConstantPointerRef
22
3 ; RUN: as < %s | opt -globaldce | dis | not grep global
3 ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
44
55 %t0 = internal global [4 x sbyte] c"foo\00"
66 %t1 = internal global [4 x sbyte] c"bar\00"
None ; RUN: as < %s | opt -globaldce
0 ; RUN: llvm-as < %s | opt -globaldce
11
22 %foo = internal global int 7 ;; Should die when function %foo is killed
33
0 ; distilled from 255.vortex
1 ; RUN: as < %s | opt -globaldce | dis | not grep testfunc
1 ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep testfunc
22
33 implementation
44
None ; RUN: as < %s | opt -globaldce | dis | not grep global
0 ; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
11
22 %X = uninitialized global int
33 %Y = internal global int 7
0 ; Induction variable pass is doing bad things with pointer induction vars,
11 ; trying to do arithmetic on them directly.
22 ;
3 ; RUN: as < %s | opt -indvars
3 ; RUN: llvm-as < %s | opt -indvars
44 ;
55 void %test(int %A, uint %S, sbyte* %S) {
66
0 ; This is a test case for the expression analysis code, not really indvars.
11 ; It was assuming any constant of int type was a ConstantInteger.
22 ;
3 ; RUN: as < %s | opt -indvars
3 ; RUN: llvm-as < %s | opt -indvars
44
55 %X = global int 7
66
None ; RUN: llvm-as < %s | opt -indvars | dis | grep indvar
0 ; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
11
22 int %test() {
33 br bool true, label %LoopHead, label %LoopHead
0 ; This test ensures that alloca instructions in the entry block for an inlined
11 ; function are moved to the top of the function they are inlined into.
22 ;
3 ; RUN: as < %s | opt -inline | dis | grep -C 1 alloca | grep Entry:
3 ; RUN: llvm-as < %s | opt -inline | llvm-dis | grep -C 1 alloca | grep Entry:
44
55 int %func(int %i) {
66 %X = alloca int
None ; RUN: as < %s | opt -inline -disable-output -print
0 ; RUN: llvm-as < %s | opt -inline -disable-output -print
11
22 int %func(int %i) {
33 ret int %i
0 ; This test ensures that inlining an "empty" function does not destroy the CFG
11 ;
2 ; RUN: as < %s | opt -inline | dis | not grep br
2 ; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep br
33
44 int %func(int %i) {
55 ret int %i
0 ; This checks to ensure that the inline pass deletes functions if they get
11 ; inlined into all of their callers.
22
3 ; RUN: as < %s | opt -inline | dis | not grep %reallysmall
3 ; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep %reallysmall
44
55 implementation
66
0 ; Test that we can inline a simple function, turning the calls in it into invoke
11 ; instructions
22
3 ; RUN: as < %s | opt -inline | dis | not grep 'call[^e]'
3 ; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep 'call[^e]'
44
55 declare void %might_throw()
66
0 ; Test that if an invoked function is inlined, and if that function cannot
11 ; throw, that the dead handler is now unreachable.
22
3 ; RUN: as < %s | opt -inline -simplifycfg | dis | not grep UnreachableExceptionHandler
3 ; RUN: llvm-as < %s | opt -inline -simplifycfg | llvm-dis | not grep UnreachableExceptionHandler
44
55 declare void %might_throw()
66
0 ; Test that any rethrown exceptions in an inlined function are automatically
11 ; turned into branches to the invoke destination.
22
3 ; RUN: as < %s | opt -inline | dis | not grep 'call void %llvm.unwind'
3 ; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep 'call void %llvm.unwind'
44
55 declare void %might_throw()
66 declare void %llvm.unwind()
0 ; This testcase causes instcombine to hang.
11 ;
2 ; RUN: as < %s | opt -instcombine
2 ; RUN: llvm-as < %s | opt -instcombine
33
44 implementation
55
0 ; Instcombine was missing a test that caused it to make illegal transformations
11 ; sometimes. In this case, it transforms the sub into an add:
22 ; RUN: echo foo
3 ; RUN: as < %s | opt -instcombine | dis | not grep add
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add
44 ;
55
66
33 ; stayed on the worklist, as soon as it came back up to be processed, bad things
44 ; happened, and opt asserted.
55 ;
6 ; RUN: as < %s | opt -instcombine
6 ; RUN: llvm-as < %s | opt -instcombine
77 ;
88
99 %.LC0 = internal global [21 x sbyte] c"hbMakeCodeLengths(1)\00" ; <[21 x sbyte]*> [#uses=1]
0 ; This testcase is incorrectly getting completely eliminated. There should be
11 ; SOME instruction named %c here, even if it's a bitwise and.
22 ;
3 ; RUN: as < %s | opt -instcombine -die | dis | grep '%c'
3 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep '%c'
44 ;
55 ulong %test3(ulong %A) {
66 %c1 = cast ulong %A to ubyte
None ; RUN: as < %s | opt -instcombine
0 ; RUN: llvm-as < %s | opt -instcombine
11
22 %bob = type { int }
33
None ; RUN: as < %s | opt -instcombine | dis | not grep add
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add
11
22 int %test(int %A) {
33 %A.neg = sub int 0, %A
None ; RUN: as < %s | opt -instcombine | dis | grep 4294967295
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 4294967295
11
22 ulong %test(ulong %Val) {
33 %tmp.3 = cast ulong %Val to uint ; [#uses=1]
None ; RUN: as < %s | opt -instcombine -disable-output
0 ; RUN: llvm-as < %s | opt -instcombine -disable-output
11
22 %X = global int 5
33 long %test() {
11 ; because it things that the constant value is a not expression... and
22 ; constantly inverts the branch back and forth.
33 ;
4 ; RUN: as < %s | opt -instcombine -disable-output
4 ; RUN: llvm-as < %s | opt -instcombine -disable-output
55
66 ubyte %test19(bool %c) {
77 br bool true, label %True, label %False
0 ; This is a bug in the VMcode library, not instcombine, it's just convenient
11 ; to expose it here.
22
3 ; RUN: as < %s | opt -instcombine -disable-output
3 ; RUN: llvm-as < %s | opt -instcombine -disable-output
44
55 %A = global int 1
66 %B = global int 2
99 ; should pass through the optimizer without failure.
1010 ;
1111 ; Extra code:
12 ; RUN: as < %s | opt -instcombine
12 ; RUN: llvm-as < %s | opt -instcombine
1313 ;
1414
1515 target endian = little
0 ; This testcase can be simplified by "realizing" that alloca can never return
11 ; null.
2 ; RUN: as < %s | opt -instcombine -simplifycfg | dis | not grep 'br '
2 ; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis | not grep 'br '
33
44 implementation ; Functions:
55
None ; RUN: as < %s | opt -instcombine | dis | grep load
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep load
11 void %test(int* %P) {
22 %X = volatile load int* %P ; Dead but not deletable!
33 ret void
0 ; This test makes sure that add instructions are properly eliminated.
11
2 ; RUN: as < %s | opt -instcombine -die | dis | grep -v OK | not grep add
2 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep -v OK | not grep add
33
44 implementation
55
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep and
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and
44
55 implementation
66
None ; RUN: as < %s | opt -instcombine -die | dis | grep call | not grep cast
0 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep call | not grep cast
11
22 implementation
33
22 ; slow. Might it be better to make there be an instcombine prepass before
33 ; level raise that takes care of the obvious stuff?
44
5 ; RUN: as < %s | opt -instcombine | dis | not grep cast
5 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep cast
66
77 bool %test1(int %X) {
88 %A = cast int %X to uint
0 ; Tests to make sure elimination of casts is working correctly
11
2 ; RUN: as < %s | opt -instcombine -die | dis | grep '%c' | not grep cast
2 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep '%c' | not grep cast
33
44 implementation
55
0 ; This test makes sure that div instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep div
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div
44
55 implementation
66
0 ; The %A getelementptr instruction should be eliminated here
11
2 ; RUN: as < %s | opt -instcombine -die | dis | grep getelementptr | not grep '%A '
2 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep getelementptr | not grep '%A '
33
44 %Global = constant [10 x sbyte] c"helloworld"
55
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep load
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load
44
55 %X = constant int 42
66 %Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 },
0 ; test that malloc's with a constant argument are promoted to array allocations
1 ; RUN: as < %s | opt -instcombine -die | dis | grep getelementptr
1 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep getelementptr
22
33 int* %test() {
44 %X = malloc int, uint 4
0 ; This test makes sure that mul instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep mul
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul
44
55 implementation
66
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine -die | dis | not grep xor
3 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | not grep xor
44
55 implementation
66
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | grep -v xor | not grep 'or '
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v xor | not grep 'or '
44
55 implementation
66
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine -die | dis | not grep phi
3 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | not grep phi
44
55 implementation
66
11 ;
22 ; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html
33
4 ; RUN: as < %s | opt -instcombine | dis | not grep 'call double %pow'
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'call double %pow'
55
66 declare double %pow(double, double)
77
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep rem
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem
44
55 implementation
66
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep set
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep set
44
55 %X = uninitialized global int
66
22 ; into equivalent setne,eq instructions.
33 ;
44
5 ; RUN: as < %s | opt -instcombine | dis | grep -v seteq | grep -v setne | not grep set
5 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v seteq | grep -v setne | not grep set
66
77 bool %test1(uint %A) {
88 %B = setge uint %A, 1 ; setne %A, 0
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep sh
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sh
44
55 implementation
66
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine -die | dis | grep sub | not grep -v 'sub int %Cok, %Bok'
3 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep sub | not grep -v 'sub int %Cok, %Bok'
44
55 implementation
66
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22
3 ; RUN: as < %s | opt -instcombine | dis | not grep 'xor '
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'xor '
44
55 implementation
66
None ; RUN: as < %s | opt -basicaa -licm -disable-output
0 ; RUN: llvm-as < %s | opt -basicaa -licm -disable-output
11
22 ;%MoveArray = external global [64 x ulong]
33
0 ; Exit blocks need to be updated for all nested loops...
11
2 ; RUN: as < %s | opt -preheaders
2 ; RUN: llvm-as < %s | opt -preheaders
33
44 implementation ; Functions:
55
0 ; This testcase fails because preheader insertion is not updating exit node
11 ; information for loops.
22
3 ; RUN: as < %s | opt -licm
3 ; RUN: llvm-as < %s | opt -licm
44
55 int %main(int %argc, sbyte** %argv) {
66 bb0: ; No predecessors!
22 ; happens because preheader insertion doesn't insert a preheader for this
33 ; case... bad.
44
5 ; RUN: as < %s | opt -licm -adce -simplifycfg | dis | not grep 'br '
5 ; RUN: llvm-as < %s | opt -licm -adce -simplifycfg | llvm-dis | not grep 'br '
66
77 int %main(int %argc) {
88 br label %bb5
0 ; LICM is adding stores before phi nodes. bad.
11
2 ; RUN: as < %s | opt -licm
2 ; RUN: llvm-as < %s | opt -licm
33
44 bool %test(bool %c) {
55 br bool %c, label %Loop, label %Out
0 ; Test that hoisting is disabled for pointers of different types...
11 ;
2 ; RUN: as < %s | opt -licm
2 ; RUN: llvm-as < %s | opt -licm
33
44 void %test(int* %P) {
55 br label %Loop
22 ; loaded from. Basically if the load gets hoisted, the subtract gets turned
33 ; into a constant zero.
44 ;
5 ; RUN: as < %s | opt -licm -load-vn -gcse -instcombine | dis | grep load
5 ; RUN: llvm-as < %s | opt -licm -load-vn -gcse -instcombine | llvm-dis | grep load
66
77 %X = global int 7
88 declare void %foo()
0 ; This testcase tests for a problem where LICM hoists
11 ; potentially trapping instructions when they are not guaranteed to execute.
22 ;
3 ; RUN: as < %s | opt -licm | dis | grep -C 2 "IfUnEqual" | grep div
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C 2 "IfUnEqual" | grep div
44
55 %X = global int 0
66 declare void %foo()
0 ; This testcase tests to make sure a trapping instruction is hoisted when
11 ; it is guaranteed to execute.
22 ;
3 ; RUN: as < %s | opt -licm | dis | grep -C 2 "test" | grep div
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C 2 "test" | grep div
44
55 %X = global int 0
66 declare void %foo()
None ; RUN: as < %s | opt -licm | dis
0 ; RUN: llvm-as < %s | opt -licm | llvm-dis
11
22 void "testfunc"(int %i) {
33
0 ; Test that LICM works when there is not a loop-preheader
1 ; RUN: as < %s | opt -licm | dis
1 ; RUN: llvm-as < %s | opt -licm | llvm-dis
22
33 void "testfunc"(int %i, bool %ifcond) {
44 br bool %ifcond, label %Then, label %Else
None ; RUN: as < %s | opt -licm -stats 2>&1 | grep "memory locations promoted to register"
0 ; RUN: llvm-as < %s | opt -licm -stats 2>&1 | grep "memory locations promoted to register"
11
22 %X = global int 7
33
1616 ; The fix is to have the -raise pass correctly convert it to the second
1717 ; equivelent form.
1818 ;
19 ; RUN: as < %s | opt -q -raise > Output/%s.raised.bc
19 ; RUN: llvm-as < %s | opt -q -raise > Output/%s.raised.bc
2020 ; RUN: lli -force-interpreter -array-checks -abort-on-exception < Output/%s.raised.bc
2121 ;
2222
0 ; An invalid assertion killed the level raiser. Fixed.
11 ;
2 ; RUN: as < %s | opt -raise
2 ; RUN: llvm-as < %s | opt -raise
33
44 implementation
55
11 ; method pointer type into a call. In doing so, it would have to change the
22 ; types of the arguments to the call, but broke doing so.
33 ;
4 ; RUN: as < %s | opt -raise
4 ; RUN: llvm-as < %s | opt -raise
55
66 implementation
77
11 ; Note that this code is actually miscompiled from the input source, but despite
22 ; that, level raise should not hang!
33 ;
4 ; RUN: as < %s | opt -raise
4 ; RUN: llvm-as < %s | opt -raise
55
66 %Disjunct = type { \2 *, short, sbyte, sbyte *, { short, short, sbyte, sbyte, \2, sbyte * } *, { short, short, sbyte, sbyte, \2, sbyte * } * }
77 %chosen_disjuncts = uninitialized global %Disjunct * * ; <%Disjunct * * *> [#uses=1]
11 ; getelementptr instruction... with a bad level raise pass, this code
22 ; will segfault on execution.
33 ;
4 ; RUN: as < %s | opt -raise |lli -abort-on-exception
4 ; RUN: llvm-as < %s | opt -raise |lli -abort-on-exception
55
66 %Village = type { [4 x \3 *], \2 *, { \2 *, { int, int, int, \5 * } *, \2 * }, { int, int, int, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int,
77 int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * } }, int, int }
0 ; Level raise is making an incorrect transformation, which causes incorrect
11 ; bytecode to be generated.
22 ;
3 ; RUN: as < %s | opt -raise | dis
3 ; RUN: llvm-as < %s | opt -raise | llvm-dis
44 ;
55
66 %Village = type { [4 x \3 *], \2 *, { \2 *, { int, int, int, \5 * } *, \2 * }, { int, int, int, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * } }, int, int }
11 ; successful, all cast instructions should be eliminated from this testcase.
22 ;
33
4 ; RUN: as < %s | opt -raise | dis | not grep cast
4 ; RUN: llvm-as < %s | opt -raise | llvm-dis | not grep cast
55
66 %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
77 %hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
22 ; prevented reg115 from being able to change.
33 ;
44
5 ; RUN: as < %s | opt -raise | dis | grep '= cast' | not grep \*
5 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep '= cast' | not grep \*
66
77 %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
88 %HashEntry = type { uint, sbyte *, \2 } *
None ; RUN: as < %s | opt -raise | dis | grep '= cast' | not grep \*
0 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep '= cast' | not grep \*
11
22 %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
33 %HashEntry = type { uint, sbyte *, \2 } *
77 ; x[j*i-12] = j;
88 ; }
99
10 ; RUN: as < %s | opt -raise | dis | grep ' cast ' | not grep '*'
10 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep ' cast ' | not grep '*'
1111
1212 implementation
1313
44 ; return (int*)malloc(i+j);
55 ; }
66
7 ; RUN: as < %s | opt -raise | dis | grep ' cast ' | not grep '*'
7 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep ' cast ' | not grep '*'
88
99 implementation
1010
22 ; to a 32 bit version of the number with all upper 16 bits clear (ushort->uint
33 ; involves no sign extension). Optimizing this to a single cast is invalid!
44 ;
5 ; RUN: as < %s | opt -raise -q | lli -abort-on-exception
5 ; RUN: llvm-as < %s | opt -raise -q | lli -abort-on-exception
66 ;
77 implementation
88
0 ; This testcase is not level raised properly...
11 ;
2 ; RUN: as < %s | opt -raise | dis | grep ' cast ' | not grep '*'
2 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep ' cast ' | not grep '*'
33
44 %List = type { int, %List* }
55
0 ; This testcase should have the cast propogated through the load
11 ; just like a store does...
22 ;
3 ; RUN: as < %s | opt -raise | dis | grep ' cast ' | not grep '*'
3 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep ' cast ' | not grep '*'
44
55 int "test"(uint * %Ptr) {
66 %P2 = cast uint *%Ptr to int *
None ; RUN: as < %s | opt -raise | dis | grep '= cast' | not grep \*
0 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep '= cast' | not grep \*
11
22 %FILE = type { int, ubyte*, ubyte*, ubyte, ubyte, uint, uint, uint }
33
44 ; This could be fixed by making all stores add themselves to a list, and check
55 ; their arguments are consistent AFTER all other values are propogated.
66
7 ; RUN: as < %s | opt -raise | dis | not grep '= cast'
7 ; RUN: llvm-as < %s | opt -raise | llvm-dis | not grep '= cast'
88
99 %Tree = type %struct.tree*
1010 %struct.tree = type { int, double, double, %Tree, %Tree, %Tree, %Tree }
None ; RUN: as < %s | opt -raise
0 ; RUN: llvm-as < %s | opt -raise
11
22 %Tree = type %struct.tree*
33 %struct.tree = type { int, double, double, %Tree, %Tree, %Tree, %Tree }
0 ; This crashes raise, with an cast<> failure
11
2 ; RUN: as < %s | opt -raise
2 ; RUN: llvm-as < %s | opt -raise
33
44 implementation
55 sbyte* %test(int* %ptr) {
11 ; because both the source and the destination of the %Y cast are converted
22 ; to a new type, which causes massive problems.
33
4 ; RUN: as < %s | opt -raise -raise-start-inst=W
4 ; RUN: llvm-as < %s | opt -raise -raise-start-inst=W
55
66 int **%test(sbyte **%S) {
77 BB0:
0 ; Looks like we don't raise alloca's like we do mallocs
11 ;
2 ; RUN: as < %s | opt -raise | dis | grep '= cast' | not grep \*
2 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep '= cast' | not grep \*
33
44 implementation ; Functions:
55
None ; RUN: as < %s | opt -raise -raise-start-inst=cast271
0 ; RUN: llvm-as < %s | opt -raise -raise-start-inst=cast271
11
22 %CON_list = type { %CON_list*, %CON_node* }
33 %CON_node = type { %DIS_list*, %DIS_list*, int }
None ; RUN: as < %s | opt -raise
0 ; RUN: llvm-as < %s | opt -raise
11
22 int* %test(int* %P, int* %Q) {
33 %P = cast int* %P to ulong
None ; RUN: as < %s | opt -raise | dis | grep -v uint | not grep 4294967295
0 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep -v uint | not grep 4294967295
11
22 %length_code = uninitialized global [256 x ubyte]
33
None ; RUN: as < %s | opt -raise | dis | grep call | not grep '\.\.\.'
0 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep call | not grep '\.\.\.'
11
22 implementation
33
0 ; Due to a recent change, this testcase now sends the raise pass into an infinite loop
11 ;
2 ; RUN: as < %s | opt -raise
2 ; RUN: llvm-as < %s | opt -raise
33
44 implementation
55
0 ; This testcase should be able to eliminate at least one of the casts.
11 ;
2 ; RUN: as < %s | opt -raise | dis | not grep 'REMOVE'
2 ; RUN: llvm-as < %s | opt -raise | llvm-dis | not grep 'REMOVE'
33
44 int %foo(sbyte * %PF) {
55 %UPF = cast sbyte* %PF to uint()*
0 ; Testcase reduced from 197.parser by bugpoint
1 ; RUN: as < %s | opt -raise -raise-start-inst=cast455 > /dev/null
1 ; RUN: llvm-as < %s | opt -raise -raise-start-inst=cast455 > /dev/null
22
33 void %conjunction_prune() {
44 ;
None ; RUN: as < %s | opt -raise -debug -raise-start-inst=cast459
0 ; RUN: llvm-as < %s | opt -raise -debug -raise-start-inst=cast459
11
22 int %deflateInit2_({ ubyte*, uint, ulong, ubyte*, uint, ulong, sbyte*, { \4, int, ubyte*, ulong, ubyte*, int, int, ubyte, ubyte, int, uint, uint, uint, ubyte*, ulong, ushort*, ushort*, uint, uint, uint, uint, uint, long, uint, uint, int, uint, uint, uint, uint, uint, uint, int, int, uint, int, [573 x { { ushort }, { ushort } }], [61 x { { ushort }, { ushort } }], [39 x { { ushort }, { ushort } }], { { { ushort }, { ushort } }*, int, { int }* }, { { { ushort }, { ushort } }*, int, { int }* }, { { { ushort }, { ushort } }*, int, { int }* }, [16 x ushort], [573 x int], int, int, [573 x ubyte], ubyte*, uint, uint, ushort*, ulong, ulong, uint, int, ushort, int }*, sbyte* (sbyte*, uint, uint)*, void (sbyte*, sbyte*)*, sbyte*, int, ulong, ulong }* %strm, int %level, int %method, int %windowBits, int %memLevel, int %strategy, sbyte* %version, int %stream_size) {
33 bb0: ; No predecessors!
None ; RUN: as < %s | opt -raise
0 ; RUN: llvm-as < %s | opt -raise
11
22 declare void %foo()
33
None ; RUN: as < %s | opt -raise | dis | not grep cast
0 ; RUN: llvm-as < %s | opt -raise | llvm-dis | not grep cast
11
22 void %test(...) { ret void }
33
None ; RUN: as < %s | opt -raise -disable-output
0 ; RUN: llvm-as < %s | opt -raise -disable-output
11
22 %T = type { [0 x ubyte] }
33
0 ; The expr analysis routines were being too aggressive across cast instructions!
11
2 ; RUN: as < %s | opt -raise | dis | not grep 4294967295
2 ; RUN: llvm-as < %s | opt -raise | llvm-dis | not grep 4294967295
33
44 target endian = big
55 target pointersize = 64
0 ; This testcase exposed a problem with the loop identification pass (LoopInfo).
11 ; Basically, it was incorrectly calculating the loop nesting information.
22 ;
3 ; RUN: as < %s | opt -preheaders
3 ; RUN: llvm-as < %s | opt -preheaders
44
55 implementation ; Functions:
66
11 ; inserted for the "fail" loop, but the exit block of a loop is not updated
22 ; to be the preheader instead of the exit loop itself.
33
4 ; RUN: as < %s | opt -preheaders
4 ; RUN: llvm-as < %s | opt -preheaders
55
66 int %re_match_2() {
77 br label %loopentry.1
None ; RUN: as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output
0 ; RUN: llvm-as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output
11
22 target endian = little
33 target pointersize = 32
None ; RUN: as < %s | opt -preheaders
0 ; RUN: llvm-as < %s | opt -preheaders
11
22 implementation
33
None ; RUN: as < %s | opt -preheaders
0 ; RUN: llvm-as < %s | opt -preheaders
11
22 void %foo(bool %C) {
33 br bool %C, label %T, label %F
0 ; This testcase exposed a problem with the loop identification pass (LoopInfo).
11 ; Basically, it was incorrectly calculating the loop nesting information.
22 ;
3 ; RUN: as < %s | opt -preheaders
3 ; RUN: llvm-as < %s | opt -preheaders
44
55 implementation ; Functions:
66
11 ; inserted for the "fail" loop, but the exit block of a loop is not updated
22 ; to be the preheader instead of the exit loop itself.
33
4 ; RUN: as < %s | opt -preheaders
4 ; RUN: llvm-as < %s | opt -preheaders
55
66 int %re_match_2() {
77 br label %loopentry.1
None ; RUN: as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output
0 ; RUN: llvm-as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output
11
22 target endian = little
33 target pointersize = 32
None ; RUN: as < %s | opt -preheaders
0 ; RUN: llvm-as < %s | opt -preheaders
11
22 implementation
33
None ; RUN: as < %s | opt -preheaders
0 ; RUN: llvm-as < %s | opt -preheaders
11
22 void %foo(bool %C) {
33 br bool %C, label %T, label %F
None ; RUN: as < %s | opt -lowersetjmp | dis | grep invoke
0 ; RUN: llvm-as < %s | opt -lowersetjmp | llvm-dis | grep invoke
11
22 %JmpBuf = type int
33 %.str_1 = internal constant [13 x sbyte] c"returned %d\0A\00"
None ; RUN: as < %s | opt -lowerswitch
0 ; RUN: llvm-as < %s | opt -lowerswitch
11
22 void %child(int %ct.1) {
33 entry: ; No predecessors!
None ; RUN: as < %s | opt -lowerswitch
0 ; RUN: llvm-as < %s | opt -lowerswitch
11
22 void %test() {
33 switch uint 0, label %Next []
0 ; Uninitialized values are not handled correctly.
11 ;
2 ; RUN: as < %s | opt -mem2reg
2 ; RUN: llvm-as < %s | opt -mem2reg
33 ;
44
55 implementation
0 ; This input caused the mem2reg pass to die because it was trying to promote
11 ; the %r alloca, even though it is invalid to do so in this case!
22 ;
3 ; RUN: as < %s | opt -mem2reg
3 ; RUN: llvm-as < %s | opt -mem2reg
44
55
66 implementation
None ; RUN: as < %s | opt -mem2reg
0 ; RUN: llvm-as < %s | opt -mem2reg
11
22 implementation ; Functions:
33
0 ; This testcases makes sure that mem2reg can handle unreachable blocks.
1 ; RUN: as < %s | opt -mem2reg
1 ; RUN: llvm-as < %s | opt -mem2reg
22
33 int %test() {
44 %X = alloca int
0 ; Mem2reg used to only add one incoming value to a PHI node, even if it had
11 ; multiple incoming edges from a block.
22 ;
3 ; RUN: as < %s | opt -mem2reg -disable-output
3 ; RUN: llvm-as < %s | opt -mem2reg -disable-output
44
55 int %test(bool %c1, bool %c2) {
66 %X = alloca int
0 ; Promoting some values allows promotion of other values.
1 ; RUN: as < %s | opt -mem2reg | dis | not grep alloca
1 ; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca
22
33 int %test2() {
44 %result = alloca int ; ty=int*
11 ; generated code should perform the appropriate masking operations required
22 ; depending on the endianness of the target...
33
4 ; RUN: as < %s | opt -mem2reg | dis | not grep 'alloca'
4 ; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep 'alloca'
55
66 implementation
77
0 ; Simple sanity check testcase. Both alloca's should be eliminated.
1 ; RUN: as < %s | opt -mem2reg | dis | not grep 'alloca'
1 ; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep 'alloca'
22
33 implementation
44
0 ; Basic testcases - these are only tested by inspection, but illustrate the
11 ; basic cases PRE can handle.
22 ;
3 ; RUN: as < %s | opt -pre -disable-output
3 ; RUN: llvm-as < %s | opt -pre -disable-output
44
55 declare void %use(int)
66 declare int %get()
None ; RUN: as < %s | opt -pinodes -instcombine -die | dis | not grep add
0 ; RUN: llvm-as < %s | opt -pinodes -instcombine -die | llvm-dis | not grep add
11
22 int "test"(int %i, int %j) {
33 %c = seteq int %i, 0
None ; RUN: as < %s | opt -paths
0 ; RUN: llvm-as < %s | opt -paths
11 ;
22 %globalCrc = uninitialized global uint ; [#uses=1]
33
None ; RUN: as < %s | opt -prune-eh | dis | not grep invoke
0 ; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep invoke
11
22 implementation
33
None ; RUN: as < %s | opt -prune-eh | dis | not grep invoke
0 ; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep invoke
11
22 implementation
33
None ; RUN: as < %s | opt -reassociate -instcombine -constprop -dce | dis | not grep add
0 ; RUN: llvm-as < %s | opt -reassociate -instcombine -constprop -dce | llvm-dis | not grep add
11
22 int %test(int %A) {
33 %X = add int %A, 1
None ; RUN: as < %s | opt -reassociate -instcombine -constprop -die | dis | not grep 5
0 ; RUN: llvm-as < %s | opt -reassociate -instcombine -constprop -die | llvm-dis | not grep 5
11
22 int %test(int %A, int %B) {
33 %W = add int %B, -5
0 ; With sub reassociation, constant folding can eliminate all of the constants.
11 ;
2 ; RUN: as < %s | opt -reassociate -constprop -instcombine -dce | dis | not grep add
2 ; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -dce | llvm-dis | not grep add
33
44 int %test(int %A, int %B) {
55 %W = add int 5, %B
0 ; With sub reassociation, constant folding can eliminate the two 12 constants.
11 ;
2 ; RUN: as < %s | opt -reassociate -constprop -dce | dis | not grep 12
2 ; RUN: llvm-as < %s | opt -reassociate -constprop -dce | llvm-dis | not grep 12
33
44 int "test"(int %A, int %B, int %C, int %D) {
55 %M = add int %A, 12
0 ; The reassociate pass is not preserving dominance properties correctly
11 ;
2 ; RUN: as < %s | opt -reassociate
2 ; RUN: llvm-as < %s | opt -reassociate
33
44 int %compute_dist(int %i, int %j) {
55 %reg119 = sub int %j, %i
None ; RUN: as < %s | opt -reassociate -disable-output
0 ; RUN: llvm-as < %s | opt -reassociate -disable-output
11
22 implementation ; Functions:
33
0 ; With reassociation, constant folding can eliminate the 12 and -12 constants.
11 ;
2 ; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep add
2 ; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep add
33
44 int %test(int %arg) {
55 %tmp1 = sub int -12, %arg
0 ; With reassociation, constant folding can eliminate the +/- 30 constants.
11 ;
2 ; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 30
2 ; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 30
33
44 int "test"(int %reg109, int %reg1111) {
55 %reg115 = add int %reg109, -30 ; [#uses=1]
1111 ; In this case, we want to reassociate the specified expr so that i+j can be
1212 ; hoisted out of the inner most loop.
1313 ;
14 ; RUN: as < %s | opt -reassociate | dis | grep 115 | not grep 117
14 ; RUN: llvm-as < %s | opt -reassociate | llvm-dis | grep 115 | not grep 117
1515
1616 %.LC0 = internal global [4 x sbyte] c"%d\0A\00" ; <[4 x sbyte]*> [#uses=1]
1717
0 ; Reassociation should apply to Add, Mul, And, Or, & Xor
11 ;
2 ; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 12
2 ; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12
33
44 int "test_mul"(int %arg) {
55 %tmp1 = mul int 12, %arg
0 ; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
11 ;
2 ; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 12
2 ; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12
33
44 int "test"(int %A, int %B) {
55 %X = add int -12, %A
44 ; real benchmark (mst from Olden benchmark, MakeGraph function). When SCCP is
55 ; fixed, this should be eliminated by a single SCCP application.
66 ;
7 ; RUN: as < %s | opt -sccp | dis | not grep loop
7 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep loop
88
99 int* %test() {
1010 bb1:
None ; RUN: as < %s | opt -sccp | dis | not grep sub
0 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep sub
11
22 void %test3(int, int) {
33 add int 0, 0
0 ; This test shows a case where SCCP is incorrectly eliminating the PHI node
11 ; because it thinks it has a constant 0 value, when it really doesn't.
22
3 ; RUN: as < %s | opt -sccp | dis | grep phi
3 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi
44
55 int "test"(int %A, bool %c) {
66 bb1:
11 ; this is in fact NOT the case, so the return should still be alive in the code
22 ; after sccp and CFG simplification have been performed.
33 ;
4 ; RUN: as < %s | opt -sccp -simplifycfg | dis | grep ret
4 ; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | grep ret
55
66
77 void "old_main"() {
None ; RUN: as < %s | opt -sccp | dis | not grep '%X'
0 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep '%X'
11
22 %G = uninitialized global [40x int]
33
None ; RUN: as < %s | opt -sccp -simplifycfg | dis | not grep then:
0 ; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | not grep then:
11
22 void %cprop_test11(int* %data.1) {
33 entry: ; No predecessors!
0 ; The PHI cannot be eliminated from this testcase, SCCP is mishandling invoke's!
1 ; RUN: as < %s | opt -sccp | dis | grep phi
1 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi
22
33 declare void %foo()
44 int %test(bool %cond) {
0 ; This is a basic sanity check for constant propogation. The add instruction
11 ; should be eliminated.
22
3 ; RUN: as < %s | opt -sccp | dis | not grep add
3 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add
44
55 int %test(bool %B) {
66 br bool %B, label %BB1, label %BB2
0 ; This is the test case taken from appel's book that illustrates a hard case
11 ; that SCCP gets right. BB3 should be completely eliminated.
22 ;
3 ; RUN: as < %s | opt -sccp -constprop -dce -cfgsimplify | dis | not grep BB3
3 ; RUN: llvm-as < %s | opt -sccp -constprop -dce -cfgsimplify | llvm-dis | not grep BB3
44
55 int %test function(int %i0, int %j0) {
66 BB1:
None ; RUN: as < %s | opt -scalarrepl | dis | grep alloca | grep '4 x'
0 ; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep alloca | grep '4 x'
11
22 ; Test that an array is not incorrectly deconstructed...
33
None ; RUN: as < %s | opt -scalarrepl
0 ; RUN: llvm-as < %s | opt -scalarrepl
11
22 void %main() {
33 %E = alloca { { int, float, double, long }, { int, float, double, long } } ; <{ { int, float, double, long }, { int, float, double, long } }*> [#uses=1]
None ; RUN: as < %s | opt -scalarrepl
0 ; RUN: llvm-as < %s | opt -scalarrepl
11
22 int %test() {
33 %X = alloca { [ 4 x int] }
None ; RUN: as < %s | opt -scalarrepl -mem2reg | dis | not grep alloca
0 ; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | not grep alloca
11
22 int %test() {
33 %X = alloca [ 4 x int ]
None ; RUN: as < %s | opt -scalarrepl -mem2reg | dis | grep alloca
0 ; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | grep alloca
11
22 int %test() {
33 %X = alloca [ 4 x int ]
None ; RUN: as < %s | opt -scalarrepl -mem2reg | dis | not grep alloca
0 ; RUN: llvm-as < %s | opt -scalarrepl -mem2reg | llvm-dis | not grep alloca
11
22 int %test() {
33 %X = alloca { int, float }
0 ; Basic block #2 should not be merged into BB #3!
11 ;
2 ; RUN: as < %s | opt -simplifycfg | dis | grep 'br label'
2 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep 'br label'
33 ;
44 void "cprop_test12"(int* %data) {
55 bb0:
33 ;
44 ; Which is not valid SSA
55 ;
6 ; RUN: as < %s | opt -simplifycfg | dis
6 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis
77
88 void "test"() {
99 br bool true, label %end, label %Loop
0 ; -simplifycfg is not folding blocks if there is a PHI node involved. This
11 ; should be fixed eventually
22
3 ; RUN: as < %s | opt -simplifycfg | dis | not grep br
3 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
44
55 int %main(int %argc) {
66 br label %InlinedFunctionReturnNode
None ; RUN: as < %s | opt -simplifycfg
0 ; RUN: llvm-as < %s | opt -simplifycfg
11
22 int %test(int %A, int %B, bool %cond) {
33 J:
None ; RUN: as < %s | opt -simplifycfg -disable-output
0 ; RUN: llvm-as < %s | opt -simplifycfg -disable-output
11
22 implementation ; Functions:
33
0 ; Do not remove the invoke!
11 ;
2 ; RUN: as < %s | opt -simplifycfg -disable-output
2 ; RUN: llvm-as < %s | opt -simplifycfg -disable-output
33
44 int %test() {
55 %A = invoke int %test() to label %Ret except label %Ret
0 ; Do not remove the invoke!
11 ;
2 ; RUN: as < %s | opt -simplifycfg | dis | grep invoke
2 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep invoke
33
44 int %test() {
55 invoke int %test() to label %Ret except label %Ret
0 ; This test checks to make sure that 'br X, Dest, Dest' is folded into
11 ; 'br Dest'
22
3 ; RUN: as < %s | opt -simplifycfg | dis | not grep 'br bool %c2'
3 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'br bool %c2'
44
55 declare void %noop()
66
22 ; due to the fact that the SimplifyCFG function does not use
33 ; the ConstantFoldTerminator function.
44
5 ; RUN: as < %s | opt -simplifycfg | dis | not grep 'br bool %c2'
5 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'br bool %c2'
66
77 declare void %noop()
88
None ; RUN: as < %s | opt -simplifycfg | dis | not grep switch
0 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep switch
11
22 int %test1() { ; Test normal folding
33 switch uint 5, label %Default [
0 ; Test merging of blocks with phi nodes.
11 ;
2 ; RUN: as < %s | opt -simplifycfg | dis | not grep 'N:'
2 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'N:'
33 ;
44
55 int %test(bool %a) {
22
33 ; If this test is successful, the function should be reduced to 'call; ret'
44
5 ; RUN: as < %s | opt -simplifycfg | dis | not egrep 'invoke|br'
5 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not egrep 'invoke|br'
66
77 declare void %bar()
88 declare void %llvm.unwind()
0 ; Test merging of blocks that only have PHI nodes in them
11 ;
2 ; RUN: as < %s | opt -simplifycfg | dis | not grep 'N:'
2 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'N:'
33 ;
44
55 int %test(bool %a, bool %b) {
11 ; where the mergedinto block doesn't have any PHI nodes, and is in fact
22 ; dominated by the block-to-be-eliminated
33 ;
4 ; RUN: as < %s | opt -simplifycfg | dis | not grep 'N:'
4 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'N:'
55 ;
66
77 int %test(bool %a, bool %b) {
0 ; Test CFG simplify removal of branch instructions...
11 ;
2 ; RUN: as < %s | opt -simplifycfg | dis | not grep br
2 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
33
44
55 void "test1"() {
0 ; This test ensures that the simplifycfg pass continues to constant fold
11 ; terminator instructions.
22
3 ; RUN: as < %s | opt -simplifycfg | not grep br
3 ; RUN: llvm-as < %s | opt -simplifycfg | not grep br
44
55 int %test(int %A, int %B) {
66 J:
None ; RUN: as < %s | opt -tailduplicate -disable-output
0 ; RUN: llvm-as < %s | opt -tailduplicate -disable-output
11
22 void %motion_result7() {
33 entry:
None ; RUN: as < %s | opt -tailduplicate -disable-output
0 ; RUN: llvm-as < %s | opt -tailduplicate -disable-output
11
22 implementation
33
None ; RUN: as < %s | opt -tailduplicate -disable-output
0 ; RUN: llvm-as < %s | opt -tailduplicate -disable-output
11
22 implementation
33
0 ; This test checks to make sure phi nodes are updated properly
11 ;
2 ; RUN: as < %s | opt -tailduplicate -disable-output
2 ; RUN: llvm-as < %s | opt -tailduplicate -disable-output
33
44
55
None ; RUN: as < %s | opt -tailduplicate -disable-output
0 ; RUN: llvm-as < %s | opt -tailduplicate -disable-output
11
22 declare void %__main()
33