Skip to content

Commit 1157187

Browse files
authored
[VPlan] Propagate all GEP flags (#119899)
Store GEPNoWrapFlags instead of only InBounds and propagate them.
1 parent 34c4f6f commit 1157187

24 files changed

+224
-149
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ class VPBuilder {
222222

223223
VPInstruction *createPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = {},
224224
const Twine &Name = "") {
225-
return tryInsertInstruction(new VPInstruction(
226-
Ptr, Offset, VPRecipeWithIRFlags::GEPFlagsTy(false), DL, Name));
225+
return tryInsertInstruction(
226+
new VPInstruction(Ptr, Offset, GEPNoWrapFlags::none(), DL, Name));
227227
}
228228
VPValue *createInBoundsPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = {},
229229
const Twine &Name = "") {
230-
return tryInsertInstruction(new VPInstruction(
231-
Ptr, Offset, VPRecipeWithIRFlags::GEPFlagsTy(true), DL, Name));
230+
return tryInsertInstruction(
231+
new VPInstruction(Ptr, Offset, GEPNoWrapFlags::inBounds(), DL, Name));
232232
}
233233

234234
VPDerivedIVRecipe *createDerivedIV(InductionDescriptor::InductionKind Kind,

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8406,10 +8406,13 @@ VPRecipeBuilder::tryToWidenMemory(Instruction *I, ArrayRef<VPValue *> Operands,
84068406
if (Reverse)
84078407
VectorPtr = new VPReverseVectorPointerRecipe(
84088408
Ptr, &Plan.getVF(), getLoadStoreType(I),
8409-
GEP ? GEP->isInBounds() : false, I->getDebugLoc());
8409+
GEP && GEP->isInBounds() ? GEPNoWrapFlags::inBounds()
8410+
: GEPNoWrapFlags::none(),
8411+
I->getDebugLoc());
84108412
else
84118413
VectorPtr = new VPVectorPointerRecipe(Ptr, getLoadStoreType(I),
8412-
GEP ? GEP->isInBounds() : false,
8414+
GEP ? GEP->getNoWrapFlags()
8415+
: GEPNoWrapFlags::none(),
84138416
I->getDebugLoc());
84148417
Builder.getInsertBlock()->appendRecipe(VectorPtr);
84158418
Ptr = VectorPtr;

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,6 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
952952
DisjointFlagsTy(bool IsDisjoint) : IsDisjoint(IsDisjoint) {}
953953
};
954954

955-
struct GEPFlagsTy {
956-
char IsInBounds : 1;
957-
GEPFlagsTy(bool IsInBounds) : IsInBounds(IsInBounds) {}
958-
};
959-
960955
private:
961956
struct ExactFlagsTy {
962957
char IsExact : 1;
@@ -983,7 +978,7 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
983978
WrapFlagsTy WrapFlags;
984979
DisjointFlagsTy DisjointFlags;
985980
ExactFlagsTy ExactFlags;
986-
GEPFlagsTy GEPFlags;
981+
GEPNoWrapFlags GEPFlags;
987982
NonNegFlagsTy NonNegFlags;
988983
FastMathFlagsTy FMFs;
989984
unsigned AllFlags;
@@ -1020,7 +1015,7 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
10201015
ExactFlags.IsExact = Op->isExact();
10211016
} else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) {
10221017
OpType = OperationType::GEPOp;
1023-
GEPFlags.IsInBounds = GEP->isInBounds();
1018+
GEPFlags = GEP->getNoWrapFlags();
10241019
} else if (auto *PNNI = dyn_cast<PossiblyNonNegInst>(&I)) {
10251020
OpType = OperationType::NonNegOp;
10261021
NonNegFlags.NonNeg = PNNI->hasNonNeg();
@@ -1060,7 +1055,7 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
10601055
protected:
10611056
template <typename IterT>
10621057
VPRecipeWithIRFlags(const unsigned char SC, IterT Operands,
1063-
GEPFlagsTy GEPFlags, DebugLoc DL = {})
1058+
GEPNoWrapFlags GEPFlags, DebugLoc DL = {})
10641059
: VPSingleDefRecipe(SC, Operands, DL), OpType(OperationType::GEPOp),
10651060
GEPFlags(GEPFlags) {}
10661061

@@ -1097,7 +1092,7 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
10971092
ExactFlags.IsExact = false;
10981093
break;
10991094
case OperationType::GEPOp:
1100-
GEPFlags.IsInBounds = false;
1095+
GEPFlags = GEPNoWrapFlags::none();
11011096
break;
11021097
case OperationType::FPMathOp:
11031098
FMFs.NoNaNs = false;
@@ -1126,10 +1121,7 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
11261121
I->setIsExact(ExactFlags.IsExact);
11271122
break;
11281123
case OperationType::GEPOp:
1129-
// TODO(gep_nowrap): Track the full GEPNoWrapFlags in VPlan.
1130-
cast<GetElementPtrInst>(I)->setNoWrapFlags(
1131-
GEPFlags.IsInBounds ? GEPNoWrapFlags::inBounds()
1132-
: GEPNoWrapFlags::none());
1124+
cast<GetElementPtrInst>(I)->setNoWrapFlags(GEPFlags);
11331125
break;
11341126
case OperationType::FPMathOp:
11351127
I->setHasAllowReassoc(FMFs.AllowReassoc);
@@ -1155,11 +1147,7 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
11551147
return CmpPredicate;
11561148
}
11571149

1158-
bool isInBounds() const {
1159-
assert(OpType == OperationType::GEPOp &&
1160-
"recipe doesn't have inbounds flag");
1161-
return GEPFlags.IsInBounds;
1162-
}
1150+
GEPNoWrapFlags getGEPNoWrapFlags() const { return GEPFlags; }
11631151

11641152
/// Returns true if the recipe has fast-math flags.
11651153
bool hasFastMathFlags() const { return OpType == OperationType::FPMathOp; }
@@ -1306,7 +1294,7 @@ class VPInstruction : public VPRecipeWithIRFlags,
13061294
assert(Opcode == Instruction::Or && "only OR opcodes can be disjoint");
13071295
}
13081296

1309-
VPInstruction(VPValue *Ptr, VPValue *Offset, GEPFlagsTy Flags,
1297+
VPInstruction(VPValue *Ptr, VPValue *Offset, GEPNoWrapFlags Flags,
13101298
DebugLoc DL = {}, const Twine &Name = "")
13111299
: VPRecipeWithIRFlags(VPDef::VPInstructionSC,
13121300
ArrayRef<VPValue *>({Ptr, Offset}), Flags, DL),
@@ -1914,10 +1902,9 @@ class VPReverseVectorPointerRecipe : public VPRecipeWithIRFlags,
19141902

19151903
public:
19161904
VPReverseVectorPointerRecipe(VPValue *Ptr, VPValue *VF, Type *IndexedTy,
1917-
bool IsInBounds, DebugLoc DL)
1905+
GEPNoWrapFlags GEPFlags, DebugLoc DL)
19181906
: VPRecipeWithIRFlags(VPDef::VPReverseVectorPointerSC,
1919-
ArrayRef<VPValue *>({Ptr, VF}),
1920-
GEPFlagsTy(IsInBounds), DL),
1907+
ArrayRef<VPValue *>({Ptr, VF}), GEPFlags, DL),
19211908
IndexedTy(IndexedTy) {}
19221909

19231910
VP_CLASSOF_IMPL(VPDef::VPReverseVectorPointerSC)
@@ -1949,8 +1936,9 @@ class VPReverseVectorPointerRecipe : public VPRecipeWithIRFlags,
19491936
}
19501937

19511938
VPReverseVectorPointerRecipe *clone() override {
1952-
return new VPReverseVectorPointerRecipe(
1953-
getOperand(0), getVFValue(), IndexedTy, isInBounds(), getDebugLoc());
1939+
return new VPReverseVectorPointerRecipe(getOperand(0), getVFValue(),
1940+
IndexedTy, getGEPNoWrapFlags(),
1941+
getDebugLoc());
19541942
}
19551943

19561944
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
@@ -1966,10 +1954,10 @@ class VPVectorPointerRecipe : public VPRecipeWithIRFlags,
19661954
Type *IndexedTy;
19671955

19681956
public:
1969-
VPVectorPointerRecipe(VPValue *Ptr, Type *IndexedTy, bool IsInBounds,
1957+
VPVectorPointerRecipe(VPValue *Ptr, Type *IndexedTy, GEPNoWrapFlags GEPFlags,
19701958
DebugLoc DL)
19711959
: VPRecipeWithIRFlags(VPDef::VPVectorPointerSC, ArrayRef<VPValue *>(Ptr),
1972-
GEPFlagsTy(IsInBounds), DL),
1960+
GEPFlags, DL),
19731961
IndexedTy(IndexedTy) {}
19741962

19751963
VP_CLASSOF_IMPL(VPDef::VPVectorPointerSC)
@@ -1991,8 +1979,8 @@ class VPVectorPointerRecipe : public VPRecipeWithIRFlags,
19911979
}
19921980

19931981
VPVectorPointerRecipe *clone() override {
1994-
return new VPVectorPointerRecipe(getOperand(0), IndexedTy, isInBounds(),
1995-
getDebugLoc());
1982+
return new VPVectorPointerRecipe(getOperand(0), IndexedTy,
1983+
getGEPNoWrapFlags(), getDebugLoc());
19961984
}
19971985

19981986
/// Return the cost of this VPHeaderPHIRecipe.

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
621621
"can only generate first lane for PtrAdd");
622622
Value *Ptr = State.get(getOperand(0), VPLane(0));
623623
Value *Addend = State.get(getOperand(1), VPLane(0));
624-
return isInBounds() ? Builder.CreateInBoundsPtrAdd(Ptr, Addend, Name)
625-
: Builder.CreatePtrAdd(Ptr, Addend, Name);
624+
return Builder.CreatePtrAdd(Ptr, Addend, Name, getGEPNoWrapFlags());
626625
}
627626
case VPInstruction::ResumePhi: {
628627
Value *IncomingFromVPlanPred =
@@ -1276,8 +1275,12 @@ void VPRecipeWithIRFlags::printFlags(raw_ostream &O) const {
12761275
getFastMathFlags().print(O);
12771276
break;
12781277
case OperationType::GEPOp:
1279-
if (GEPFlags.IsInBounds)
1278+
if (GEPFlags.isInBounds())
12801279
O << " inbounds";
1280+
else if (GEPFlags.hasNoUnsignedSignedWrap())
1281+
O << " nusw";
1282+
if (GEPFlags.hasNoUnsignedWrap())
1283+
O << " nuw";
12811284
break;
12821285
case OperationType::NonNegOp:
12831286
if (NonNegFlags.NonNeg)
@@ -1906,9 +1909,9 @@ void VPWidenGEPRecipe::execute(VPTransformState &State) {
19061909
for (unsigned I = 0, E = getNumOperands(); I != E; I++)
19071910
Ops.push_back(State.get(getOperand(I), VPLane(0)));
19081911

1909-
auto *NewGEP =
1910-
State.Builder.CreateGEP(GEP->getSourceElementType(), Ops[0],
1911-
ArrayRef(Ops).drop_front(), "", isInBounds());
1912+
auto *NewGEP = State.Builder.CreateGEP(GEP->getSourceElementType(), Ops[0],
1913+
ArrayRef(Ops).drop_front(), "",
1914+
getGEPNoWrapFlags());
19121915
Value *Splat = State.Builder.CreateVectorSplat(State.VF, NewGEP);
19131916
State.set(this, Splat);
19141917
State.addMetadata(Splat, GEP);
@@ -1934,7 +1937,7 @@ void VPWidenGEPRecipe::execute(VPTransformState &State) {
19341937
// Create the new GEP. Note that this GEP may be a scalar if VF == 1,
19351938
// but it should be a vector, otherwise.
19361939
auto *NewGEP = State.Builder.CreateGEP(GEP->getSourceElementType(), Ptr,
1937-
Indices, "", isInBounds());
1940+
Indices, "", getGEPNoWrapFlags());
19381941
assert((State.VF.isScalar() || NewGEP->getType()->isVectorTy()) &&
19391942
"NewGEP is not a pointer vector");
19401943
State.set(this, NewGEP);
@@ -1985,9 +1988,10 @@ void VPReverseVectorPointerRecipe::execute(VPTransformState &State) {
19851988
// LastLane = 1 - RunTimeVF
19861989
Value *LastLane = Builder.CreateSub(ConstantInt::get(IndexTy, 1), RunTimeVF);
19871990
Value *Ptr = State.get(getOperand(0), VPLane(0));
1988-
bool InBounds = isInBounds();
1989-
Value *ResultPtr = Builder.CreateGEP(IndexedTy, Ptr, NumElt, "", InBounds);
1990-
ResultPtr = Builder.CreateGEP(IndexedTy, ResultPtr, LastLane, "", InBounds);
1991+
Value *ResultPtr =
1992+
Builder.CreateGEP(IndexedTy, Ptr, NumElt, "", getGEPNoWrapFlags());
1993+
ResultPtr = Builder.CreateGEP(IndexedTy, ResultPtr, LastLane, "",
1994+
getGEPNoWrapFlags());
19911995

19921996
State.set(this, ResultPtr, /*IsScalar*/ true);
19931997
}
@@ -1997,9 +2001,9 @@ void VPReverseVectorPointerRecipe::print(raw_ostream &O, const Twine &Indent,
19972001
VPSlotTracker &SlotTracker) const {
19982002
O << Indent;
19992003
printAsOperand(O, SlotTracker);
2000-
O << " = reverse-vector-pointer ";
2001-
if (isInBounds())
2002-
O << "inbounds ";
2004+
O << " = reverse-vector-pointer";
2005+
printFlags(O);
2006+
O << " ";
20032007
printOperands(O, SlotTracker);
20042008
}
20052009
#endif
@@ -2011,10 +2015,10 @@ void VPVectorPointerRecipe::execute(VPTransformState &State) {
20112015
Type *IndexTy = getGEPIndexTy(State.VF.isScalable(), /*IsReverse*/ false,
20122016
CurrentPart, Builder);
20132017
Value *Ptr = State.get(getOperand(0), VPLane(0));
2014-
bool InBounds = isInBounds();
20152018

20162019
Value *Increment = createStepForVF(Builder, IndexTy, State.VF, CurrentPart);
2017-
Value *ResultPtr = Builder.CreateGEP(IndexedTy, Ptr, Increment, "", InBounds);
2020+
Value *ResultPtr =
2021+
Builder.CreateGEP(IndexedTy, Ptr, Increment, "", getGEPNoWrapFlags());
20182022

20192023
State.set(this, ResultPtr, /*IsScalar*/ true);
20202024
}

llvm/test/Transforms/LoopVectorize/AArch64/low_trip_count_predicates.ll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ define void @low_vf_ic_is_better(ptr nocapture noundef %p, i32 %tc, i16 noundef
8181
; CHECK-VS1-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
8282
; CHECK-VS1-NEXT: [[TMP20:%.*]] = add i64 [[TMP0]], [[INDEX]]
8383
; CHECK-VS1-NEXT: [[TMP21:%.*]] = add i64 [[TMP20]], 0
84-
; CHECK-VS1-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, ptr [[V]], i64 [[TMP21]]
85-
; CHECK-VS1-NEXT: [[TMP23:%.*]] = getelementptr inbounds i8, ptr [[TMP22]], i32 0
84+
; CHECK-VS1-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw i8, ptr [[V]], i64 [[TMP21]]
85+
; CHECK-VS1-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP22]], i32 0
8686
; CHECK-VS1-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 16 x i8>, ptr [[TMP23]], align 1
8787
; CHECK-VS1-NEXT: [[TMP24:%.*]] = add <vscale x 16 x i8> [[WIDE_LOAD]], [[BROADCAST_SPLAT]]
8888
; CHECK-VS1-NEXT: store <vscale x 16 x i8> [[TMP24]], ptr [[TMP23]], align 1
@@ -115,8 +115,8 @@ define void @low_vf_ic_is_better(ptr nocapture noundef %p, i32 %tc, i16 noundef
115115
; CHECK-VS1-NEXT: [[INDEX5:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
116116
; CHECK-VS1-NEXT: [[OFFSET_IDX:%.*]] = add i64 [[TMP0]], [[INDEX5]]
117117
; CHECK-VS1-NEXT: [[TMP32:%.*]] = add i64 [[OFFSET_IDX]], 0
118-
; CHECK-VS1-NEXT: [[TMP33:%.*]] = getelementptr inbounds i8, ptr [[V]], i64 [[TMP32]]
119-
; CHECK-VS1-NEXT: [[TMP34:%.*]] = getelementptr inbounds i8, ptr [[TMP33]], i32 0
118+
; CHECK-VS1-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw i8, ptr [[V]], i64 [[TMP32]]
119+
; CHECK-VS1-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP33]], i32 0
120120
; CHECK-VS1-NEXT: [[WIDE_LOAD6:%.*]] = load <vscale x 8 x i8>, ptr [[TMP34]], align 1
121121
; CHECK-VS1-NEXT: [[TMP35:%.*]] = add <vscale x 8 x i8> [[WIDE_LOAD6]], [[BROADCAST_SPLAT8]]
122122
; CHECK-VS1-NEXT: store <vscale x 8 x i8> [[TMP35]], ptr [[TMP34]], align 1
@@ -189,8 +189,8 @@ define void @low_vf_ic_is_better(ptr nocapture noundef %p, i32 %tc, i16 noundef
189189
; CHECK-VS2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
190190
; CHECK-VS2-NEXT: [[TMP20:%.*]] = add i64 [[TMP0]], [[INDEX]]
191191
; CHECK-VS2-NEXT: [[TMP21:%.*]] = add i64 [[TMP20]], 0
192-
; CHECK-VS2-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, ptr [[V]], i64 [[TMP21]]
193-
; CHECK-VS2-NEXT: [[TMP23:%.*]] = getelementptr inbounds i8, ptr [[TMP22]], i32 0
192+
; CHECK-VS2-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw i8, ptr [[V]], i64 [[TMP21]]
193+
; CHECK-VS2-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP22]], i32 0
194194
; CHECK-VS2-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x i8>, ptr [[TMP23]], align 1
195195
; CHECK-VS2-NEXT: [[TMP24:%.*]] = add <vscale x 8 x i8> [[WIDE_LOAD]], [[BROADCAST_SPLAT]]
196196
; CHECK-VS2-NEXT: store <vscale x 8 x i8> [[TMP24]], ptr [[TMP23]], align 1
@@ -223,8 +223,8 @@ define void @low_vf_ic_is_better(ptr nocapture noundef %p, i32 %tc, i16 noundef
223223
; CHECK-VS2-NEXT: [[INDEX5:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
224224
; CHECK-VS2-NEXT: [[OFFSET_IDX:%.*]] = add i64 [[TMP0]], [[INDEX5]]
225225
; CHECK-VS2-NEXT: [[TMP32:%.*]] = add i64 [[OFFSET_IDX]], 0
226-
; CHECK-VS2-NEXT: [[TMP33:%.*]] = getelementptr inbounds i8, ptr [[V]], i64 [[TMP32]]
227-
; CHECK-VS2-NEXT: [[TMP34:%.*]] = getelementptr inbounds i8, ptr [[TMP33]], i32 0
226+
; CHECK-VS2-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw i8, ptr [[V]], i64 [[TMP32]]
227+
; CHECK-VS2-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP33]], i32 0
228228
; CHECK-VS2-NEXT: [[WIDE_LOAD6:%.*]] = load <vscale x 4 x i8>, ptr [[TMP34]], align 1
229229
; CHECK-VS2-NEXT: [[TMP35:%.*]] = add <vscale x 4 x i8> [[WIDE_LOAD6]], [[BROADCAST_SPLAT8]]
230230
; CHECK-VS2-NEXT: store <vscale x 4 x i8> [[TMP35]], ptr [[TMP34]], align 1
@@ -279,7 +279,7 @@ while.end:
279279

280280
define void @trip_count_too_small(ptr nocapture noundef %p, i32 noundef %tc, i16 noundef %val) {
281281
; CHECK-LABEL: define void @trip_count_too_small(
282-
; CHECK-SAME: ptr nocapture noundef [[P:%.*]], i32 noundef [[TC:%.*]], i16 noundef [[VAL:%.*]]) #[[ATTR0]] {
282+
; CHECK-SAME: ptr nocapture noundef [[P:%.*]], i32 noundef [[TC:%.*]], i16 noundef [[VAL:%.*]]) #[[ATTR0:[0-9]+]] {
283283
; CHECK-NEXT: [[ENTRY:.*:]]
284284
; CHECK-NEXT: [[CMP7:%.*]] = icmp ult i32 [[TC]], 3
285285
; CHECK-NEXT: br i1 [[CMP7]], label %[[WHILE_PREHEADER:.*]], label %[[WHILE_END:.*]]
@@ -440,8 +440,8 @@ define void @overflow_indvar_known_false(ptr nocapture noundef %p, i32 noundef %
440440
; CHECK-NEXT: [[ACTIVE_LANE_MASK:%.*]] = phi <vscale x 16 x i1> [ [[ACTIVE_LANE_MASK_ENTRY]], %[[VECTOR_PH]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], %[[VECTOR_BODY]] ]
441441
; CHECK-NEXT: [[OFFSET_IDX:%.*]] = add i64 [[TMP0]], [[INDEX]]
442442
; CHECK-NEXT: [[TMP12:%.*]] = add i64 [[OFFSET_IDX]], 0
443-
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i8, ptr [[V]], i64 [[TMP12]]
444-
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i8, ptr [[TMP13]], i32 0
443+
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds nuw i8, ptr [[V]], i64 [[TMP12]]
444+
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP13]], i32 0
445445
; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <vscale x 16 x i8> @llvm.masked.load.nxv16i8.p0(ptr [[TMP14]], i32 1, <vscale x 16 x i1> [[ACTIVE_LANE_MASK]], <vscale x 16 x i8> poison)
446446
; CHECK-NEXT: [[TMP15:%.*]] = add <vscale x 16 x i8> [[WIDE_MASKED_LOAD]], [[BROADCAST_SPLAT]]
447447
; CHECK-NEXT: call void @llvm.masked.store.nxv16i8.p0(<vscale x 16 x i8> [[TMP15]], ptr [[TMP14]], i32 1, <vscale x 16 x i1> [[ACTIVE_LANE_MASK]])

0 commit comments

Comments
 (0)