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 @@ -3748,6 +3748,11 @@ Instruction *foldICmpXNegX(ICmpInst &I) {
3748
3748
NewRHS = Constant::getNullValue (X->getType ());
3749
3749
break ;
3750
3750
3751
+ case ICmpInst::ICMP_UGT:
3752
+ NewPred = ICmpInst::ICMP_SGT;
3753
+ NewRHS = Constant::getNullValue (X->getType ());
3754
+ break ;
3755
+
3751
3756
case ICmpInst::ICMP_EQ:
3752
3757
case ICmpInst::ICMP_NE:
3753
3758
NewPred = Pred;
Original file line number Diff line number Diff line change @@ -71,8 +71,7 @@ define i1 @t3(i8 %x) {
71
71
72
72
define i1 @t4 (i8 %x ) {
73
73
; CHECK-LABEL: @t4(
74
- ; CHECK-NEXT: [[NEG_X:%.*]] = sub nsw i8 0, [[X:%.*]]
75
- ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8 [[NEG_X]], [[X]]
74
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[X:%.*]], 0
76
75
; CHECK-NEXT: ret i1 [[CMP]]
77
76
;
78
77
%neg_x = sub nsw i8 0 , %x
You can’t perform that action at this time.
0 commit comments