Skip to content

Commit 1ddc5f5

Browse files
committed
[VPlan] Propagate all GEP flags
Store GEPNoWrapFlags instead of only InBounds and propagate them.
1 parent 07aab4a commit 1ddc5f5

23 files changed

+144
-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
@@ -8407,10 +8407,13 @@ VPRecipeBuilder::tryToWidenMemory(Instruction *I, ArrayRef<VPValue *> Operands,
84078407
if (Reverse)
84088408
VectorPtr = new VPReverseVectorPointerRecipe(
84098409
Ptr, &Plan.getVF(), getLoadStoreType(I),
8410-
GEP ? GEP->isInBounds() : false, I->getDebugLoc());
8410+
GEP && GEP->isInBounds() ? GEPNoWrapFlags::inBounds()
8411+
: GEPNoWrapFlags::none(),
8412+
I->getDebugLoc());
84118413
else
84128414
VectorPtr = new VPVectorPointerRecipe(Ptr, getLoadStoreType(I),
8413-
GEP ? GEP->isInBounds() : false,
8415+
GEP ? GEP->getNoWrapFlags()
8416+
: GEPNoWrapFlags::none(),
84148417
I->getDebugLoc());
84158418
Builder.getInsertBlock()->appendRecipe(VectorPtr);
84168419
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),
@@ -1922,10 +1910,9 @@ class VPReverseVectorPointerRecipe : public VPRecipeWithIRFlags,
19221910

19231911
public:
19241912
VPReverseVectorPointerRecipe(VPValue *Ptr, VPValue *VF, Type *IndexedTy,
1925-
bool IsInBounds, DebugLoc DL)
1913+
GEPNoWrapFlags GEPFlags, DebugLoc DL)
19261914
: VPRecipeWithIRFlags(VPDef::VPReverseVectorPointerSC,
1927-
ArrayRef<VPValue *>({Ptr, VF}),
1928-
GEPFlagsTy(IsInBounds), DL),
1915+
ArrayRef<VPValue *>({Ptr, VF}), GEPFlags, DL),
19291916
IndexedTy(IndexedTy) {}
19301917

19311918
VP_CLASSOF_IMPL(VPDef::VPReverseVectorPointerSC)
@@ -1957,8 +1944,9 @@ class VPReverseVectorPointerRecipe : public VPRecipeWithIRFlags,
19571944
}
19581945

19591946
VPReverseVectorPointerRecipe *clone() override {
1960-
return new VPReverseVectorPointerRecipe(
1961-
getOperand(0), getVFValue(), IndexedTy, isInBounds(), getDebugLoc());
1947+
return new VPReverseVectorPointerRecipe(getOperand(0), getVFValue(),
1948+
IndexedTy, getGEPNoWrapFlags(),
1949+
getDebugLoc());
19621950
}
19631951

19641952
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
@@ -1974,10 +1962,10 @@ class VPVectorPointerRecipe : public VPRecipeWithIRFlags,
19741962
Type *IndexedTy;
19751963

19761964
public:
1977-
VPVectorPointerRecipe(VPValue *Ptr, Type *IndexedTy, bool IsInBounds,
1965+
VPVectorPointerRecipe(VPValue *Ptr, Type *IndexedTy, GEPNoWrapFlags GEPFlags,
19781966
DebugLoc DL)
19791967
: VPRecipeWithIRFlags(VPDef::VPVectorPointerSC, ArrayRef<VPValue *>(Ptr),
1980-
GEPFlagsTy(IsInBounds), DL),
1968+
GEPFlags, DL),
19811969
IndexedTy(IndexedTy) {}
19821970

19831971
VP_CLASSOF_IMPL(VPDef::VPVectorPointerSC)
@@ -1999,8 +1987,8 @@ class VPVectorPointerRecipe : public VPRecipeWithIRFlags,
19991987
}
20001988

20011989
VPVectorPointerRecipe *clone() override {
2002-
return new VPVectorPointerRecipe(getOperand(0), IndexedTy, isInBounds(),
2003-
getDebugLoc());
1990+
return new VPVectorPointerRecipe(getOperand(0), IndexedTy,
1991+
getGEPNoWrapFlags(), getDebugLoc());
20041992
}
20051993

20061994
/// 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)
@@ -1918,9 +1921,9 @@ void VPWidenGEPRecipe::execute(VPTransformState &State) {
19181921
for (unsigned I = 0, E = getNumOperands(); I != E; I++)
19191922
Ops.push_back(State.get(getOperand(I), VPLane(0)));
19201923

1921-
auto *NewGEP =
1922-
State.Builder.CreateGEP(GEP->getSourceElementType(), Ops[0],
1923-
ArrayRef(Ops).drop_front(), "", isInBounds());
1924+
auto *NewGEP = State.Builder.CreateGEP(GEP->getSourceElementType(), Ops[0],
1925+
ArrayRef(Ops).drop_front(), "",
1926+
getGEPNoWrapFlags());
19241927
Value *Splat = State.Builder.CreateVectorSplat(State.VF, NewGEP);
19251928
State.set(this, Splat);
19261929
State.addMetadata(Splat, GEP);
@@ -1946,7 +1949,7 @@ void VPWidenGEPRecipe::execute(VPTransformState &State) {
19461949
// Create the new GEP. Note that this GEP may be a scalar if VF == 1,
19471950
// but it should be a vector, otherwise.
19481951
auto *NewGEP = State.Builder.CreateGEP(GEP->getSourceElementType(), Ptr,
1949-
Indices, "", isInBounds());
1952+
Indices, "", getGEPNoWrapFlags());
19501953
assert((State.VF.isScalar() || NewGEP->getType()->isVectorTy()) &&
19511954
"NewGEP is not a pointer vector");
19521955
State.set(this, NewGEP);
@@ -1997,9 +2000,10 @@ void VPReverseVectorPointerRecipe::execute(VPTransformState &State) {
19972000
// LastLane = 1 - RunTimeVF
19982001
Value *LastLane = Builder.CreateSub(ConstantInt::get(IndexTy, 1), RunTimeVF);
19992002
Value *Ptr = State.get(getOperand(0), VPLane(0));
2000-
bool InBounds = isInBounds();
2001-
Value *ResultPtr = Builder.CreateGEP(IndexedTy, Ptr, NumElt, "", InBounds);
2002-
ResultPtr = Builder.CreateGEP(IndexedTy, ResultPtr, LastLane, "", InBounds);
2003+
Value *ResultPtr =
2004+
Builder.CreateGEP(IndexedTy, Ptr, NumElt, "", getGEPNoWrapFlags());
2005+
ResultPtr = Builder.CreateGEP(IndexedTy, ResultPtr, LastLane, "",
2006+
getGEPNoWrapFlags());
20032007

20042008
State.set(this, ResultPtr, /*IsScalar*/ true);
20052009
}
@@ -2009,9 +2013,9 @@ void VPReverseVectorPointerRecipe::print(raw_ostream &O, const Twine &Indent,
20092013
VPSlotTracker &SlotTracker) const {
20102014
O << Indent;
20112015
printAsOperand(O, SlotTracker);
2012-
O << " = reverse-vector-pointer ";
2013-
if (isInBounds())
2014-
O << "inbounds ";
2016+
O << " = reverse-vector-pointer";
2017+
printFlags(O);
2018+
O << " ";
20152019
printOperands(O, SlotTracker);
20162020
}
20172021
#endif
@@ -2023,10 +2027,10 @@ void VPVectorPointerRecipe::execute(VPTransformState &State) {
20232027
Type *IndexTy = getGEPIndexTy(State.VF.isScalable(), /*IsReverse*/ false,
20242028
CurrentPart, Builder);
20252029
Value *Ptr = State.get(getOperand(0), VPLane(0));
2026-
bool InBounds = isInBounds();
20272030

20282031
Value *Increment = createStepForVF(Builder, IndexTy, State.VF, CurrentPart);
2029-
Value *ResultPtr = Builder.CreateGEP(IndexedTy, Ptr, Increment, "", InBounds);
2032+
Value *ResultPtr =
2033+
Builder.CreateGEP(IndexedTy, Ptr, Increment, "", getGEPNoWrapFlags());
20302034

20312035
State.set(this, ResultPtr, /*IsScalar*/ true);
20322036
}

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)