From a0b9e258d27ba048cec00c0ed6acc12321fdf4df Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 22 Aug 2019 20:34:56 +0000 Subject: [PATCH] [NFC][InstCombine] Fixup few new tests in unrecognized_three-way-comparison.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369701 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../InstCombine/unrecognized_three-way-comparison.ll | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Transforms/InstCombine/unrecognized_three-way-comparison.ll b/test/Transforms/InstCombine/unrecognized_three-way-comparison.ll index 2cc00368502..75e738fceda 100644 --- a/test/Transforms/InstCombine/unrecognized_three-way-comparison.ll +++ b/test/Transforms/InstCombine/unrecognized_three-way-comparison.ll @@ -610,7 +610,7 @@ define i32 @compare_against_arbitrary_value_commutativity1(i32 %x, i32 %c) { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[X:%.*]], [[C:%.*]] ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[C]], [[X]] -; CHECK-NEXT: [[SELECT1:%.*]] = select i1 [[CMP2]], i32 1, i32 -1 +; CHECK-NEXT: [[SELECT1:%.*]] = select i1 [[CMP2]], i32 -1, i32 1 ; CHECK-NEXT: [[SELECT2:%.*]] = select i1 [[CMP1]], i32 0, i32 [[SELECT1]] ; CHECK-NEXT: [[COND:%.*]] = icmp sgt i32 [[SELECT2]], 0 ; CHECK-NEXT: br i1 [[COND]], label [[CALLFOO:%.*]], label [[EXIT:%.*]] @@ -622,8 +622,8 @@ define i32 @compare_against_arbitrary_value_commutativity1(i32 %x, i32 %c) { ; entry: %cmp1 = icmp eq i32 %x, %c - %cmp2 = icmp sgt i32 %c, %x ; inverted - %select1 = select i1 %cmp2, i32 1, i32 -1 ; swapped + %cmp2 = icmp sgt i32 %c, %x ; swapped + %select1 = select i1 %cmp2, i32 -1, i32 1 %select2 = select i1 %cmp1, i32 0, i32 %select1 %cond = icmp sgt i32 %select2, 0 br i1 %cond, label %callfoo, label %exit @@ -673,7 +673,7 @@ define i32 @compare_against_arbitrary_value_commutativity3(i32 %x, i32 %c) { ; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i32 [[X:%.*]], [[C:%.*]] ; CHECK-NEXT: call void @use1(i1 [[CMP1]]) ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[C]], [[X]] -; CHECK-NEXT: [[SELECT1:%.*]] = select i1 [[CMP2]], i32 1, i32 -1 +; CHECK-NEXT: [[SELECT1:%.*]] = select i1 [[CMP2]], i32 -1, i32 1 ; CHECK-NEXT: [[SELECT2:%.*]] = select i1 [[CMP1]], i32 [[SELECT1]], i32 0 ; CHECK-NEXT: [[COND:%.*]] = icmp sgt i32 [[SELECT2]], 0 ; CHECK-NEXT: br i1 [[COND]], label [[CALLFOO:%.*]], label [[EXIT:%.*]] @@ -686,8 +686,8 @@ define i32 @compare_against_arbitrary_value_commutativity3(i32 %x, i32 %c) { entry: %cmp1 = icmp ne i32 %x, %c ; inverted call void @use1(i1 %cmp1) - %cmp2 = icmp sgt i32 %c, %x ; inverted - %select1 = select i1 %cmp2, i32 1, i32 -1 ; swapped + %cmp2 = icmp sgt i32 %c, %x ; swapped + %select1 = select i1 %cmp2, i32 -1, i32 1 %select2 = select i1 %cmp1, i32 %select1, i32 0 ; swapped %cond = icmp sgt i32 %select2, 0 br i1 %cond, label %callfoo, label %exit -- 2.40.0