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 @@ -3763,6 +3763,11 @@ Instruction *foldICmpXNegX(ICmpInst &I) {
3763
3763
NewRHS = Constant::getNullValue (X->getType ());
3764
3764
break ;
3765
3765
3766
+ case ICmpInst::ICMP_ULE:
3767
+ NewPred = ICmpInst::ICMP_SLE;
3768
+ NewRHS = Constant::getNullValue (X->getType ());
3769
+ break ;
3770
+
3766
3771
case ICmpInst::ICMP_EQ:
3767
3772
case ICmpInst::ICMP_NE:
3768
3773
NewPred = Pred;
Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ define i1 @t6(i8 %x) {
101
101
102
102
define i1 @t7 (i8 %x ) {
103
103
; CHECK-LABEL: @t7(
104
- ; CHECK-NEXT: [[NEG_X:%.*]] = sub nsw i8 0, [[X:%.*]]
105
- ; CHECK-NEXT: [[CMP:%.*]] = icmp ule i8 [[NEG_X]], [[X]]
104
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[X:%.*]], 1
106
105
; CHECK-NEXT: ret i1 [[CMP]]
107
106
;
108
107
%neg_x = sub nsw i8 0 , %x
You can’t perform that action at this time.
0 commit comments