LLVM  9.0.0svn
Vectorize.h
Go to the documentation of this file.
1 //===-- Vectorize.h - Vectorization Transformations -------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This header file defines prototypes for accessor functions that expose passes
10 // in the Vectorize transformations library.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TRANSFORMS_VECTORIZE_H
15 #define LLVM_TRANSFORMS_VECTORIZE_H
16 
17 namespace llvm {
18 class BasicBlock;
19 class BasicBlockPass;
20 class Pass;
21 
22 //===----------------------------------------------------------------------===//
23 /// Vectorize configuration.
25  //===--------------------------------------------------------------------===//
26  // Target architecture related parameters
27 
28  /// The size of the native vector registers.
29  unsigned VectorBits;
30 
31  /// Vectorize boolean values.
33 
34  /// Vectorize integer values.
36 
37  /// Vectorize floating-point values.
39 
40  /// Vectorize pointer values.
42 
43  /// Vectorize casting (conversion) operations.
45 
46  /// Vectorize floating-point math intrinsics.
48 
49  /// Vectorize bit intrinsics.
51 
52  /// Vectorize the fused-multiply-add intrinsic.
54 
55  /// Vectorize select instructions.
57 
58  /// Vectorize comparison instructions.
60 
61  /// Vectorize getelementptr instructions.
63 
64  /// Vectorize loads and stores.
66 
67  /// Only generate aligned loads and stores.
69 
70  //===--------------------------------------------------------------------===//
71  // Misc parameters
72 
73  /// The required chain depth for vectorization.
74  unsigned ReqChainDepth;
75 
76  /// The maximum search distance for instruction pairs.
77  unsigned SearchLimit;
78 
79  /// The maximum number of candidate pairs with which to use a full
80  /// cycle check.
82 
83  /// Replicating one element to a pair breaks the chain.
85 
86  /// The maximum number of pairable instructions per group.
87  unsigned MaxInsts;
88 
89  /// The maximum number of candidate instruction pairs per group.
90  unsigned MaxPairs;
91 
92  /// The maximum number of pairing iterations.
93  unsigned MaxIter;
94 
95  /// Don't try to form odd-length vectors.
97 
98  /// Don't boost the chain-depth contribution of loads and stores.
100 
101  /// Use a fast instruction dependency analysis.
102  bool FastDep;
103 
104  /// Initialize the VectorizeConfig from command line options.
105  VectorizeConfig();
106 };
107 
108 //===----------------------------------------------------------------------===//
109 //
110 // LoopVectorize - Create a loop vectorization pass.
111 //
113 Pass *createLoopVectorizePass(bool InterleaveOnlyWhenForced,
114  bool VectorizeOnlyWhenForced);
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:80
uint64_t CallInst * C
bool VectorizeFMA
Vectorize the fused-multiply-add intrinsic.
Definition: Vectorize.h:53
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Various leaf nodes.
Definition: ISDOpcodes.h:59
Pass * createLoopVectorizePass()
bool VectorizeMath
Vectorize floating-point math intrinsics.
Definition: Vectorize.h:47
unsigned MaxCandPairsForCycleCheck
The maximum number of candidate pairs with which to use a full cycle check.
Definition: Vectorize.h:81
bool Pow2LenOnly
Don't try to form odd-length vectors.
Definition: Vectorize.h:96
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:41
bool VectorizeCmp
Vectorize comparison instructions.
Definition: Vectorize.h:59
unsigned MaxIter
The maximum number of pairing iterations.
Definition: Vectorize.h:93
bool VectorizeMemOps
Vectorize loads and stores.
Definition: Vectorize.h:65
#define P(N)
bool AlignedOnly
Only generate aligned loads and stores.
Definition: Vectorize.h:68
LLVM Basic Block Representation.
Definition: BasicBlock.h:57
bool SplatBreaksChain
Replicating one element to a pair breaks the chain.
Definition: Vectorize.h:84
unsigned SearchLimit
The maximum search distance for instruction pairs.
Definition: Vectorize.h:77
unsigned MaxPairs
The maximum number of candidate instruction pairs per group.
Definition: Vectorize.h:90
print lazy value Lazy Value Info Printer Pass
bool VectorizeFloats
Vectorize floating-point values.
Definition: Vectorize.h:38
bool vectorizeBasicBlock(Pass *P, BasicBlock &BB, const VectorizeConfig &C=VectorizeConfig())
Vectorize the BasicBlock.
bool FastDep
Use a fast instruction dependency analysis.
Definition: Vectorize.h:102
Vectorize configuration.
Definition: Vectorize.h:24
bool VectorizeCasts
Vectorize casting (conversion) operations.
Definition: Vectorize.h:44
bool VectorizeBools
Vectorize boolean values.
Definition: Vectorize.h:32
unsigned ReqChainDepth
The required chain depth for vectorization.
Definition: Vectorize.h:74
unsigned MaxInsts
The maximum number of pairable instructions per group.
Definition: Vectorize.h:87
bool NoMemOpBoost
Don't boost the chain-depth contribution of loads and stores.
Definition: Vectorize.h:99
bool VectorizeGEP
Vectorize getelementptr instructions.
Definition: Vectorize.h:62
Pass * createSLPVectorizerPass()
bool VectorizeInts
Vectorize integer values.
Definition: Vectorize.h:35
bool VectorizeBitManipulations
Vectorize bit intrinsics.
Definition: Vectorize.h:50
bool VectorizeSelect
Vectorize select instructions.
Definition: Vectorize.h:56
unsigned VectorBits
The size of the native vector registers.
Definition: Vectorize.h:29