Constify the machine instruction passed into the
authorBill Wendling <isanbard@gmail.com>
Mon, 12 May 2008 20:54:26 +0000 (20:54 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 12 May 2008 20:54:26 +0000 (20:54 +0000)
"is{Trivially,Really}ReMaterializable" methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51001 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetInstrInfo.h
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h

index ca35fa7850c73abddcc04ad54e5b0ec941bebe38..f9fd6ab30d82b388831584c0705b1d9820af5139 100644 (file)
@@ -67,7 +67,7 @@ public:
   /// isTriviallyReMaterializable - Return true if the instruction is trivially
   /// rematerializable, meaning it has no side effects and requires no operands
   /// that aren't always available.
-  bool isTriviallyReMaterializable(MachineInstr *MI) const {
+  bool isTriviallyReMaterializable(const MachineInstr *MI) const {
     return MI->getDesc().isRematerializable() &&
            isReallyTriviallyReMaterializable(MI);
   }
@@ -81,7 +81,7 @@ protected:
   /// return false if the instruction has any side effects other than
   /// producing a value, or if it requres any address registers that are not
   /// always available.
-  virtual bool isReallyTriviallyReMaterializable(MachineInstr *MI) const {
+  virtual bool isReallyTriviallyReMaterializable(const MachineInstr *MI) const {
     return true;
   }
 
index 8b31f5d5f0984de0e62d5d605878713d73d3cf78..d2c5abe6d6380bae5e86a5d07dadf294f45f117a 100644 (file)
@@ -760,7 +760,8 @@ static inline bool isGVStub(GlobalValue *GV, X86TargetMachine &TM) {
   return TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
 }
  
-bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const {
+bool
+X86InstrInfo::isReallyTriviallyReMaterializable(const MachineInstr *MI) const {
   switch (MI->getOpcode()) {
   default: break;
     case X86::MOV8rm:
index 5f09241f165277269576212e69beb05dffe12dfd..06080b74af4b414cb5574270a8baba49453fded7 100644 (file)
@@ -260,7 +260,7 @@ public:
   unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
   unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
 
-  bool isReallyTriviallyReMaterializable(MachineInstr *MI) const;
+  bool isReallyTriviallyReMaterializable(const MachineInstr *MI) const;
   void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
                      unsigned DestReg, const MachineInstr *Orig) const;