llvm.org GIT mirror llvm / cc455de
Use the new prcontext script. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15427 91177308-0d34-0410-b5e6-96231b3b80d8 John Criswell 15 years ago
16 changed file(s) with 16 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llvm-as < %s | opt -constmerge | llvm-dis | grep -C2 foo | grep bar
0 ; RUN: llvm-as < %s | opt -constmerge | llvm-dis | %prcontext foo 2 | grep bar
11
22 %foo = constant int 6
33 %bar = constant int 6
None ; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep -C1 Loop: | grep %indvar
0 ; RUN: llvm-as < %s | opt -indvars | llvm-dis | %prcontext Loop: 1 | grep %indvar
11
22 ; The indvar simplification code should ensure that the first PHI in the block
33 ; is the canonical one!
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: llvm-as < %s | opt -inline | llvm-dis | grep -C1 alloca | grep Entry:
3 ; RUN: llvm-as < %s | opt -inline | llvm-dis | %prcontext alloca 1 | grep Entry:
44
55 int %func(int %i) {
66 %X = alloca int
0 ; This testcase tests for a problem where LICM hoists
11 ; potentially trapping instructions when they are not guaranteed to execute.
22 ;
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C2 "IfUnEqual" | grep div
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext "IfUnEqual" 2 | 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: llvm-as < %s | opt -licm | llvm-dis | grep -C2 "test" | grep div
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext "test" 2 | grep div
44
55 %X = global int 0
66 declare void %foo(int)
None ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 volatile | grep Loop
0 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext volatile 1 | grep Loop
11
22 %X = global int 7
33
None ; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | grep -C1 sin | grep Out:
0 ; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext sin 1 | grep Out:
11 declare double %sin(double)
22 declare void %foo()
33
None ; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | grep -C1 strlen | grep Out:
0 ; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext strlen 1 | grep Out:
11 declare int %strlen(sbyte*)
22 declare void %foo()
33
0 ; This testcase checks to make sure the sinker does not cause problems with
11 ; critical edges.
22
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 add | grep Exit
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext add 1 | grep Exit
44
55 implementation ; Functions:
66
11 ; the instruction to the exit blocks instead of executing it on every
22 ; iteration of the loop.
33 ;
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 mul | grep Out:
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext mul 1 | grep Out:
55
66 int %test(int %N) {
77 Entry:
11 ; result of the load is only used outside of the loop, sink the load instead of
22 ; hoisting it!
33 ;
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 load | grep Out:
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext load 1 | grep Out:
55
66 %X = global int 5
77
22 ; instructions from the loop. Instead they got hoisted, which is better than
33 ; leaving them in the loop, but increases register pressure pointlessly.
44
5 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 getelementptr | grep Out:
5 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext getelementptr 1 | grep Out:
66
77 %Ty = type { int, int }
88 %X = external global %Ty
0 ; This testcase ensures that we can sink instructions from loops with
11 ; multiple exits.
22 ;
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 mul | grep 'Out[12]:'
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext mul 1 | grep 'Out[12]:'
44
55 int %test(int %N, bool %C) {
66 Entry:
11 ; some exits out of the loop, and that we can do so without breaking dominator
22 ; info.
33 ;
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 add | grep exit2:
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext add 1 | grep exit2:
55
66 implementation ; Functions:
77
None ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 add | grep preheader.loopexit:
0 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext add 1 | grep preheader.loopexit:
11
22 implementation
33
0 ; Potentially trapping instructions may be sunk as long as they are guaranteed
11 ; to be executed.
22 ;
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 div | grep Out:
3 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext div 1 | grep Out:
44
55 int %test(int %N) {
66 Entry: