LLVM  14.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
llvm::VectorizeConfig::VectorizeBools
bool VectorizeBools
Vectorize boolean values.
Definition: Vectorize.h:31
llvm::VectorizeConfig::FastDep
bool FastDep
Use a fast instruction dependency analysis.
Definition: Vectorize.h:101
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
Pass
print lazy value Lazy Value Info Printer Pass
Definition: LazyValueInfo.cpp:1965
llvm::VectorizeConfig::VectorizeInts
bool VectorizeInts
Vectorize integer values.
Definition: Vectorize.h:34
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::VectorizeConfig::MaxInsts
unsigned MaxInsts
The maximum number of pairable instructions per group.
Definition: Vectorize.h:86
llvm::VectorizeConfig::ReqChainDepth
unsigned ReqChainDepth
The required chain depth for vectorization.
Definition: Vectorize.h:73
llvm::createVectorCombinePass
Pass * createVectorCombinePass()
Definition: VectorCombine.cpp:1219
llvm::VectorizeConfig::NoMemOpBoost
bool NoMemOpBoost
Don't boost the chain-depth contribution of loads and stores.
Definition: Vectorize.h:98
llvm::VectorizeConfig::VectorizeSelect
bool VectorizeSelect
Vectorize select instructions.
Definition: Vectorize.h:55
llvm::VectorizeConfig::VectorizeFloats
bool VectorizeFloats
Vectorize floating-point values.
Definition: Vectorize.h:37
llvm::VectorizeConfig::AlignedOnly
bool AlignedOnly
Only generate aligned loads and stores.
Definition: Vectorize.h:67
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
llvm::createSLPVectorizerPass
Pass * createSLPVectorizerPass()
Definition: SLPVectorizer.cpp:9544
llvm::VectorizeConfig::MaxPairs
unsigned MaxPairs
The maximum number of candidate instruction pairs per group.
Definition: Vectorize.h:89
llvm::VectorizeConfig::VectorBits
unsigned VectorBits
The size of the native vector registers.
Definition: Vectorize.h:28
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::VectorizeConfig::SearchLimit
unsigned SearchLimit
The maximum search distance for instruction pairs.
Definition: Vectorize.h:76
llvm::createLoadStoreVectorizerPass
Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
llvm::VectorizeConfig::MaxCandPairsForCycleCheck
unsigned MaxCandPairsForCycleCheck
The maximum number of candidate pairs with which to use a full cycle check.
Definition: Vectorize.h:80
llvm::VectorizeConfig::VectorizeMath
bool VectorizeMath
Vectorize floating-point math intrinsics.
Definition: Vectorize.h:46
llvm::VectorizeConfig::VectorizePointers
bool VectorizePointers
Vectorize pointer values.
Definition: Vectorize.h:40
llvm::VectorizeConfig::VectorizeConfig
VectorizeConfig()
Initialize the VectorizeConfig from command line options.
llvm::vectorizeBasicBlock
bool vectorizeBasicBlock(Pass *P, BasicBlock &BB, const VectorizeConfig &C=VectorizeConfig())
Vectorize the BasicBlock.
llvm::VectorizeConfig::VectorizeCasts
bool VectorizeCasts
Vectorize casting (conversion) operations.
Definition: Vectorize.h:43
llvm::VectorizeConfig::VectorizeMemOps
bool VectorizeMemOps
Vectorize loads and stores.
Definition: Vectorize.h:64
llvm::VectorizeConfig::VectorizeBitManipulations
bool VectorizeBitManipulations
Vectorize bit intrinsics.
Definition: Vectorize.h:49
llvm::VectorizeConfig::Pow2LenOnly
bool Pow2LenOnly
Don't try to form odd-length vectors.
Definition: Vectorize.h:95
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:71
llvm::VectorizeConfig::SplatBreaksChain
bool SplatBreaksChain
Replicating one element to a pair breaks the chain.
Definition: Vectorize.h:83
llvm::VectorizeConfig::VectorizeGEP
bool VectorizeGEP
Vectorize getelementptr instructions.
Definition: Vectorize.h:61
llvm::VectorizeConfig::VectorizeCmp
bool VectorizeCmp
Vectorize comparison instructions.
Definition: Vectorize.h:58
llvm::VectorizeConfig::VectorizeFMA
bool VectorizeFMA
Vectorize the fused-multiply-add intrinsic.
Definition: Vectorize.h:52
llvm::VectorizeConfig::MaxIter
unsigned MaxIter
The maximum number of pairing iterations.
Definition: Vectorize.h:92
llvm::Pass
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:91
BB
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
Definition: README.txt:39
llvm::VectorizeConfig
Vectorize configuration.
Definition: Vectorize.h:23
llvm::createLoopVectorizePass
Pass * createLoopVectorizePass()
Definition: LoopVectorize.cpp:7987