[PATCH] D121621: [VPlan] Track current vector loop in VPTransformState (NFC).
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 30 14:17:06 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe4543af4e639: [VPlan] Track current vector loop in VPTransformState (NFC). (authored by fhahn).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121621/new/
https://reviews.llvm.org/D121621
Files:
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
Index: llvm/lib/Transforms/Vectorize/VPlan.h
===================================================================
--- llvm/lib/Transforms/Vectorize/VPlan.h
+++ llvm/lib/Transforms/Vectorize/VPlan.h
@@ -352,6 +352,9 @@
/// Holds recipes that may generate a poison value that is used after
/// vectorization, even when their operands are not poison.
SmallPtrSet<VPRecipeBase *, 16> MayGeneratePoisonRecipes;
+
+ /// The loop object for the current parent region, or nullptr.
+ Loop *CurrentVectorLoop = nullptr;
};
/// VPUsers instance used by VPBlockBase to manage CondBit and the block
Index: llvm/lib/Transforms/Vectorize/VPlan.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -319,8 +319,7 @@
UnreachableInst *Terminator = State->Builder.CreateUnreachable();
State->Builder.SetInsertPoint(Terminator);
// Register NewBB in its loop. In innermost loops its the same for all BB's.
- Loop *L = State->LI->getLoopFor(State->CFG.PrevBB);
- L->addBasicBlockToLoop(NewBB, *State->LI);
+ State->CurrentVectorLoop->addBasicBlockToLoop(NewBB, *State->LI);
State->CFG.PrevBB = NewBB;
}
@@ -909,6 +908,7 @@
assert(VectorHeaderBB && "Loop preheader does not have a single successor.");
Loop *L = State->LI->getLoopFor(VectorHeaderBB);
+ State->CurrentVectorLoop = L;
State->CFG.ExitBB = L->getExitBlock();
// Remove the edge between Header and Latch to allow other connections.
@@ -1543,7 +1543,7 @@
ScalarPHI ? PN->getType() : VectorType::get(PN->getType(), State.VF);
BasicBlock *HeaderBB = State.CFG.PrevBB;
- assert(State.LI->getLoopFor(HeaderBB)->getHeader() == HeaderBB &&
+ assert(State.CurrentVectorLoop->getHeader() == HeaderBB &&
"recipe must be in the vector loop header");
unsigned LastPartForNewPhi = isOrdered() ? 1 : State.UF;
for (unsigned Part = 0; Part < LastPartForNewPhi; ++Part) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121621.419267.patch
Type: text/x-patch
Size: 2000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220330/29760162/attachment.bin>
More information about the llvm-commits
mailing list