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