mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-05 00:49:43 +00:00
[PPCGCodeGeneration] Enable polly-codegen-perf-monitoring
for PPCGCodegen.
This feature was not enabled for `PPCGCodeGeneration`. Now that this is enabled, we can benchmark Scops that have been optimised with `-polly-codegen-ppcg` with the `-polly-codegen-perf-monitoring` option. Differential Revision: https://reviews.llvm.org/D36934 llvm-svn: 311328
This commit is contained in:
parent
685889cf9b
commit
7b9f5ca27e
@ -36,6 +36,8 @@ struct CodeGenerationPass : public PassInfoMixin<CodeGenerationPass> {
|
||||
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
|
||||
ScopStandardAnalysisResults &AR, SPMUpdater &U);
|
||||
};
|
||||
|
||||
extern bool PerfMonitoring;
|
||||
} // namespace polly
|
||||
|
||||
#endif // POLLY_CODEGENERATION_H
|
||||
|
@ -49,10 +49,12 @@ static cl::opt<bool> Verify("polly-codegen-verify",
|
||||
cl::Hidden, cl::init(false), cl::ZeroOrMore,
|
||||
cl::cat(PollyCategory));
|
||||
|
||||
static cl::opt<bool>
|
||||
PerfMonitoring("polly-codegen-perf-monitoring",
|
||||
cl::desc("Add run-time performance monitoring"), cl::Hidden,
|
||||
cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory));
|
||||
bool polly::PerfMonitoring;
|
||||
static cl::opt<bool, true>
|
||||
XPerfMonitoring("polly-codegen-perf-monitoring",
|
||||
cl::desc("Add run-time performance monitoring"), cl::Hidden,
|
||||
cl::location(polly::PerfMonitoring), cl::init(false),
|
||||
cl::ZeroOrMore, cl::cat(PollyCategory));
|
||||
|
||||
namespace polly {
|
||||
/// Mark a basic block unreachable.
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "polly/CodeGen/CodeGeneration.h"
|
||||
#include "polly/CodeGen/IslAst.h"
|
||||
#include "polly/CodeGen/IslNodeBuilder.h"
|
||||
#include "polly/CodeGen/PerfMonitor.h"
|
||||
#include "polly/CodeGen/Utils.h"
|
||||
#include "polly/DependenceInfo.h"
|
||||
#include "polly/LinkAllPasses.h"
|
||||
@ -122,6 +123,8 @@ static cl::opt<int>
|
||||
cl::desc("Minimal number of compute statements to run on GPU."),
|
||||
cl::Hidden, cl::init(10 * 512 * 512));
|
||||
|
||||
extern bool polly::PerfMonitoring;
|
||||
|
||||
/// Return a unique name for a Scop, which is the scop region with the
|
||||
/// function name.
|
||||
std::string getUniqueScopName(const Scop *S) {
|
||||
@ -3433,6 +3436,22 @@ public:
|
||||
isl_ast_node_free(Root);
|
||||
} else {
|
||||
|
||||
if (polly::PerfMonitoring) {
|
||||
PerfMonitor P(*S, EnteringBB->getParent()->getParent());
|
||||
P.initialize();
|
||||
P.insertRegionStart(SplitBlock->getTerminator());
|
||||
|
||||
// TODO: actually think if this is the correct exiting block to place
|
||||
// the `end` performance marker. Invariant load hoisting changes
|
||||
// the CFG in a way that I do not precisely understand, so I
|
||||
// (Siddharth<siddu.druid@gmail.com>) should come back to this and
|
||||
// think about which exiting block to use.
|
||||
auto *ExitingBlock = StartBlock->getUniqueSuccessor();
|
||||
assert(ExitingBlock);
|
||||
BasicBlock *MergeBlock = ExitingBlock->getUniqueSuccessor();
|
||||
P.insertRegionEnd(MergeBlock->getTerminator());
|
||||
}
|
||||
|
||||
NodeBuilder.addParameters(S->getContext().release());
|
||||
Value *RTC = NodeBuilder.createRTC(Condition);
|
||||
Builder.GetInsertBlock()->getTerminator()->setOperand(0, RTC);
|
||||
|
Loading…
x
Reference in New Issue
Block a user