From 515ad8fe4acbfcd0eb6c179a61e2acb134495843 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Fri, 16 Aug 2019 23:06:37 +0000 Subject: [PATCH] [InstCombine][NFC] reuse-constant-from-select-in-icmp.ll - check branch_weights too llvm-svn: 369166 --- .../InstCombine/reuse-constant-from-select-in-icmp.ll | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/llvm/test/Transforms/InstCombine/reuse-constant-from-select-in-icmp.ll b/llvm/test/Transforms/InstCombine/reuse-constant-from-select-in-icmp.ll index df8b79e..7128922 100644 --- a/llvm/test/Transforms/InstCombine/reuse-constant-from-select-in-icmp.ll +++ b/llvm/test/Transforms/InstCombine/reuse-constant-from-select-in-icmp.ll @@ -14,14 +14,16 @@ ; Canonical scalar predicates ;------------------------------------------------------------------------------; +!0 = !{!"branch_weights", i32 2000, i32 1} + define i32 @p0_ult_65536(i32 %x, i32 %y) { ; CHECK-LABEL: @p0_ult_65536( ; CHECK-NEXT: [[T:%.*]] = icmp ult i32 [[X:%.*]], 65536 -; CHECK-NEXT: [[R:%.*]] = select i1 [[T]], i32 [[Y:%.*]], i32 65535 +; CHECK-NEXT: [[R:%.*]] = select i1 [[T]], i32 [[Y:%.*]], i32 65535, !prof !0 ; CHECK-NEXT: ret i32 [[R]] ; %t = icmp ult i32 %x, 65536 - %r = select i1 %t, i32 %y, i32 65535 + %r = select i1 %t, i32 %y, i32 65535, !prof !0 ret i32 %r } define i32 @p1_ugt(i32 %x, i32 %y) { @@ -318,3 +320,7 @@ define i32 @n26_all_good1(i32 %x, i32 %y) { %r = select i1 %t, i32 65536, i32 65535 ret i32 %r } + + + +; CHECK: !0 = !{!"branch_weights", i32 2000, i32 1} -- 2.7.4