summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-05-11 17:06:17 +0000
committerAdam Nemet <anemet@apple.com>2017-05-11 17:06:17 +0000
commit0aca09fc6cdcda65a44dc084b20d7056912977ef (patch)
tree4548aede161f91b821d09c58dad38f79bbc67db0 /llvm/include
parent96c3d626a277202498349675e1cce2e1f8a8b072 (diff)
downloadbcm5719-llvm-0aca09fc6cdcda65a44dc084b20d7056912977ef.tar.gz
bcm5719-llvm-0aca09fc6cdcda65a44dc084b20d7056912977ef.zip
[SLP] Emit optimization remarks
The approach I followed was to emit the remark after getTreeCost concludes that SLP is profitable. I initially tried emitting them after the vectorizeRootInstruction calls in vectorizeChainsInBlock but I vaguely remember missing a few cases for example in HorizontalReduction::tryToReduce. ORE is placed in BoUpSLP so that it's available from everywhere (notably HorizontalReduction::tryToReduce). We use the first instruction in the root bundle as the locator for the remark. In order to get a sense how far the tree is spanning I've include the size of the tree in the remark. This is not perfect of course but it gives you at least a rough idea about the tree. Then you can follow up with -view-slp-tree to really see the actual tree. llvm-svn: 302811
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
index 10338f7937e..c514db41623 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
@@ -24,6 +24,7 @@
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/DemandedBits.h"
#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Analysis/OptimizationDiagnosticInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Function.h"
@@ -59,7 +60,8 @@ public:
// Glue for old PM.
bool runImpl(Function &F, ScalarEvolution *SE_, TargetTransformInfo *TTI_,
TargetLibraryInfo *TLI_, AliasAnalysis *AA_, LoopInfo *LI_,
- DominatorTree *DT_, AssumptionCache *AC_, DemandedBits *DB_);
+ DominatorTree *DT_, AssumptionCache *AC_, DemandedBits *DB_,
+ OptimizationRemarkEmitter *ORE_);
private:
/// \brief Collect store and getelementptr instructions and organize them
OpenPOWER on IntegriCloud