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 @@ -3743,6 +3743,11 @@ Instruction *foldICmpXNegX(ICmpInst &I) {
3743
3743
NewRHS = Constant::getNullValue (X->getType ());
3744
3744
break ;
3745
3745
3746
+ case ICmpInst::ICMP_SLE:
3747
+ NewPred = ICmpInst::ICMP_SGE;
3748
+ NewRHS = Constant::getNullValue (X->getType ());
3749
+ break ;
3750
+
3746
3751
case ICmpInst::ICMP_EQ:
3747
3752
case ICmpInst::ICMP_NE:
3748
3753
NewPred = Pred;
Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ define i1 @t2(i8 %x) {
61
61
62
62
define i1 @t3 (i8 %x ) {
63
63
; CHECK-LABEL: @t3(
64
- ; CHECK-NEXT: [[NEG_X:%.*]] = sub nsw i8 0, [[X:%.*]]
65
- ; CHECK-NEXT: [[CMP:%.*]] = icmp sle i8 [[NEG_X]], [[X]]
64
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[X:%.*]], -1
66
65
; CHECK-NEXT: ret i1 [[CMP]]
67
66
;
68
67
%neg_x = sub nsw i8 0 , %x
You can’t perform that action at this time.
0 commit comments