From f31f33ea890514a6fbde5f5d2fc536881c532e9a Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 1 Oct 2010 22:45:50 +0000 Subject: 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. llvm-svn: 115364 --- llvm/lib/Target/ARM/Thumb2InstrInfo.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Target/ARM/Thumb2InstrInfo.cpp') diff --git a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp b/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp index a79b4ae4b31..0a0f3146efd 100644 --- a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp +++ b/llvm/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 -- cgit v1.2.3