diff options
author | Owen Anderson <resistor@mac.com> | 2010-10-01 22:45:50 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-10-01 22:45:50 +0000 |
commit | e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e (patch) | |
tree | 236f7bad5fd51f72f50409f3d67bf9dcda8c5388 /include | |
parent | 6314ef9e8100c889956bd26ba71cc04e06564568 (diff) | |
download | external_llvm-e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e.zip external_llvm-e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e.tar.gz external_llvm-e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e.tar.bz2 |
Thread the determination of branch prediction hit rates back through the if-conversion heuristic APIs. For now,
stick with a constant estimate of 90% (branch predictors are good!), but we might find that we want to provide
more nuanced estimates in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 08e6a0e..0063dfc 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -305,10 +305,11 @@ public: /// isProfitableToIfCvt - Return true if it's profitable to first "NumInstrs" /// of the specified basic block, where the probability of the instructions - /// being executed is given by Probability. + /// being executed is given by Probability, and Confidence is a measure + /// of our confidence that it will be properly predicted. virtual bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumInstrs, - float Probability) const { + float Probability, float Confidence) const { return false; } @@ -316,21 +317,23 @@ public: /// checks for the case where two basic blocks from true and false path /// of a if-then-else (diamond) are predicated on mutally exclusive /// predicates, where the probability of the true path being taken is given - /// by Probability. + /// by Probability, and Confidence is a measure of our confidence that it + /// will be properly predicted. virtual bool isProfitableToIfCvt(MachineBasicBlock &TMBB, unsigned NumTInstrs, MachineBasicBlock &FMBB, unsigned NumFInstrs, - float Probability) const { + float Probability, float Confidence) const { return false; } /// isProfitableToDupForIfCvt - Return true if it's profitable for /// if-converter to duplicate a specific number of instructions in the /// specified MBB to enable if-conversion, where the probability of the - /// instructions being executed is given by Probability. + /// instructions being executed is given by Probability, and Confidence is + /// a measure of our confidence that it will be properly predicted. virtual bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumInstrs, - float Probability) const { + float Probability, float Confidence) const { return false; } |