LLVM  8.0.1
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 /// Vectorize configuration.
26  //===--------------------------------------------------------------------===//
27  // Target architecture related parameters
28 
29  /// The size of the native vector registers.
30  unsigned VectorBits;
31 
32  /// Vectorize boolean values.
34 
35  /// Vectorize integer values.
37 
38  /// Vectorize floating-point values.
40 
41  /// Vectorize pointer values.
43 
44  /// Vectorize casting (conversion) operations.
46 
47  /// Vectorize floating-point math intrinsics.
49 
50  /// Vectorize bit intrinsics.
52 
53  /// Vectorize the fused-multiply-add intrinsic.
55 
56  /// Vectorize select instructions.
58 
59  /// Vectorize comparison instructions.
61 
62  /// Vectorize getelementptr instructions.
64 
65  /// Vectorize loads and stores.
67 
68  /// Only generate aligned loads and stores.
70 
71  //===--------------------------------------------------------------------===//
72  // Misc parameters
73 
74  /// The required chain depth for vectorization.
75  unsigned ReqChainDepth;
76 
77  /// The maximum search distance for instruction pairs.
78  unsigned SearchLimit;
79 
80  /// The maximum number of candidate pairs with which to use a full
81  /// cycle check.
83 
84  /// Replicating one element to a pair breaks the chain.
86 
87  /// The maximum number of pairable instructions per group.
88  unsigned MaxInsts;
89 
90  /// The maximum number of candidate instruction pairs per group.
91  unsigned MaxPairs;
92 
93  /// The maximum number of pairing iterations.
94  unsigned MaxIter;
95 
96  /// Don't try to form odd-length vectors.
98 
99  /// Don't boost the chain-depth contribution of loads and stores.
101 
102  /// Use a fast instruction dependency analysis.
103  bool FastDep;
104 
105  /// Initialize the VectorizeConfig from command line options.
106  VectorizeConfig();
107 };
108 
109 //===----------------------------------------------------------------------===//
110 //
111 // LoopVectorize - Create a loop vectorization pass.
112 //
113 Pass *createLoopVectorizePass(bool InterleaveOnlyWhenForced = false,
114  bool VectorizeOnlyWhenForced = false);
115 
116 //===----------------------------------------------------------------------===//
117 //
118 // SLPVectorizer - Create a bottom-up SLP vectorizer pass.
119 //
121 
122 //===----------------------------------------------------------------------===//
123 /// Vectorize the BasicBlock.
124 ///
125 /// @param BB The BasicBlock to be vectorized
126 /// @param P The current running pass, should require AliasAnalysis and
127 /// ScalarEvolution. After the vectorization, AliasAnalysis,
128 /// ScalarEvolution and CFG are preserved.
129 ///
130 /// @return True if the BB is changed, false otherwise.
131 ///
133  const VectorizeConfig &C = VectorizeConfig());
134 
135 //===----------------------------------------------------------------------===//
136 //
137 // LoadStoreVectorizer - Create vector loads and stores, but leave scalar
138 // operations.
139 //
141 
142 } // End llvm namespace
143 
144 #endif
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:81
uint64_t CallInst * C
bool VectorizeFMA
Vectorize the fused-multiply-add intrinsic.
Definition: Vectorize.h:54
This class represents lattice values for constants.
Definition: AllocatorList.h:24
Various leaf nodes.
Definition: ISDOpcodes.h:60
Pass * createLoopVectorizePass(bool InterleaveOnlyWhenForced=false, bool VectorizeOnlyWhenForced=false)
bool VectorizeMath
Vectorize floating-point math intrinsics.
Definition: Vectorize.h:48
unsigned MaxCandPairsForCycleCheck
The maximum number of candidate pairs with which to use a full cycle check.
Definition: Vectorize.h:82
bool Pow2LenOnly
Don't try to form odd-length vectors.
Definition: Vectorize.h:97
VectorizeConfig()
Initialize the VectorizeConfig from command line options.
Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
bool VectorizePointers
Vectorize pointer values.
Definition: Vectorize.h:42
bool VectorizeCmp
Vectorize comparison instructions.
Definition: Vectorize.h:60
unsigned MaxIter
The maximum number of pairing iterations.
Definition: Vectorize.h:94
bool VectorizeMemOps
Vectorize loads and stores.
Definition: Vectorize.h:66
#define P(N)
bool AlignedOnly
Only generate aligned loads and stores.
Definition: Vectorize.h:69
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
bool SplatBreaksChain
Replicating one element to a pair breaks the chain.
Definition: Vectorize.h:85
unsigned SearchLimit
The maximum search distance for instruction pairs.
Definition: Vectorize.h:78
unsigned MaxPairs
The maximum number of candidate instruction pairs per group.
Definition: Vectorize.h:91
print lazy value Lazy Value Info Printer Pass
bool VectorizeFloats
Vectorize floating-point values.
Definition: Vectorize.h:39
bool vectorizeBasicBlock(Pass *P, BasicBlock &BB, const VectorizeConfig &C=VectorizeConfig())
Vectorize the BasicBlock.
bool FastDep
Use a fast instruction dependency analysis.
Definition: Vectorize.h:103
Vectorize configuration.
Definition: Vectorize.h:25
bool VectorizeCasts
Vectorize casting (conversion) operations.
Definition: Vectorize.h:45
bool VectorizeBools
Vectorize boolean values.
Definition: Vectorize.h:33
unsigned ReqChainDepth
The required chain depth for vectorization.
Definition: Vectorize.h:75
unsigned MaxInsts
The maximum number of pairable instructions per group.
Definition: Vectorize.h:88
bool NoMemOpBoost
Don't boost the chain-depth contribution of loads and stores.
Definition: Vectorize.h:100
bool VectorizeGEP
Vectorize getelementptr instructions.
Definition: Vectorize.h:63
Pass * createSLPVectorizerPass()
bool VectorizeInts
Vectorize integer values.
Definition: Vectorize.h:36
bool VectorizeBitManipulations
Vectorize bit intrinsics.
Definition: Vectorize.h:51
bool VectorizeSelect
Vectorize select instructions.
Definition: Vectorize.h:57
unsigned VectorBits
The size of the native vector registers.
Definition: Vectorize.h:30