summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/VPlan.h
diff options
context:
space:
mode:
authorGil Rapaport <gil.rapaport@intel.com>2019-10-07 17:24:33 +0300
committerGil Rapaport <gil.rapaport@intel.com>2019-11-08 15:25:14 +0200
commit11ed1c0239fd51fd2f064311dc7725277ed0a994 (patch)
tree1e03c667e18d66f1af25d83d4a00545e79216a40 /llvm/lib/Transforms/Vectorize/VPlan.h
parentef459dedcafbdfda630c884f788a6b53ee9ee30c (diff)
downloadbcm5719-llvm-11ed1c0239fd51fd2f064311dc7725277ed0a994.tar.gz
bcm5719-llvm-11ed1c0239fd51fd2f064311dc7725277ed0a994.zip
[LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)
This recommits 100e797adb433724a17c9b42b6533cd634cb796b (reverted in 009e032634b3bd7fc32071ac2344b12142286477 for failing an assert). While the root cause was independently reverted in eaff3004019f97c64c88ab76da6b25106b659b30, this commit includes a LIT to make sure IVDescriptor's SinkAfter logic does not try to sink branch instructions.
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlan.h')
-rw-r--r--llvm/lib/Transforms/Vectorize/VPlan.h16
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;
OpenPOWER on IntegriCloud