summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/VecUtils.h
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-06-20 17:41:45 +0000
committerNadav Rotem <nrotem@apple.com>2013-06-20 17:41:45 +0000
commit14a89c5428666eac2659caa73182691e9a88bcf9 (patch)
tree35cebe5d8366e8b29e51028941cfa3adf5176a8d /llvm/lib/Transforms/Vectorize/VecUtils.h
parent8300e1299116ed89ae81609d453756cfeb4084d3 (diff)
downloadbcm5719-llvm-14a89c5428666eac2659caa73182691e9a88bcf9.tar.gz
bcm5719-llvm-14a89c5428666eac2659caa73182691e9a88bcf9.zip
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. llvm-svn: 184444
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VecUtils.h')
-rw-r--r--llvm/lib/Transforms/Vectorize/VecUtils.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VecUtils.h b/llvm/lib/Transforms/Vectorize/VecUtils.h
index f76ae8413d7..28a61e3c0dd 100644
--- a/llvm/lib/Transforms/Vectorize/VecUtils.h
+++ b/llvm/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;
OpenPOWER on IntegriCloud