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 @@ -3753,6 +3753,11 @@ Instruction *foldICmpXNegX(ICmpInst &I) {
3753
3753
NewRHS = Constant::getNullValue (X->getType ());
3754
3754
break ;
3755
3755
3756
+ case ICmpInst::ICMP_UGE:
3757
+ NewPred = ICmpInst::ICMP_SGE;
3758
+ NewRHS = Constant::getNullValue (X->getType ());
3759
+ break ;
3760
+
3756
3761
case ICmpInst::ICMP_EQ:
3757
3762
case ICmpInst::ICMP_NE:
3758
3763
NewPred = Pred;
Original file line number Diff line number Diff line change @@ -81,8 +81,7 @@ define i1 @t4(i8 %x) {
81
81
82
82
define i1 @t5 (i8 %x ) {
83
83
; CHECK-LABEL: @t5(
84
- ; CHECK-NEXT: [[NEG_X:%.*]] = sub nsw i8 0, [[X:%.*]]
85
- ; CHECK-NEXT: [[CMP:%.*]] = icmp uge i8 [[NEG_X]], [[X]]
84
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[X:%.*]], -1
86
85
; CHECK-NEXT: ret i1 [[CMP]]
87
86
;
88
87
%neg_x = sub nsw i8 0 , %x
You can’t perform that action at this time.
0 commit comments