diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-02-04 04:14:04 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-02-04 04:14:04 +0000 |
commit | 135cac922c94eecd813fb1fe1a887bff80deb7e0 (patch) | |
tree | 9606a16beedcd7b938ec136207b537530ba02a33 /llvm/lib/Transforms/Vectorize/BBVectorize.cpp | |
parent | 96ed7b62f92f27b9893196d6ae18d93b1f9e8003 (diff) | |
download | bcm5719-llvm-135cac922c94eecd813fb1fe1a887bff80deb7e0.tar.gz bcm5719-llvm-135cac922c94eecd813fb1fe1a887bff80deb7e0.zip |
Boost the effective chain depth of loads and stores.
By default, boost the chain depth contribution of loads and stores. This will allow a load/store pair to vectorize even when it would not otherwise be long enough to satisfy the chain depth requirement.
llvm-svn: 149761
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/BBVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/BBVectorize.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp index ce6e994c463..0780b4489ff 100644 --- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp @@ -104,6 +104,11 @@ AlignedOnly("bb-vectorize-aligned-only", cl::init(false), cl::Hidden, cl::desc("Only generate aligned loads and stores")); static cl::opt<bool> +NoMemOpBoost("bb-vectorize-no-mem-op-boost", + cl::init(false), cl::Hidden, + cl::desc("Don't boost the chain-depth contribution of loads and stores")); + +static cl::opt<bool> FastDep("bb-vectorize-fast-dep", cl::init(false), cl::Hidden, cl::desc("Use a fast instruction dependency analysis")); @@ -340,6 +345,11 @@ namespace { if (isa<InsertElementInst>(V) || isa<ExtractElementInst>(V)) return 0; + // Give a load or store half of the required depth so that load/store + // pairs will vectorize. + if (!NoMemOpBoost && (isa<LoadInst>(V) || isa<StoreInst>(V))) + return ReqChainDepth/2; + return 1; } |