Mercurial > hg > CbC > CbC_llvm
comparison test/Transforms/MergeFunc/phi-speculation1.ll @ 0:95c75e76d11b LLVM3.4
LLVM 3.4
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 12 Dec 2013 13:56:28 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:95c75e76d11b |
---|---|
1 ; REQUIRES: asserts | |
2 ; RUN: opt < %s -mergefunc -stats -disable-output 2>&1 | not grep "functions merged" | |
3 | |
4 define i32 @foo1(i32 %x) { | |
5 entry: | |
6 %A = add i32 %x, 1 | |
7 %B = call i32 @foo1(i32 %A) | |
8 br label %loop | |
9 loop: | |
10 %C = phi i32 [%B, %entry], [%D, %loop] | |
11 %D = add i32 %x, 2 | |
12 %E = icmp ugt i32 %D, 10000 | |
13 br i1 %E, label %loopexit, label %loop | |
14 loopexit: | |
15 ret i32 %D | |
16 } | |
17 | |
18 define i32 @foo2(i32 %x) { | |
19 entry: | |
20 %0 = add i32 %x, 1 | |
21 %1 = call i32 @foo2(i32 %0) | |
22 br label %loop | |
23 loop: | |
24 %2 = phi i32 [%1, %entry], [%3, %loop] | |
25 %3 = add i32 %2, 2 | |
26 %4 = icmp ugt i32 %3, 10000 | |
27 br i1 %4, label %loopexit, label %loop | |
28 loopexit: | |
29 ret i32 %3 | |
30 } |