summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2015-02-18 08:36:14 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2015-02-18 08:36:14 +0000
commita250484c4c7a7b1c88b5383fc922f64a7f70e40e (patch)
treede6da6151f23c2acc85d6b260f5e1f06907c62ff /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parentfa520c5f494ddb4584b2b2cff255c81ed7a5c7f5 (diff)
downloadbcm5719-llvm-a250484c4c7a7b1c88b5383fc922f64a7f70e40e.tar.gz
bcm5719-llvm-a250484c4c7a7b1c88b5383fc922f64a7f70e40e.zip
Reformat.
llvm-svn: 229651
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp50
1 files changed, 19 insertions, 31 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 1ddb45e5df6..3945807fee7 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -107,13 +107,13 @@ STATISTIC(LoopsVectorized, "Number of loops vectorized");
STATISTIC(LoopsAnalyzed, "Number of loops analyzed for vectorization");
static cl::opt<unsigned>
-VectorizationFactor("force-vector-width", cl::init(0), cl::Hidden,
- cl::desc("Sets the SIMD width. Zero is autoselect."));
+ VectorizationFactor("force-vector-width", cl::init(0), cl::Hidden,
+ cl::desc("Sets the SIMD width. Zero is autoselect."));
static cl::opt<unsigned>
-VectorizationInterleave("force-vector-interleave", cl::init(0), cl::Hidden,
- cl::desc("Sets the vectorization interleave count. "
- "Zero is autoselect."));
+ VectorizationInterleave("force-vector-interleave", cl::init(0), cl::Hidden,
+ cl::desc("Sets the vectorization interleave count. "
+ "Zero is autoselect."));
static cl::opt<bool>
EnableIfConversion("enable-if-conversion", cl::init(true), cl::Hidden,
@@ -548,9 +548,8 @@ public:
DominatorTree *DT, TargetLibraryInfo *TLI,
AliasAnalysis *AA, Function *F,
const TargetTransformInfo *TTI)
- : NumPredStores(0), TheLoop(L), SE(SE), DL(DL),
- TLI(TLI), TheFunction(F), TTI(TTI), DT(DT), Induction(nullptr),
- WidestIndTy(nullptr),
+ : NumPredStores(0), TheLoop(L), SE(SE), DL(DL), TLI(TLI), TheFunction(F),
+ TTI(TTI), DT(DT), Induction(nullptr), WidestIndTy(nullptr),
LAI(F, L, SE, DL, TLI, AA, DT,
LoopAccessInfo::VectorizerParams(
MaxVectorWidth, VectorizationFactor, VectorizationInterleave,
@@ -744,9 +743,7 @@ public:
return LAI.getRuntimePointerCheck();
}
- LoopAccessInfo *getLAI() {
- return &LAI;
- }
+ LoopAccessInfo *getLAI() { return &LAI; }
/// This function returns the identity element (or neutral element) for
/// the operation K.
@@ -773,18 +770,11 @@ public:
}
/// Returns true if vector representation of the instruction \p I
/// requires mask.
- bool isMaskRequired(const Instruction* I) {
- return (MaskedOp.count(I) != 0);
- }
- unsigned getNumStores() const {
- return LAI.getNumStores();
- }
- unsigned getNumLoads() const {
- return LAI.getNumLoads();
- }
- unsigned getNumPredStores() const {
- return NumPredStores;
- }
+ bool isMaskRequired(const Instruction *I) { return (MaskedOp.count(I) != 0); }
+ unsigned getNumStores() const { return LAI.getNumStores(); }
+ unsigned getNumLoads() const { return LAI.getNumLoads(); }
+ unsigned getNumPredStores() const { return NumPredStores; }
+
private:
/// Check if a single basic block loop is vectorizable.
/// At this point we know that this is a loop with a constant trip count
@@ -875,7 +865,7 @@ private:
SmallPtrSet<Value*, 4> AllowedExit;
/// This set holds the variables which are known to be uniform after
/// vectorization.
- SmallPtrSet<Instruction*, 4> Uniforms;
+ SmallPtrSet<Instruction *, 4> Uniforms;
LoopAccessInfo LAI;
/// Can we assume the absence of NaNs.
bool HasFunNoNaNAttr;
@@ -1659,9 +1649,7 @@ int LoopVectorizationLegality::isConsecutivePtr(Value *Ptr) {
return 0;
}
-bool LoopVectorizationLegality::isUniform(Value *V) {
- return LAI.isUniform(V);
-}
+bool LoopVectorizationLegality::isUniform(Value *V) { return LAI.isUniform(V); }
InnerLoopVectorizer::VectorParts&
InnerLoopVectorizer::getVectorValue(Value *V) {
@@ -3399,10 +3387,10 @@ bool LoopVectorizationLegality::canVectorize() {
// Collect all of the variables that remain uniform after vectorization.
collectLoopUniforms();
- DEBUG(dbgs() << "LV: We can vectorize this loop" <<
- (LAI.getRuntimePointerCheck()->Need ? " (with a runtime bound check)" :
- "")
- <<"!\n");
+ DEBUG(dbgs() << "LV: We can vectorize this loop"
+ << (LAI.getRuntimePointerCheck()->Need
+ ? " (with a runtime bound check)"
+ : "") << "!\n");
// Okay! We can vectorize. At this point we don't have any other mem analysis
// which may limit our maximum vectorization factor, so just return true with
OpenPOWER on IntegriCloud