xref: /llvm-project/llvm/test/Transforms/InstCombine/select-pr39595.ll (revision 0676acb6fd8d5e22fde16e6ec977ceac08427ab0)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3
4define i32 @foo(i32 %x, i32 %y) {
5; CHECK-LABEL: @foo(
6; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.umax.i32(i32 [[X:%.*]], i32 [[Y:%.*]])
7; CHECK-NEXT:    [[TMP2:%.*]] = xor i32 [[TMP1]], -1
8; CHECK-NEXT:    ret i32 [[TMP2]]
9;
10
11  %1 = xor i32 %x, -1
12  %2 = xor i32 %y, -1
13  %3 = icmp ugt i32 %1, %2
14  %4 = select i1 %3, i32 %2, i32 %1, !prof !1
15  ret i32 %4
16}
17
18!1 = !{!"branch_weights", i32 1, i32 6}
19