Skip to content

Commit d853b3f

Browse files
committed
[VPlan] Remove unneeded Plan arg from getVPValueOrAddLiveIn (NFC).
The helper can simply use VPRecipeBuilder::Plan.
1 parent 4b6c064 commit d853b3f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7904,7 +7904,7 @@ void EpilogueVectorizerEpilogueLoop::printDebugTracesAtEnd() {
79047904
iterator_range<mapped_iterator<Use *, std::function<VPValue *(Value *)>>>
79057905
VPRecipeBuilder::mapToVPValues(User::op_range Operands) {
79067906
std::function<VPValue *(Value *)> Fn = [this](Value *Op) {
7907-
return getVPValueOrAddLiveIn(Op, Plan);
7907+
return getVPValueOrAddLiveIn(Op);
79087908
};
79097909
return map_range(Operands, Fn);
79107910
}
@@ -7920,7 +7920,7 @@ void VPRecipeBuilder::createSwitchEdgeMasks(SwitchInst *SI) {
79207920
// Create masks where the terminator in Src is a switch. We create mask for
79217921
// all edges at the same time. This is more efficient, as we can create and
79227922
// collect compares for all cases once.
7923-
VPValue *Cond = getVPValueOrAddLiveIn(SI->getCondition(), Plan);
7923+
VPValue *Cond = getVPValueOrAddLiveIn(SI->getCondition());
79247924
BasicBlock *DefaultDst = SI->getDefaultDest();
79257925
MapVector<BasicBlock *, SmallVector<VPValue *>> Dst2Compares;
79267926
for (auto &C : SI->cases()) {
@@ -7931,7 +7931,7 @@ void VPRecipeBuilder::createSwitchEdgeMasks(SwitchInst *SI) {
79317931
if (Dst == DefaultDst)
79327932
continue;
79337933
auto I = Dst2Compares.insert({Dst, {}});
7934-
VPValue *V = getVPValueOrAddLiveIn(C.getCaseValue(), Plan);
7934+
VPValue *V = getVPValueOrAddLiveIn(C.getCaseValue());
79357935
I.first->second.push_back(Builder.createICmp(CmpInst::ICMP_EQ, Cond, V));
79367936
}
79377937

@@ -7994,7 +7994,7 @@ VPValue *VPRecipeBuilder::createEdgeMask(BasicBlock *Src, BasicBlock *Dst) {
79947994
if (OrigLoop->isLoopExiting(Src))
79957995
return EdgeMaskCache[Edge] = SrcMask;
79967996

7997-
VPValue *EdgeMask = getVPValueOrAddLiveIn(BI->getCondition(), Plan);
7997+
VPValue *EdgeMask = getVPValueOrAddLiveIn(BI->getCondition());
79987998
assert(EdgeMask && "No Edge Mask found for condition");
79997999

80008000
if (BI->getSuccessor(0) != Dst)
@@ -8605,7 +8605,7 @@ static MapVector<PHINode *, VPValue *> collectUsersInExitBlock(
86058605
for (PHINode &ExitPhi : ExitBB->phis()) {
86068606
Value *IncomingValue =
86078607
ExitPhi.getIncomingValueForBlock(ExitingBB);
8608-
VPValue *V = Builder.getVPValueOrAddLiveIn(IncomingValue, Plan);
8608+
VPValue *V = Builder.getVPValueOrAddLiveIn(IncomingValue);
86098609
// Exit values for inductions are computed and updated outside of VPlan and
86108610
// independent of induction recipes.
86118611
// TODO: Compute induction exit values in VPlan, use VPLiveOuts to update

llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class VPRecipeBuilder {
168168
iterator_range<mapped_iterator<Use *, std::function<VPValue *(Value *)>>>
169169
mapToVPValues(User::op_range Operands);
170170

171-
VPValue *getVPValueOrAddLiveIn(Value *V, VPlan &Plan) {
171+
VPValue *getVPValueOrAddLiveIn(Value *V) {
172172
if (auto *I = dyn_cast<Instruction>(V)) {
173173
if (auto *R = Ingredient2Recipe.lookup(I))
174174
return R->getVPSingleValue();

0 commit comments

Comments
 (0)