summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2015-08-11 15:56:31 +0000
committerSanjay Patel <spatel@rotateright.com>2015-08-11 15:56:31 +0000
commitfec7965b36b216434a0529255041bbc1eda6d0ce (patch)
tree36ad39bae979bdaa50205e94e14d2dc04b92d849 /llvm/lib/Transforms
parent7d9e1e125930404a7ebce2e8d584b34a9065d530 (diff)
downloadbcm5719-llvm-fec7965b36b216434a0529255041bbc1eda6d0ce.tar.gz
bcm5719-llvm-fec7965b36b216434a0529255041bbc1eda6d0ce.zip
fix minsize detection: minsize attribute implies optimizing for size
llvm-svn: 244617
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index ad57f0d40b3..d40fe33e6c0 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1719,8 +1719,7 @@ struct LoopVectorize : public FunctionPass {
// Check the function attributes to find out if this function should be
// optimized for size.
bool OptForSize = Hints.getForce() != LoopVectorizeHints::FK_Enabled &&
- // FIXME: Use Function::optForSize().
- F->hasFnAttribute(Attribute::OptimizeForSize);
+ F->optForSize();
// Compute the weighted frequency of this loop being executed and see if it
// is less than 20% of the function entry baseline frequency. Note that we
@@ -4614,8 +4613,9 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize) {
emitAnalysis(VectorizationReport() <<
"runtime pointer checks needed. Enable vectorization of this "
"loop with '#pragma clang loop vectorize(enable)' when "
- "compiling with -Os");
- DEBUG(dbgs() << "LV: Aborting. Runtime ptr check is required in Os.\n");
+ "compiling with -Os/-Oz");
+ DEBUG(dbgs() <<
+ "LV: Aborting. Runtime ptr check is required with -Os/-Oz.\n");
return Factor;
}
@@ -4659,7 +4659,7 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize) {
emitAnalysis
(VectorizationReport() <<
"unable to calculate the loop count due to complex control flow");
- DEBUG(dbgs() << "LV: Aborting. A tail loop is required in Os.\n");
+ DEBUG(dbgs() << "LV: Aborting. A tail loop is required with -Os/-Oz.\n");
return Factor;
}
@@ -4675,8 +4675,8 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize) {
"cannot optimize for size and vectorize at the "
"same time. Enable vectorization of this loop "
"with '#pragma clang loop vectorize(enable)' "
- "when compiling with -Os");
- DEBUG(dbgs() << "LV: Aborting. A tail loop is required in Os.\n");
+ "when compiling with -Os/-Oz");
+ DEBUG(dbgs() << "LV: Aborting. A tail loop is required with -Os/-Oz.\n");
return Factor;
}
}
OpenPOWER on IntegriCloud