Skip to content

Commit a6a879d

Browse files
committed
!fixup address latest comments, thanks
1 parent c9409be commit a6a879d

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9697,7 +9697,7 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VFRange &Range) {
96979697
// Collect mapping of IR header phis to header phi recipes, to be used in
96989698
// addScalarResumePhis.
96999699
VPRecipeBuilder RecipeBuilder(*Plan, OrigLoop, TLI, &TTI, Legal, CM, PSE,
9700-
Builder, nullptr);
9700+
Builder, nullptr /*LVer*/);
97019701
for (auto &R : Plan->getVectorLoopRegion()->getEntryBasicBlock()->phis()) {
97029702
if (isa<VPCanonicalIVPHIRecipe>(&R))
97039703
continue;

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ VPTransformState::VPTransformState(const TargetTransformInfo *TTI,
219219
DominatorTree *DT, AssumptionCache *AC,
220220
IRBuilderBase &Builder, VPlan *Plan,
221221
Loop *CurrentParentLoop, Type *CanonicalIVTy)
222-
: TTI(TTI), VF(VF), CFG(DT), LI(LI), Builder(Builder), Plan(Plan),
222+
: TTI(TTI), VF(VF), CFG(DT), LI(LI), AC(AC), Builder(Builder), Plan(Plan),
223223
CurrentParentLoop(CurrentParentLoop), TypeAnalysis(CanonicalIVTy),
224224
VPDT(*Plan) {}
225225

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,7 @@ class VPIRMetadata {
12331233
/// \p I and noalias metadata guaranteed by runtime checks using \p LVer.
12341234
VPIRMetadata(Instruction &I, LoopVersioning *LVer);
12351235

1236+
/// Copy constructor for cloning.
12361237
VPIRMetadata(const VPIRMetadata &Other) : Metadata(Other.Metadata) {}
12371238

12381239
/// Add all metadata to \p I.

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
7878
assert(!isa<PHINode>(Inst) && "phis should be handled above");
7979
// Create VPWidenMemoryRecipe for loads and stores.
8080
if (LoadInst *Load = dyn_cast<LoadInst>(Inst)) {
81-
SmallVector<std::pair<unsigned, MDNode *>> Metadata;
82-
::getMetadataToPropagate(Inst, Metadata);
8381
NewRecipe = new VPWidenLoadRecipe(
8482
*Load, Ingredient.getOperand(0), nullptr /*Mask*/,
8583
false /*Consecutive*/, false /*Reverse*/, VPIRMetadata(*Load),
@@ -187,7 +185,7 @@ static bool sinkScalarOperands(VPlan &Plan) {
187185
// then cloning should be sufficient here.
188186
Instruction *I = SinkCandidate->getUnderlyingInstr();
189187
Clone = new VPReplicateRecipe(I, SinkCandidate->operands(), true,
190-
/*Mask*/ nullptr, *SinkCandidateRepR);
188+
nullptr /*Mask*/, *SinkCandidateRepR);
191189
// TODO: add ".cloned" suffix to name of Clone's VPValue.
192190
} else {
193191
Clone = SinkCandidate->clone();
@@ -349,7 +347,7 @@ static VPRegionBlock *createReplicateRegion(VPReplicateRecipe *PredRecipe,
349347
auto *RecipeWithoutMask = new VPReplicateRecipe(
350348
PredRecipe->getUnderlyingInstr(),
351349
make_range(PredRecipe->op_begin(), std::prev(PredRecipe->op_end())),
352-
PredRecipe->isUniform(), /*Mask*/ nullptr, *PredRecipe);
350+
PredRecipe->isUniform(), nullptr /*Mask*/, *PredRecipe);
353351
auto *Pred =
354352
Plan.createVPBasicBlock(Twine(RegionName) + ".if", RecipeWithoutMask);
355353

@@ -2797,7 +2795,7 @@ void VPlanTransforms::narrowInterleaveGroups(VPlan &Plan, ElementCount VF,
27972795
*cast<LoadInst>(LoadGroup->getInterleaveGroup()->getInsertPos());
27982796
auto *L = new VPWidenLoadRecipe(
27992797
LI, LoadGroup->getAddr(), LoadGroup->getMask(), /*Consecutive=*/true,
2800-
/*Reverse=*/false, VPIRMetadata(LI), LoadGroup->getDebugLoc());
2798+
/*Reverse=*/false, {}, LoadGroup->getDebugLoc());
28012799
L->insertBefore(LoadGroup);
28022800
return L;
28032801
}

llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-metadata.ll

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ define void @load_store_interleave_group_with_metadata(ptr noalias %data) {
1717
; VF2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
1818
; VF2-NEXT: [[TMP0:%.*]] = shl nsw i64 [[INDEX]], 1
1919
; VF2-NEXT: [[TMP1:%.*]] = getelementptr inbounds i64, ptr [[DATA]], i64 [[TMP0]]
20-
; VF2-NEXT: [[WIDE_LOAD:%.*]] = load <2 x i64>, ptr [[TMP1]], align 8, !tbaa [[TBAA0:![0-9]+]]
21-
; VF2-NEXT: store <2 x i64> [[WIDE_LOAD]], ptr [[TMP1]], align 8, !tbaa [[TBAA4:![0-9]+]]
20+
; VF2-NEXT: [[WIDE_LOAD:%.*]] = load <2 x i64>, ptr [[TMP1]], align 8
21+
; VF2-NEXT: store <2 x i64> [[WIDE_LOAD]], ptr [[TMP1]], align 8
2222
; VF2-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 1
2323
; VF2-NEXT: [[TMP2:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100
24-
; VF2-NEXT: br i1 [[TMP2]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP6:![0-9]+]]
24+
; VF2-NEXT: br i1 [[TMP2]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
2525
; VF2: [[MIDDLE_BLOCK]]:
2626
; VF2-NEXT: br i1 true, [[EXIT:label %.*]], label %[[SCALAR_PH]]
2727
; VF2: [[SCALAR_PH]]:
@@ -55,15 +55,9 @@ exit:
5555
!5 = !{ i64 0, i64 2 }
5656

5757
;.
58-
; VF2: [[TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0, i64 0}
59-
; VF2: [[META1]] = !{!"A", [[META2:![0-9]+]]}
60-
; VF2: [[META2]] = !{!"omnipotent char", [[META3:![0-9]+]], i64 0}
61-
; VF2: [[META3]] = !{!"Simple C/C++ TBAA"}
62-
; VF2: [[TBAA4]] = !{[[META5:![0-9]+]], [[META5]], i64 0, i64 0}
63-
; VF2: [[META5]] = !{!"B", [[META2]]}
64-
; VF2: [[LOOP6]] = distinct !{[[LOOP6]], [[META7:![0-9]+]], [[META8:![0-9]+]]}
65-
; VF2: [[META7]] = !{!"llvm.loop.isvectorized", i32 1}
66-
; VF2: [[META8]] = !{!"llvm.loop.unroll.runtime.disable"}
58+
; VF2: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]}
59+
; VF2: [[META1]] = !{!"llvm.loop.isvectorized", i32 1}
60+
; VF2: [[META2]] = !{!"llvm.loop.unroll.runtime.disable"}
6761
;.
6862
; VF4: [[TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0}
6963
; VF4: [[META1]] = !{!"omnipotent char", [[META2:![0-9]+]], i64 0}

0 commit comments

Comments
 (0)