summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/Thumb2InstrInfo.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-10-01 22:45:50 +0000
committerOwen Anderson <resistor@mac.com>2010-10-01 22:45:50 +0000
commite3cc84a43d6a4bb6c50f58f3dd8e60e28787509e (patch)
tree236f7bad5fd51f72f50409f3d67bf9dcda8c5388 /lib/Target/ARM/Thumb2InstrInfo.cpp
parent6314ef9e8100c889956bd26ba71cc04e06564568 (diff)
downloadllvm-e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e.tar.gz
llvm-e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e.tar.bz2
llvm-e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e.tar.xz
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 'lib/Target/ARM/Thumb2InstrInfo.cpp')
-rw-r--r--lib/Target/ARM/Thumb2InstrInfo.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Target/ARM/Thumb2InstrInfo.cpp b/lib/Target/ARM/Thumb2InstrInfo.cpp
index a79b4ae4b3..0a0f3146ef 100644
--- a/lib/Target/ARM/Thumb2InstrInfo.cpp
+++ b/lib/Target/ARM/Thumb2InstrInfo.cpp
@@ -44,19 +44,22 @@ unsigned Thumb2InstrInfo::getUnindexedOpcode(unsigned Opc) const {
bool Thumb2InstrInfo::isProfitableToIfCvt(MachineBasicBlock &MBB,
unsigned NumInstrs,
- float Prediction) const {
+ float Prediction,
+ float Confidence) const {
if (!OldT2IfCvt)
- return ARMBaseInstrInfo::isProfitableToIfCvt(MBB, NumInstrs, Prediction);
+ return ARMBaseInstrInfo::isProfitableToIfCvt(MBB, NumInstrs,
+ Prediction, Confidence);
return NumInstrs && NumInstrs <= 3;
}
bool Thumb2InstrInfo::
isProfitableToIfCvt(MachineBasicBlock &TMBB, unsigned NumT,
MachineBasicBlock &FMBB, unsigned NumF,
- float Prediction) const {
+ float Prediction, float Confidence) const {
if (!OldT2IfCvt)
return ARMBaseInstrInfo::isProfitableToIfCvt(TMBB, NumT,
- FMBB, NumF, Prediction);
+ FMBB, NumF,
+ Prediction, Confidence);
// FIXME: Catch optimization such as:
// r0 = movne