1 //===-- Vectorize.h - Vectorization Transformations -------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header file defines prototypes for accessor functions that expose passes
11 // in the Vectorize transformations library.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TRANSFORMS_VECTORIZE_H
16 #define LLVM_TRANSFORMS_VECTORIZE_H
22 //===----------------------------------------------------------------------===//
23 /// @brief Vectorize configuration.
24 struct VectorizeConfig {
25 //===--------------------------------------------------------------------===//
26 // Target architecture related parameters
28 /// @brief The size of the native vector registers.
31 /// @brief Vectorize boolean values.
34 /// @brief Vectorize integer values.
37 /// @brief Vectorize floating-point values.
40 /// @brief Vectorize pointer values.
41 bool VectorizePointers;
43 /// @brief Vectorize casting (conversion) operations.
46 /// @brief Vectorize floating-point math intrinsics.
49 /// @brief Vectorize the fused-multiply-add intrinsic.
52 /// @brief Vectorize select instructions.
55 /// @brief Vectorize comparison instructions.
58 /// @brief Vectorize getelementptr instructions.
61 /// @brief Vectorize loads and stores.
64 /// @brief Only generate aligned loads and stores.
67 //===--------------------------------------------------------------------===//
70 /// @brief The required chain depth for vectorization.
71 unsigned ReqChainDepth;
73 /// @brief The maximum search distance for instruction pairs.
76 /// @brief The maximum number of candidate pairs with which to use a full
78 unsigned MaxCandPairsForCycleCheck;
80 /// @brief Replicating one element to a pair breaks the chain.
81 bool SplatBreaksChain;
83 /// @brief The maximum number of pairable instructions per group.
86 /// @brief The maximum number of pairing iterations.
89 /// @brief Don't try to form odd-length vectors.
92 /// @brief Don't boost the chain-depth contribution of loads and stores.
95 /// @brief Use a fast instruction dependency analysis.
98 /// @brief Initialize the VectorizeConfig from command line options.
102 //===----------------------------------------------------------------------===//
104 // BBVectorize - A basic-block vectorization pass.
107 createBBVectorizePass(const VectorizeConfig &C = VectorizeConfig());
109 //===----------------------------------------------------------------------===//
110 /// @brief Vectorize the BasicBlock.
112 /// @param BB The BasicBlock to be vectorized
113 /// @param P The current running pass, should require AliasAnalysis and
114 /// ScalarEvolution. After the vectorization, AliasAnalysis,
115 /// ScalarEvolution and CFG are preserved.
117 /// @return True if the BB is changed, false otherwise.
119 bool vectorizeBasicBlock(Pass *P, BasicBlock &BB,
120 const VectorizeConfig &C = VectorizeConfig());
122 } // End llvm namespace