diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2012-06-24 13:28:01 +0000 | 
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2012-06-24 13:28:01 +0000 | 
| commit | 3099ce94892a477b988616800fe703f76e1d4461 (patch) | |
| tree | be281d1a1cacf6ef4eae3ac7b96ab0d5eed7fe15 /llvm/lib/Transforms | |
| parent | 0a045bbe4e32e558da7561393f39cb907c0a4530 (diff) | |
| download | bcm5719-llvm-3099ce94892a477b988616800fe703f76e1d4461.tar.gz bcm5719-llvm-3099ce94892a477b988616800fe703f76e1d4461.zip  | |
Allow controlling vectorization of boolean values separately from other integer types.
These are used as the result of comparisons, and often handled differently from larger integer types.
llvm-svn: 159111
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/BBVectorize.cpp | 18 | 
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp index 55e0da7ac0a..85187310dd8 100644 --- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp @@ -77,6 +77,10 @@ MaxCandPairsForCycleCheck("bb-vectorize-max-cycle-check-pairs", cl::init(200),                         " a full cycle check"));  static cl::opt<bool> +NoBools("bb-vectorize-no-bools", cl::init(false), cl::Hidden, +  cl::desc("Don't try to vectorize boolean (i1) values")); + +static cl::opt<bool>  NoInts("bb-vectorize-no-ints", cl::init(false), cl::Hidden,    cl::desc("Don't try to vectorize integer values")); @@ -614,10 +618,15 @@ namespace {          !(VectorType::isValidElementType(T2) || T2->isVectorTy()))        return false; -    if (!Config.VectorizeInts -        && (T1->isIntOrIntVectorTy() || T2->isIntOrIntVectorTy())) -      return false; - +    if (T1->getScalarSizeInBits() == 1 && T2->getScalarSizeInBits() == 1) { +      if (!Config.VectorizeBools) +        return false; +    } else { +      if (!Config.VectorizeInts +          && (T1->isIntOrIntVectorTy() || T2->isIntOrIntVectorTy())) +        return false; +    } +        if (!Config.VectorizeFloats          && (T1->isFPOrFPVectorTy() || T2->isFPOrFPVectorTy()))        return false; @@ -1990,6 +1999,7 @@ llvm::vectorizeBasicBlock(Pass *P, BasicBlock &BB, const VectorizeConfig &C) {  //===----------------------------------------------------------------------===//  VectorizeConfig::VectorizeConfig() {    VectorBits = ::VectorBits; +  VectorizeBools = !::NoBools;    VectorizeInts = !::NoInts;    VectorizeFloats = !::NoFloats;    VectorizePointers = !::NoPointers;  | 

