summaryrefslogtreecommitdiffstats
path: root/test/Analysis/BranchProbabilityInfo/basic.ll
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-12-02 13:10:19 +0000
committerdim <dim@FreeBSD.org>2012-12-02 13:10:19 +0000
commit6de2c08bc400b4aca9fb46684e8bdb56eed9b09f (patch)
tree32b4679ab4b8f28e5228daafc65e9dc436935353 /test/Analysis/BranchProbabilityInfo/basic.ll
parent4dc93743c9d40c29c0a3bec2aae328cac0d289e8 (diff)
downloadFreeBSD-src-6de2c08bc400b4aca9fb46684e8bdb56eed9b09f.zip
FreeBSD-src-6de2c08bc400b4aca9fb46684e8bdb56eed9b09f.tar.gz
Vendor import of llvm release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/llvm/branches/release_32@168974
Diffstat (limited to 'test/Analysis/BranchProbabilityInfo/basic.ll')
-rw-r--r--test/Analysis/BranchProbabilityInfo/basic.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Analysis/BranchProbabilityInfo/basic.ll b/test/Analysis/BranchProbabilityInfo/basic.ll
index 74d06a1..08adfa8 100644
--- a/test/Analysis/BranchProbabilityInfo/basic.ll
+++ b/test/Analysis/BranchProbabilityInfo/basic.ll
@@ -88,3 +88,30 @@ exit:
}
!1 = metadata !{metadata !"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4}
+
+define i32 @test4(i32 %x) nounwind uwtable readnone ssp {
+; CHECK: Printing analysis {{.*}} for function 'test4'
+entry:
+ %conv = sext i32 %x to i64
+ switch i64 %conv, label %return [
+ i64 0, label %sw.bb
+ i64 1, label %sw.bb
+ i64 2, label %sw.bb
+ i64 5, label %sw.bb1
+ ], !prof !2
+; CHECK: edge entry -> return probability is 7 / 85
+; CHECK: edge entry -> sw.bb probability is 14 / 85
+; CHECK: edge entry -> sw.bb1 probability is 64 / 85
+
+sw.bb:
+ br label %return
+
+sw.bb1:
+ br label %return
+
+return:
+ %retval.0 = phi i32 [ 5, %sw.bb1 ], [ 1, %sw.bb ], [ 0, %entry ]
+ ret i32 %retval.0
+}
+
+!2 = metadata !{metadata !"branch_weights", i32 7, i32 6, i32 4, i32 4, i32 64}
OpenPOWER on IntegriCloud