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 integer values.
34 /// @brief Vectorize floating-point values.
37 /// @brief Vectorize casting (conversion) operations.
40 /// @brief Vectorize floating-point math intrinsics.
43 /// @brief Vectorize the fused-multiply-add intrinsic.
46 /// @brief Vectorize loads and stores.
49 /// @brief Only generate aligned loads and stores.
52 //===--------------------------------------------------------------------===//
55 /// @brief The required chain depth for vectorization.
56 unsigned ReqChainDepth;
58 /// @brief The maximum search distance for instruction pairs.
61 /// @brief The maximum number of candidate pairs with which to use a full
63 unsigned MaxCandPairsForCycleCheck;
65 /// @brief Replicating one element to a pair breaks the chain.
66 bool SplatBreaksChain;
68 /// @brief The maximum number of pairable instructions per group.
71 /// @brief The maximum number of pairing iterations.
74 /// @brief Don't boost the chain-depth contribution of loads and stores.
77 /// @brief Use a fast instruction dependency analysis.
80 /// @brief Initialize the VectorizeConfig from command line options.
84 //===----------------------------------------------------------------------===//
86 // BBVectorize - A basic-block vectorization pass.
89 createBBVectorizePass(const VectorizeConfig &C = VectorizeConfig());
91 //===----------------------------------------------------------------------===//
92 /// @brief Vectorize the BasicBlock.
94 /// @param BB The BasicBlock to be vectorized
95 /// @param P The current running pass, should require AliasAnalysis and
96 /// ScalarEvolution. After the vectorization, AliasAnalysis,
97 /// ScalarEvolution and CFG are preserved.
99 /// @return True if the BB is changed, false otherwise.
101 bool vectorizeBasicBlock(Pass *P, BasicBlock &BB,
102 const VectorizeConfig &C = VectorizeConfig());
104 } // End llvm namespace