summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-02 07:17:12 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-02 07:17:12 +0000
commit37efc9fe42a4867c81526cac7fca9fe0ea04a484 (patch)
tree9241d2ae6f5a0ffd132c90849bcea84999efd0b2 /lib/CodeGen/LLVMTargetMachine.cpp
parent205e3378fda530628ac63c26a9b7b0920a9b49bd (diff)
downloadexternal_llvm-37efc9fe42a4867c81526cac7fca9fe0ea04a484.zip
external_llvm-37efc9fe42a4867c81526cac7fca9fe0ea04a484.tar.gz
external_llvm-37efc9fe42a4867c81526cac7fca9fe0ea04a484.tar.bz2
Begin collecting some of the statistics for block placement discussed on
the mailing list. Suggestions for other statistics to collect would be awesome. =] Currently these are implemented as a separate pass guarded by a separate flag. I'm not thrilled by that, but I wanted to be able to collect the statistics for the old code placement as well as the new in order to have a point of comparison. I'm planning on folding them into the single pass if / when there is only one pass of interest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 268584c..3e69069 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -55,6 +55,8 @@ static cl::opt<bool> DisableEarlyTailDup("disable-early-taildup", cl::Hidden,
cl::desc("Disable pre-register allocation tail duplication"));
static cl::opt<bool> EnableBlockPlacement("enable-block-placement",
cl::Hidden, cl::desc("Enable probability-driven block placement"));
+static cl::opt<bool> EnableBlockPlacementStats("enable-block-placement-stats",
+ cl::Hidden, cl::desc("Collect probability-driven block placement stats"));
static cl::opt<bool> DisableCodePlace("disable-code-place", cl::Hidden,
cl::desc("Disable code placement"));
static cl::opt<bool> DisableSSC("disable-ssc", cl::Hidden,
@@ -499,6 +501,12 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
PM.add(createCodePlacementOptPass());
printNoVerify(PM, "After CodePlacementOpt");
}
+
+ // Run a separate pass to collect block placement statistics.
+ if (EnableBlockPlacementStats) {
+ PM.add(createMachineBlockPlacementStatsPass());
+ printNoVerify(PM, "After MachineBlockPlacementStats");
+ }
}
if (addPreEmitPass(PM, OptLevel))