LLVM  4.0.0
Transforms/Vectorize.h
Go to the documentation of this file.
1 //===-- Vectorize.h - Vectorization Transformations -------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header file defines prototypes for accessor functions that expose passes
11 // in the Vectorize transformations library.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_TRANSFORMS_VECTORIZE_H
16 #define LLVM_TRANSFORMS_VECTORIZE_H
17 
18 namespace llvm {
19 class BasicBlock;
20 class BasicBlockPass;
21 class Pass;
22 
23 //===----------------------------------------------------------------------===//
24 /// @brief Vectorize configuration.
26  //===--------------------------------------------------------------------===//
27  // Target architecture related parameters
28 
29  /// @brief The size of the native vector registers.
30  unsigned VectorBits;
31 
32  /// @brief Vectorize boolean values.
34 
35  /// @brief Vectorize integer values.
37 
38  /// @brief Vectorize floating-point values.
40 
41  /// @brief Vectorize pointer values.
43 
44  /// @brief Vectorize casting (conversion) operations.
46 
47  /// @brief Vectorize floating-point math intrinsics.
49 
50  /// @brief Vectorize bit intrinsics.
52 
53  /// @brief Vectorize the fused-multiply-add intrinsic.
55 
56  /// @brief Vectorize select instructions.
58 
59  /// @brief Vectorize comparison instructions.
61 
62  /// @brief Vectorize getelementptr instructions.
64 
65  /// @brief Vectorize loads and stores.
67 
68  /// @brief Only generate aligned loads and stores.
70 
71  //===--------------------------------------------------------------------===//
72  // Misc parameters
73 
74  /// @brief The required chain depth for vectorization.
75  unsigned ReqChainDepth;
76 
77  /// @brief The maximum search distance for instruction pairs.
78  unsigned SearchLimit;
79 
80  /// @brief The maximum number of candidate pairs with which to use a full
81  /// cycle check.
83 
84  /// @brief Replicating one element to a pair breaks the chain.
86 
87  /// @brief The maximum number of pairable instructions per group.
88  unsigned MaxInsts;
89 
90  /// @brief The maximum number of candidate instruction pairs per group.
91  unsigned MaxPairs;
92 
93  /// @brief The maximum number of pairing iterations.
94  unsigned MaxIter;
95 
96  /// @brief Don't try to form odd-length vectors.
98 
99  /// @brief Don't boost the chain-depth contribution of loads and stores.
101 
102  /// @brief Use a fast instruction dependency analysis.
103  bool FastDep;
104 
105  /// @brief Initialize the VectorizeConfig from command line options.
106  VectorizeConfig();
107 };
108 
109 //===----------------------------------------------------------------------===//
110 //
111 // BBVectorize - A basic-block vectorization pass.
112 //
115 
116 //===----------------------------------------------------------------------===//
117 //
118 // LoopVectorize - Create a loop vectorization pass.
119 //
120 Pass *createLoopVectorizePass(bool NoUnrolling = false,
121  bool AlwaysVectorize = true);
122 
123 //===----------------------------------------------------------------------===//
124 //
125 // SLPVectorizer - Create a bottom-up SLP vectorizer pass.
126 //
128 
129 //===----------------------------------------------------------------------===//
130 /// @brief Vectorize the BasicBlock.
131 ///
132 /// @param BB The BasicBlock to be vectorized
133 /// @param P The current running pass, should require AliasAnalysis and
134 /// ScalarEvolution. After the vectorization, AliasAnalysis,
135 /// ScalarEvolution and CFG are preserved.
136 ///
137 /// @return True if the BB is changed, false otherwise.
138 ///
140  const VectorizeConfig &C = VectorizeConfig());
141 
142 //===----------------------------------------------------------------------===//
143 //
144 // LoadStoreVectorizer - Create vector loads and stores, but leave scalar
145 // operations.
146 //
148 
149 } // End llvm namespace
150 
151 #endif
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:81
bool VectorizeFMA
Vectorize the fused-multiply-add intrinsic.
Various leaf nodes.
Definition: ISDOpcodes.h:60
aarch64 AArch64 CCMP Pass
bool VectorizeMath
Vectorize floating-point math intrinsics.
unsigned MaxCandPairsForCycleCheck
The maximum number of candidate pairs with which to use a full cycle check.
Pass * createLoadStoreVectorizerPass()
bool Pow2LenOnly
Don't try to form odd-length vectors.
Pass * createLoopVectorizePass(bool NoUnrolling=false, bool AlwaysVectorize=true)
bool VectorizePointers
Vectorize pointer values.
bool VectorizeCmp
Vectorize comparison instructions.
unsigned MaxIter
The maximum number of pairing iterations.
bool VectorizeMemOps
Vectorize loads and stores.
#define P(N)
bool AlignedOnly
Only generate aligned loads and stores.
LLVM Basic Block Representation.
Definition: BasicBlock.h:51
bool SplatBreaksChain
Replicating one element to a pair breaks the chain.
unsigned SearchLimit
The maximum search distance for instruction pairs.
BasicBlockPass class - This class is used to implement most local optimizations.
Definition: Pass.h:335
unsigned MaxPairs
The maximum number of candidate instruction pairs per group.
bool VectorizeFloats
Vectorize floating-point values.
bool vectorizeBasicBlock(Pass *P, BasicBlock &BB, const VectorizeConfig &C=VectorizeConfig())
Vectorize the BasicBlock.
bool FastDep
Use a fast instruction dependency analysis.
Vectorize configuration.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
bool VectorizeCasts
Vectorize casting (conversion) operations.
BasicBlockPass * createBBVectorizePass(const VectorizeConfig &C=VectorizeConfig())
bool VectorizeBools
Vectorize boolean values.
unsigned ReqChainDepth
The required chain depth for vectorization.
unsigned MaxInsts
The maximum number of pairable instructions per group.
bool NoMemOpBoost
Don't boost the chain-depth contribution of loads and stores.
bool VectorizeGEP
Vectorize getelementptr instructions.
VectorizeConfig()
Initialize the VectorizeConfig from command line options.
Pass * createSLPVectorizerPass()
bool VectorizeInts
Vectorize integer values.
bool VectorizeBitManipulations
Vectorize bit intrinsics.
bool VectorizeSelect
Vectorize select instructions.
unsigned VectorBits
The size of the native vector registers.