diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-04-13 20:45:45 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-04-13 20:45:45 +0000 |
commit | fc3665c87519850f629c9565535e3be447e10add (patch) | |
tree | 1b11b5add5b97ad8f14fda8f200f22e2774d24f2 /lib/Transforms | |
parent | 8800cada206d6f2eda1d54b2a40f4403e9e522bc (diff) | |
download | external_llvm-fc3665c87519850f629c9565535e3be447e10add.zip external_llvm-fc3665c87519850f629c9565535e3be447e10add.tar.gz external_llvm-fc3665c87519850f629c9565535e3be447e10add.tar.bz2 |
Add support to BBVectorize for vectorizing selects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Vectorize/BBVectorize.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp index 286b54f..b2f8c8f 100644 --- a/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/lib/Transforms/Vectorize/BBVectorize.cpp @@ -96,6 +96,10 @@ NoFMA("bb-vectorize-no-fma", cl::init(false), cl::Hidden, cl::desc("Don't try to vectorize the fused-multiply-add intrinsic")); static cl::opt<bool> +NoSelect("bb-vectorize-no-select", cl::init(false), cl::Hidden, + cl::desc("Don't try to vectorize select instructions")); + +static cl::opt<bool> NoMemOps("bb-vectorize-no-mem-ops", cl::init(false), cl::Hidden, cl::desc("Don't try to vectorize loads and stores")); @@ -552,6 +556,9 @@ namespace { Type *DestTy = C->getDestTy(); if (!DestTy->isSingleValueType() || DestTy->isPointerTy()) return false; + } else if (isa<SelectInst>(I)) { + if (!Config.VectorizeSelect) + return false; } else if (!(I->isBinaryOp() || isa<ShuffleVectorInst>(I) || isa<ExtractElementInst>(I) || isa<InsertElementInst>(I))) { return false; @@ -1894,6 +1901,7 @@ VectorizeConfig::VectorizeConfig() { VectorizeCasts = !::NoCasts; VectorizeMath = !::NoMath; VectorizeFMA = !::NoFMA; + VectorizeSelect = !::NoSelect; VectorizeMemOps = !::NoMemOps; AlignedOnly = ::AlignedOnly; ReqChainDepth= ::ReqChainDepth; |