diff options
author | Gil Rapaport <gil.rapaport@intel.com> | 2019-10-07 17:24:33 +0300 |
---|---|---|
committer | Gil Rapaport <gil.rapaport@intel.com> | 2019-11-04 10:37:39 +0200 |
commit | 2be17087f8c38934b7fc9208ae6cf4e9b4d44f4b (patch) | |
tree | d594ca90c7d5e2070d833cdf1d93fc274997076d /llvm/lib/Transforms/Vectorize/VPlan.h | |
parent | 848007cfbc7509543c5b8604ae063bb6c8ffa0a9 (diff) | |
download | bcm5719-llvm-2be17087f8c38934b7fc9208ae6cf4e9b4d44f4b.tar.gz bcm5719-llvm-2be17087f8c38934b7fc9208ae6cf4e9b4d44f4b.zip |
[LV] Apply sink-after & interleave-groups as VPlan transformations (NFC)
The sink-after and interleave-group vectorization decisions were so far applied to
VPlan during initial VPlan construction, which complicates VPlan construction – also because of
their inter-dependence. This patch refactors buildVPlanWithRecipes() to construct a simpler
initial VPlan and later apply both these vectorization decisions, in order, as VPlan-to-VPlan
transformations.
Differential Revision: https://reviews.llvm.org/D68577
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlan.h')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlan.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index 6eeec0f21fd..226c6c0279d 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -567,6 +567,7 @@ public: /// instructions. class VPRecipeBase : public ilist_node_with_parent<VPRecipeBase, VPBasicBlock> { friend VPBasicBlock; + friend class VPBlockUtils; private: const unsigned char SubclassID; ///< Subclass identifier (for isa/dyn_cast). @@ -615,10 +616,18 @@ public: /// the specified recipe. void insertBefore(VPRecipeBase *InsertPos); + /// Insert an unlinked Recipe into a basic block immediately after + /// the specified Recipe. + void insertAfter(VPRecipeBase *InsertPos); + /// Unlink this recipe from its current VPBasicBlock and insert it into /// the VPBasicBlock that MovePos lives in, right after MovePos. void moveAfter(VPRecipeBase *MovePos); + /// This method unlinks 'this' from the containing basic block, but does not + /// delete it. + void removeFromParent(); + /// This method unlinks 'this' from the containing basic block and deletes it. /// /// \returns an iterator pointing to the element after the erased one @@ -973,6 +982,13 @@ public: return V->getVPRecipeID() == VPRecipeBase::VPWidenMemoryInstructionSC; } + /// Return the mask used by this recipe. Note that a full mask is represented + /// by a nullptr. + VPValue *getMask() { + // Mask is the last operand. + return User ? User->getOperand(User->getNumOperands() - 1) : nullptr; + } + /// Generate the wide load/store. void execute(VPTransformState &State) override; |