diff options
author | Hongbin Zheng <etherzhhb@gmail.com> | 2012-04-05 15:46:55 +0000 |
---|---|---|
committer | Hongbin Zheng <etherzhhb@gmail.com> | 2012-04-05 15:46:55 +0000 |
commit | bef377b7d7ce31edb40c87f8786d1b7bb6cdd6b1 (patch) | |
tree | a730cfaadaf3916d0e0d3ee6ffa45489887e71de /include/llvm/Transforms/Vectorize.h | |
parent | 17dcaf5ef9e761bd3b516a3f4cb85a9fdcb5975e (diff) | |
download | external_llvm-bef377b7d7ce31edb40c87f8786d1b7bb6cdd6b1.tar.gz external_llvm-bef377b7d7ce31edb40c87f8786d1b7bb6cdd6b1.tar.bz2 external_llvm-bef377b7d7ce31edb40c87f8786d1b7bb6cdd6b1.zip |
Introduce the VectorizeConfig class, with which we can control the behavior
of the BBVectorizePass without using command line option. As pointed out
by Hal, we can ask the TargetLoweringInfo for the architecture specific
VectorizeConfig to perform vectorizing with architecture specific
information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Vectorize.h')
-rw-r--r-- | include/llvm/Transforms/Vectorize.h | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/include/llvm/Transforms/Vectorize.h b/include/llvm/Transforms/Vectorize.h index ad06937caa..669125845f 100644 --- a/include/llvm/Transforms/Vectorize.h +++ b/include/llvm/Transforms/Vectorize.h @@ -20,10 +20,73 @@ class BasicBlock; class BasicBlockPass; //===----------------------------------------------------------------------===// +/// @brief Vectorize configuration. +struct VectorizeConfig { + //===--------------------------------------------------------------------===// + // Target architecture related parameters + + /// @brief The size of the native vector registers. + unsigned VectorBits; + + /// @brief Don't try to vectorize integer values. + bool NoInts; + + /// @brief Don't try to vectorize floating-point values. + bool NoFloats; + + /// @brief Don't try to vectorize casting (conversion) operations. + bool NoCasts; + + /// @brief Don't try to vectorize floating-point math intrinsics. + bool NoMath; + + /// @brief Don't try to vectorize the fused-multiply-add intrinsic. + bool NoFMA; + + /// @brief Don't try to vectorize loads and stores. + bool NoMemOps; + + /// @brief Only generate aligned loads and stores. + bool AlignedOnly; + + //===--------------------------------------------------------------------===// + // Misc parameters + + /// @brief The required chain depth for vectorization. + unsigned ReqChainDepth; + + /// @brief The maximum search distance for instruction pairs. + unsigned SearchLimit; + + /// @brief The maximum number of candidate pairs with which to use a full + /// cycle check. + unsigned MaxCandPairsForCycleCheck; + + /// @brief Replicating one element to a pair breaks the chain. + bool SplatBreaksChain; + + /// @brief The maximum number of pairable instructions per group. + unsigned MaxInsts; + + /// @brief The maximum number of pairing iterations. + unsigned MaxIter; + + /// @brief Don't boost the chain-depth contribution of loads and stores. + bool NoMemOpBoost; + + /// @brief Use a fast instruction dependency analysis. + bool FastDep; + + /// @brief Initialize the VectorizeConfig from command line options. + VectorizeConfig(); +}; + +//===----------------------------------------------------------------------===// // // BBVectorize - A basic-block vectorization pass. // -BasicBlockPass *createBBVectorizePass(); +BasicBlockPass * +createBBVectorizePass(const VectorizeConfig &C = VectorizeConfig()); //===----------------------------------------------------------------------===// /// @brief Vectorize the BasicBlock. @@ -35,7 +98,8 @@ BasicBlockPass *createBBVectorizePass(); /// /// @return True if the BB is changed, false otherwise. /// -bool vectorizeBasicBlock(Pass *P, BasicBlock &BB); +bool vectorizeBasicBlock(Pass *P, BasicBlock &BB, + const VectorizeConfig &C = VectorizeConfig()); } // End llvm namespace |