llvm.org GIT mirror llvm / 65a88e8
New testcases to test LICM of call instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12414 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
2 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | grep -C1 sin | grep Out:
1 declare double %sin(double)
2 declare void %foo()
3
4 double %test(double %X) {
5 br label %Loop
6
7 Loop:
8 call void %foo() ;; Unknown effects!
9
10 %A = call double %sin(double %X) ;; Can still hoist/sink call
11 br bool true, label %Loop, label %Out
12
13 Out:
14 ret double %A
15 }
0 ; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | grep -C1 strlen | grep Out:
1 declare int %strlen(sbyte*)
2 declare void %foo()
3
4 int %test(sbyte* %P) {
5 br label %Loop
6
7 Loop:
8 %A = call int %strlen(sbyte* %P) ;; Can hoist/sink call
9 br bool false, label %Loop, label %Out
10
11 Out:
12 ret int %A
13 }