diff options
| author | Nadav Rotem <nrotem@apple.com> | 2013-06-20 17:41:45 +0000 |
|---|---|---|
| committer | Nadav Rotem <nrotem@apple.com> | 2013-06-20 17:41:45 +0000 |
| commit | d69d9f20bc3acee0fc233853745c1de015b541f2 (patch) | |
| tree | 79bbff6bc1c3000b7dc9dd421c0f9b88328fe8d5 /lib/Transforms/Vectorize/VecUtils.h | |
| parent | 63b8e299e47e9511e8bdb8a3a3c53674aa86813a (diff) | |
| download | external_llvm-d69d9f20bc3acee0fc233853745c1de015b541f2.zip external_llvm-d69d9f20bc3acee0fc233853745c1de015b541f2.tar.gz external_llvm-d69d9f20bc3acee0fc233853745c1de015b541f2.tar.bz2 | |
SLPVectorization: Add a basic support for cross-basic block slp vectorization.
We collect gather sequences when we vectorize basic blocks. Gather sequences are excellent
hints for vectorization of other basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/VecUtils.h')
| -rw-r--r-- | lib/Transforms/Vectorize/VecUtils.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Transforms/Vectorize/VecUtils.h b/lib/Transforms/Vectorize/VecUtils.h index f76ae84..28a61e3 100644 --- a/lib/Transforms/Vectorize/VecUtils.h +++ b/lib/Transforms/Vectorize/VecUtils.h @@ -34,6 +34,7 @@ class Loop; /// Bottom Up SLP vectorization utility class. struct BoUpSLP { typedef SmallVector<Value*, 8> ValueList; + typedef SmallVector<Instruction*, 16> InstrList; typedef SmallPtrSet<Value*, 16> ValueSet; typedef SmallVector<StoreInst*, 8> StoreList; static const int max_cost = 1<<20; @@ -78,7 +79,7 @@ struct BoUpSLP { /// \returns the list of new instructions that were added in order to collect /// scalars into vectors. This list can be used to further optimize the gather /// sequences. - ValueList &getGatherSeqInstructions() {return GatherInstructions; } + InstrList &getGatherSeqInstructions() {return GatherInstructions; } private: /// \brief This method contains the recursive part of getTreeCost. @@ -166,7 +167,9 @@ private: /// A list of instructions that are used when gathering scalars into vectors. /// In many cases these instructions can be hoisted outside of the BB. /// Iterating over this list is faster than calling LICM. - ValueList GatherInstructions; + /// Notice: We insert NULL ptrs to separate between the different gather + /// sequences. + InstrList GatherInstructions; /// Instruction builder to construct the vectorized tree. IRBuilder<> Builder; |
