summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/speculate-store.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-03-26 23:30:50 +0000
committerSanjay Patel <spatel@rotateright.com>2016-03-26 23:30:50 +0000
commit796db35f622d0730347a09a9b675bc5e113db9c3 (patch)
tree12e35a163bcfc37cc41ac6e6c868f078235de335 /llvm/test/Transforms/SimplifyCFG/speculate-store.ll
parent342f7c7e10aec9ba8003b993129f191d438d5545 (diff)
downloadbcm5719-llvm-796db35f622d0730347a09a9b675bc5e113db9c3.tar.gz
bcm5719-llvm-796db35f622d0730347a09a9b675bc5e113db9c3.zip
[SimplifyCFG] propagate branch metadata when creating select (PR26636)
llvm-svn: 264527
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/speculate-store.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/speculate-store.ll7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/speculate-store.ll b/llvm/test/Transforms/SimplifyCFG/speculate-store.ll
index 15f403ce5f5..497e024e248 100644
--- a/llvm/test/Transforms/SimplifyCFG/speculate-store.ll
+++ b/llvm/test/Transforms/SimplifyCFG/speculate-store.ll
@@ -4,7 +4,7 @@ define void @ifconvertstore(i32* %A, i32 %B, i32 %C, i32 %D) {
; CHECK-LABEL: @ifconvertstore(
; CHECK: store i32 %B, i32* %A
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 %D, 42
-; CHECK-NEXT: [[C_B:%.*]] = select i1 [[CMP]], i32 %C, i32 %B
+; CHECK-NEXT: [[C_B:%.*]] = select i1 [[CMP]], i32 %C, i32 %B, !prof !0
; CHECK-NEXT: store i32 [[C_B]], i32* %A
; CHECK-NEXT: ret void
;
@@ -12,7 +12,7 @@ entry:
; First store to the location.
store i32 %B, i32* %A
%cmp = icmp sgt i32 %D, 42
- br i1 %cmp, label %if.then, label %ret.end
+ br i1 %cmp, label %if.then, label %ret.end, !prof !0
; Make sure we speculate stores like the following one. It is cheap compared to
; a mispredicated branch.
@@ -85,3 +85,6 @@ ret.end:
ret void
}
+; CHECK: !0 = !{!"branch_weights", i32 3, i32 5}
+!0 = !{!"branch_weights", i32 3, i32 5}
+
OpenPOWER on IntegriCloud