@@ -482,8 +482,9 @@ define i1 @test_select_inverse_nonconst4(i64 %x, i64 %y, i64 %z, i1 %cond) {
482482
483483define i1 @test_select_inverse_samesign_true_arm (i64 %x , i64 %y , i1 %cond ) {
484484; CHECK-LABEL: @test_select_inverse_samesign_true_arm(
485- ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i64 [[X:%.*]], [[Y:%.*]]
486- ; CHECK-NEXT: [[SEL:%.*]] = xor i1 [[COND:%.*]], [[CMP2]]
485+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp samesign ult i64 [[X:%.*]], [[Y:%.*]]
486+ ; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i64 [[X]], [[Y]]
487+ ; CHECK-NEXT: [[SEL:%.*]] = select i1 [[COND:%.*]], i1 [[CMP1]], i1 [[CMP2]]
487488; CHECK-NEXT: ret i1 [[SEL]]
488489;
489490 %cmp1 = icmp samesign ult i64 %x , %y
@@ -532,8 +533,9 @@ define i1 @test_select_inverse_samesign_false_arm_rhsc_same_sign(i64 %x, i64 %y,
532533
533534define i1 @test_select_inverse_samesign_true_arm_rhsc_same_sign (i64 %x , i64 %y , i1 %cond ) {
534535; CHECK-LABEL: @test_select_inverse_samesign_true_arm_rhsc_same_sign(
535- ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i64 [[X:%.*]], 10
536- ; CHECK-NEXT: [[SEL:%.*]] = xor i1 [[COND:%.*]], [[CMP2]]
536+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp samesign ult i64 [[X:%.*]], 11
537+ ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i64 [[X]], 10
538+ ; CHECK-NEXT: [[SEL:%.*]] = select i1 [[COND:%.*]], i1 [[CMP1]], i1 [[CMP2]]
537539; CHECK-NEXT: ret i1 [[SEL]]
538540;
539541 %cmp1 = icmp samesign ult i64 %x , 11
0 commit comments