From fc3665c87519850f629c9565535e3be447e10add Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Fri, 13 Apr 2012 20:45:45 +0000 Subject: Add support to BBVectorize for vectorizing selects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154700 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/BBVectorize.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Transforms') 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 +NoSelect("bb-vectorize-no-select", cl::init(false), cl::Hidden, + cl::desc("Don't try to vectorize select instructions")); + +static cl::opt 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(I)) { + if (!Config.VectorizeSelect) + return false; } else if (!(I->isBinaryOp() || isa(I) || isa(I) || isa(I))) { return false; @@ -1894,6 +1901,7 @@ VectorizeConfig::VectorizeConfig() { VectorizeCasts = !::NoCasts; VectorizeMath = !::NoMath; VectorizeFMA = !::NoFMA; + VectorizeSelect = !::NoSelect; VectorizeMemOps = !::NoMemOps; AlignedOnly = ::AlignedOnly; ReqChainDepth= ::ReqChainDepth; -- cgit v1.1