summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/LowerExpectIntrinsic/basic.ll')
-rw-r--r--llvm/test/Transforms/LowerExpectIntrinsic/basic.ll31
1 files changed, 17 insertions, 14 deletions
diff --git a/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll b/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
index d1335e834ce..4324b7bd32b 100644
--- a/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
+++ b/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
@@ -13,7 +13,7 @@ entry:
%conv1 = sext i32 %conv to i64
%expval = call i64 @llvm.expect.i64(i64 %conv1, i64 1)
%tobool = icmp ne i64 %expval, 0
-; CHECK: !prof !0
+; CHECK: !prof !0, !misexpect !1
; CHECK-NOT: @llvm.expect
br i1 %tobool, label %if.then, label %if.end
@@ -45,7 +45,7 @@ entry:
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
%tobool = icmp ne i64 %expval, 0
-; CHECK: !prof !0
+; CHECK: !prof !0, !misexpect !1
; CHECK-NOT: @llvm.expect
br i1 %tobool, label %if.then, label %if.end
@@ -76,7 +76,7 @@ entry:
%conv = sext i32 %lnot.ext to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
%tobool1 = icmp ne i64 %expval, 0
-; CHECK: !prof !0
+; CHECK: !prof !0, !misexpect !1
; CHECK-NOT: @llvm.expect
br i1 %tobool1, label %if.then, label %if.end
@@ -108,7 +108,7 @@ entry:
%conv = sext i32 %lnot.ext to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
%tobool2 = icmp ne i64 %expval, 0
-; CHECK: !prof !0
+; CHECK: !prof !0, !misexpect !1
; CHECK-NOT: @llvm.expect
br i1 %tobool2, label %if.then, label %if.end
@@ -138,7 +138,7 @@ entry:
%conv1 = sext i32 %conv to i64
%expval = call i64 @llvm.expect.i64(i64 %conv1, i64 0)
%tobool = icmp ne i64 %expval, 0
-; CHECK: !prof !1
+; CHECK: !prof !2, !misexpect !3
; CHECK-NOT: @llvm.expect
br i1 %tobool, label %if.then, label %if.end
@@ -164,8 +164,8 @@ entry:
store i32 %x, i32* %x.addr, align 4
%tmp = load i32, i32* %x.addr, align 4
%conv = sext i32 %tmp to i64
- %expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
-; CHECK: !prof !2
+ %expval = call i64 @llvm.expect.i64(i64 %conv, i64 2)
+; CHECK: !prof !4, !misexpect !5
; CHECK-NOT: @llvm.expect
switch i64 %expval, label %sw.epilog [
i64 1, label %sw.bb
@@ -194,7 +194,7 @@ entry:
%tmp = load i32, i32* %x.addr, align 4
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
-; CHECK: !prof !3
+; CHECK: !prof !6, !misexpect !1
; CHECK-NOT: @llvm.expect
switch i64 %expval, label %sw.epilog [
i64 2, label %sw.bb
@@ -226,7 +226,7 @@ entry:
%conv = zext i1 %cmp to i32
%expval = call i32 @llvm.expect.i32(i32 %conv, i32 1)
%tobool = icmp ne i32 %expval, 0
-; CHECK: !prof !0
+; CHECK: !prof !0, !misexpect !1
; CHECK-NOT: @llvm.expect
br i1 %tobool, label %if.then, label %if.end
@@ -255,7 +255,7 @@ entry:
%tmp = load i32, i32* %x.addr, align 4
%cmp = icmp sgt i32 %tmp, 1
%expval = call i1 @llvm.expect.i1(i1 %cmp, i1 1)
-; CHECK: !prof !0
+; CHECK: !prof !0, !misexpect !1
; CHECK-NOT: @llvm.expect
br i1 %expval, label %if.then, label %if.end
@@ -278,7 +278,7 @@ define i32 @test10(i64 %t6) {
%t7 = call i64 @llvm.expect.i64(i64 %t6, i64 0)
%t8 = icmp ne i64 %t7, 0
%t9 = select i1 %t8, i32 1, i32 2
-; CHECK: select{{.*}}, !prof !1
+; CHECK: select{{.*}}, !prof !2, !misexpect !3
ret i32 %t9
}
@@ -286,6 +286,9 @@ define i32 @test10(i64 %t6) {
declare i1 @llvm.expect.i1(i1, i1) nounwind readnone
; CHECK: !0 = !{!"branch_weights", i32 2000, i32 1}
-; CHECK: !1 = !{!"branch_weights", i32 1, i32 2000}
-; CHECK: !2 = !{!"branch_weights", i32 1, i32 2000, i32 1}
-; CHECK: !3 = !{!"branch_weights", i32 2000, i32 1, i32 1}
+; CHECK: !1 = !{!"misexpect", i64 0, i64 2000, i64 1}
+; CHECK: !2 = !{!"branch_weights", i32 1, i32 2000}
+; CHECK: !3 = !{!"misexpect", i64 1, i64 2000, i64 1}
+; CHECK: !4 = !{!"branch_weights", i32 1, i32 1, i32 2000}
+; CHECK: !5 = !{!"misexpect", i64 2, i64 2000, i64 1}
+; CHECK: !6 = !{!"branch_weights", i32 2000, i32 1, i32 1}
OpenPOWER on IntegriCloud