summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-05-22 14:19:46 +0000
committerDiego Novillo <dnovillo@google.com>2014-05-22 14:19:46 +0000
commit7f8af8bf91ac2d33eceac932e3f5282ab2db25ba (patch)
treeb06d9fa0fdd5966834b5095d553f2c184128e61c /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parent8ff177ede3a1647b71a7db11e273f3dd81ef0ccb (diff)
downloadbcm5719-llvm-7f8af8bf91ac2d33eceac932e3f5282ab2db25ba.tar.gz
bcm5719-llvm-7f8af8bf91ac2d33eceac932e3f5282ab2db25ba.zip
Add support for missed and analysis optimization remarks.
Summary: This adds two new diagnostics: -pass-remarks-missed and -pass-remarks-analysis. They take the same values as -pass-remarks but are intended to be triggered in different contexts. -pass-remarks-missed is used by LLVMContext::emitOptimizationRemarkMissed, which passes call when they tried to apply a transformation but couldn't. -pass-remarks-analysis is used by LLVMContext::emitOptimizationRemarkAnalysis, which passes call when they want to inform the user about analysis results. The patch also: 1- Adds support in the inliner for the two new remarks and a test case. 2- Moves emitOptimizationRemark* functions to the llvm namespace. 3- Adds an LLVMContext argument instead of making them member functions of LLVMContext. Reviewers: qcolombet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D3682 llvm-svn: 209442
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index d57fae34dd6..34d8a1053fa 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -67,6 +67,7 @@
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
@@ -1213,10 +1214,10 @@ struct LoopVectorize : public FunctionPass {
DEBUG(dbgs() << "LV: Trying to at least unroll the loops.\n");
// Report the unrolling decision.
- F->getContext().emitOptimizationRemark(
- DEBUG_TYPE, *F, L->getStartLoc(),
- Twine("unrolled with interleaving factor " + Twine(UF) +
- " (vectorization not beneficial)"));
+ emitOptimizationRemark(F->getContext(), DEBUG_TYPE, *F, L->getStartLoc(),
+ Twine("unrolled with interleaving factor " +
+ Twine(UF) +
+ " (vectorization not beneficial)"));
// We decided not to vectorize, but we may want to unroll.
InnerLoopUnroller Unroller(L, SE, LI, DT, DL, TLI, UF);
@@ -1228,8 +1229,8 @@ struct LoopVectorize : public FunctionPass {
++LoopsVectorized;
// Report the vectorization decision.
- F->getContext().emitOptimizationRemark(
- DEBUG_TYPE, *F, L->getStartLoc(),
+ emitOptimizationRemark(
+ F->getContext(), DEBUG_TYPE, *F, L->getStartLoc(),
Twine("vectorized loop (vectorization factor: ") + Twine(VF.Width) +
", unrolling interleave factor: " + Twine(UF) + ")");
}
OpenPOWER on IntegriCloud