diff options
author | Florian Hahn <florian.hahn@arm.com> | 2018-06-18 11:34:17 +0000 |
---|---|---|
committer | Florian Hahn <florian.hahn@arm.com> | 2018-06-18 11:34:17 +0000 |
commit | 7591e4e94afcaffeeb47df979e5707e8714453a0 (patch) | |
tree | 32b09eb5d9abef432ec67f21ec12a71caa36291b /llvm/lib/Transforms/Vectorize | |
parent | e752fd65e8cbcf960ea9d1287713b5c279fad924 (diff) | |
download | bcm5719-llvm-7591e4e94afcaffeeb47df979e5707e8714453a0.tar.gz bcm5719-llvm-7591e4e94afcaffeeb47df979e5707e8714453a0.zip |
[VPlanRecipeBase] Add insertBefore helper.
Reviewers: dcaballe, mkuper, hfinkel, hsaito, mssimpso
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D48080
llvm-svn: 334933
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlan.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlan.h | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp index 50c71a32385..7d07ae09902 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -220,6 +220,11 @@ void VPRegionBlock::execute(VPTransformState *State) { State->Instance.reset(); } +void VPRecipeBase::insertBefore(VPRecipeBase *InsertPos) { + InsertPos->getParent()->getRecipeList().insert(InsertPos->getIterator(), + this); +} + void VPInstruction::generateInstruction(VPTransformState &State, unsigned Part) { IRBuilder<> &Builder = State.Builder; diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index 6bc49dbbcb6..c19fbe28196 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -552,6 +552,10 @@ public: /// Each recipe prints itself. virtual void print(raw_ostream &O, const Twine &Indent) const = 0; + + /// Insert an unlinked recipe into a basic block immediately before + /// the specified recipe. + void insertBefore(VPRecipeBase *InsertPos); }; /// This is a concrete Recipe that models a single VPlan-level instruction. @@ -923,6 +927,9 @@ public: inline const VPRecipeBase &back() const { return Recipes.back(); } inline VPRecipeBase &back() { return Recipes.back(); } + /// Returns a reference to the list of recipes. + RecipeListTy &getRecipeList() { return Recipes; } + /// Returns a pointer to a member of the recipe list. static RecipeListTy VPBasicBlock::*getSublistAccess(VPRecipeBase *) { return &VPBasicBlock::Recipes; |