[llvm-commits] [llvm] r113666 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/PeepholeOptimizer.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h
Bill Wendling
isanbard at gmail.com
Fri Sep 10 16:46:12 PDT 2010
Author: void
Date: Fri Sep 10 18:46:12 2010
New Revision: 113666
URL: http://llvm.org/viewvc/llvm-project?rev=113666&view=rev
Log:
No need to recompute the SrcReg and CmpValue.
Modified:
llvm/trunk/include/llvm/Target/TargetInstrInfo.h
llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=113666&r1=113665&r2=113666&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Fri Sep 10 18:46:12 2010
@@ -589,6 +589,7 @@
/// the comparison into one that sets the zero bit in the flags
/// register. Update the iterator *only* if a transformation took place.
virtual bool ConvertToSetZeroFlag(MachineInstr * /*CmpInstr*/,
+ unsigned /*SrcReg*/, int /*CmpValue*/,
MachineBasicBlock::iterator &) const {
return false;
}
Modified: llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp?rev=113666&r1=113665&r2=113666&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp Fri Sep 10 18:46:12 2010
@@ -244,7 +244,7 @@
return false;
// Attempt to convert the defining instruction to set the "zero" flag.
- if (TII->ConvertToSetZeroFlag(MI, NextIter)) {
+ if (TII->ConvertToSetZeroFlag(MI, SrcReg, CmpValue, NextIter)) {
++NumEliminated;
return true;
}
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=113666&r1=113665&r2=113666&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Fri Sep 10 18:46:12 2010
@@ -1381,11 +1381,9 @@
/// comparison into one that sets the zero bit in the flags register. Update the
/// iterator *only* if a transformation took place.
bool ARMBaseInstrInfo::
-ConvertToSetZeroFlag(MachineInstr *CmpInstr,
+ConvertToSetZeroFlag(MachineInstr *CmpInstr, unsigned SrcReg, int CmpValue,
MachineBasicBlock::iterator &MII) const {
- unsigned SrcReg;
- int CmpValue;
- if (!AnalyzeCompare(CmpInstr, SrcReg, CmpValue) || CmpValue != 0)
+ if (CmpValue != 0)
return false;
MachineRegisterInfo &MRI = CmpInstr->getParent()->getParent()->getRegInfo();
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=113666&r1=113665&r2=113666&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Fri Sep 10 18:46:12 2010
@@ -346,7 +346,8 @@
/// ConvertToSetZeroFlag - Convert the instruction to set the zero flag so
/// that we can remove a "comparison with zero".
- virtual bool ConvertToSetZeroFlag(MachineInstr *CmpInstr,
+ virtual bool ConvertToSetZeroFlag(MachineInstr *CmpInstr, unsigned SrcReg,
+ int CmpValue,
MachineBasicBlock::iterator &MII) const;
virtual unsigned getNumMicroOps(const MachineInstr *MI,
More information about the llvm-commits
mailing list