File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
lib/Transforms/InstCombine
test/Transforms/InstCombine Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3758,6 +3758,11 @@ Instruction *foldICmpXNegX(ICmpInst &I) {
3758
3758
NewRHS = Constant::getNullValue (X->getType ());
3759
3759
break ;
3760
3760
3761
+ case ICmpInst::ICMP_ULT:
3762
+ NewPred = ICmpInst::ICMP_SLT;
3763
+ NewRHS = Constant::getNullValue (X->getType ());
3764
+ break ;
3765
+
3761
3766
case ICmpInst::ICMP_EQ:
3762
3767
case ICmpInst::ICMP_NE:
3763
3768
NewPred = Pred;
Original file line number Diff line number Diff line change @@ -91,8 +91,7 @@ define i1 @t5(i8 %x) {
91
91
92
92
define i1 @t6 (i8 %x ) {
93
93
; CHECK-LABEL: @t6(
94
- ; CHECK-NEXT: [[NEG_X:%.*]] = sub nsw i8 0, [[X:%.*]]
95
- ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[NEG_X]], [[X]]
94
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[X:%.*]], 0
96
95
; CHECK-NEXT: ret i1 [[CMP]]
97
96
;
98
97
%neg_x = sub nsw i8 0 , %x
You can’t perform that action at this time.
0 commit comments