File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
lib/Transforms/InstCombine
test/Transforms/InstCombine Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1223,7 +1223,9 @@ Instruction *InstCombinerImpl::visitZExt(ZExtInst &Zext) {
1223
1223
1224
1224
if (!Zext.hasNonNeg ()) {
1225
1225
// If this zero extend is only used by a shift, add nneg flag.
1226
- if (Zext.hasOneUse () && SrcTy->getScalarSizeInBits () > 2 &&
1226
+ if (Zext.hasOneUse () &&
1227
+ SrcTy->getScalarSizeInBits () >
1228
+ Log2_64_Ceil (DestTy->getScalarSizeInBits ()) &&
1227
1229
match (Zext.user_back (), m_Shift (m_Value (), m_Specific (&Zext)))) {
1228
1230
Zext.setNonNeg ();
1229
1231
return &Zext;
Original file line number Diff line number Diff line change @@ -2208,8 +2208,8 @@ define i128 @shift_zext_nneg(i8 %arg) {
2208
2208
2209
2209
define i129 @shift_zext_not_nneg (i8 %arg ) {
2210
2210
; CHECK-LABEL: @shift_zext_not_nneg(
2211
- ; CHECK-NEXT: [[EXT:%.*]] = zext nneg i8 [[ARG:%.*]] to i129
2212
- ; CHECK-NEXT: [[SHL:%.*]] = shl nuw nsw i129 1, [[EXT]]
2211
+ ; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[ARG:%.*]] to i129
2212
+ ; CHECK-NEXT: [[SHL:%.*]] = shl nuw i129 1, [[EXT]]
2213
2213
; CHECK-NEXT: ret i129 [[SHL]]
2214
2214
;
2215
2215
%ext = zext i8 %arg to i129
You can’t perform that action at this time.
0 commit comments