Renaming:

isTriviallyReMaterializable -> hasNoSideEffects
  isReallyTriviallyReMaterializable -> isTriviallyReMaterializable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44702 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2007-12-08 07:17:56 +00:00
parent d96428597b
commit 320c630c1b
5 changed files with 16 additions and 16 deletions

View File

@ -288,24 +288,24 @@ public:
return get(Opcode).Flags & M_HAS_OPTIONAL_DEF; return get(Opcode).Flags & M_HAS_OPTIONAL_DEF;
} }
/// isTriviallyReMaterializable - Return true if the instruction is trivially /// hasNoSideEffects - Return true if the instruction is trivially
/// rematerializable, meaning it has no side effects and requires no operands /// rematerializable, meaning it has no side effects and requires no operands
/// that aren't always available. /// that aren't always available.
bool isTriviallyReMaterializable(MachineInstr *MI) const { bool hasNoSideEffects(MachineInstr *MI) const {
return (MI->getInstrDescriptor()->Flags & M_REMATERIALIZIBLE) && return (MI->getInstrDescriptor()->Flags & M_REMATERIALIZIBLE) &&
isReallyTriviallyReMaterializable(MI); isTriviallyReMaterializable(MI);
} }
protected: protected:
/// isReallyTriviallyReMaterializable - For instructions with opcodes for /// isTriviallyReMaterializable - For instructions with opcodes for which the
/// which the M_REMATERIALIZABLE flag is set, this function tests whether the /// M_REMATERIALIZABLE flag is set, this function tests whether the
/// instruction itself is actually trivially rematerializable, considering /// instruction itself is actually trivially rematerializable, considering its
/// its operands. This is used for targets that have instructions that are /// operands. This is used for targets that have instructions that are only
/// only trivially rematerializable for specific uses. This predicate must /// trivially rematerializable for specific uses. This predicate must return
/// return false if the instruction has any side effects other than /// false if the instruction has any side effects other than producing a
/// producing a value, or if it requres any address registers that are not /// value, or if it requres any address registers that are not always
/// always available. /// available.
virtual bool isReallyTriviallyReMaterializable(MachineInstr *MI) const { virtual bool isTriviallyReMaterializable(MachineInstr *MI) const {
return true; return true;
} }

View File

@ -613,7 +613,7 @@ bool LiveIntervals::isReMaterializable(const LiveInterval &li,
return false; return false;
isLoad = false; isLoad = false;
if (tii_->isTriviallyReMaterializable(MI)) { if (tii_->hasNoSideEffects(MI)) {
isLoad = MI->getInstrDescriptor()->Flags & M_LOAD_FLAG; isLoad = MI->getInstrDescriptor()->Flags & M_LOAD_FLAG;
return true; return true;
} }

View File

@ -120,7 +120,7 @@ namespace {
if (TID->ImplicitUses || !I.getNumOperands()) return false; if (TID->ImplicitUses || !I.getNumOperands()) return false;
MachineOpCode Opcode = TID->Opcode; MachineOpCode Opcode = TID->Opcode;
return TII->isTriviallyReMaterializable(&I) && return TII->hasNoSideEffects(&I) &&
// FIXME: Below necessary? // FIXME: Below necessary?
!(TII->isReturn(Opcode) || !(TII->isReturn(Opcode) ||
TII->isTerminatorInstr(Opcode) || TII->isTerminatorInstr(Opcode) ||

View File

@ -116,7 +116,7 @@ unsigned X86InstrInfo::isStoreToStackSlot(MachineInstr *MI,
} }
bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const { bool X86InstrInfo::isTriviallyReMaterializable(MachineInstr *MI) const {
switch (MI->getOpcode()) { switch (MI->getOpcode()) {
default: break; default: break;
case X86::MOV8rm: case X86::MOV8rm:

View File

@ -239,7 +239,7 @@ public:
unsigned& destReg) const; unsigned& destReg) const;
unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const; unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const; unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
bool isReallyTriviallyReMaterializable(MachineInstr *MI) const; bool isTriviallyReMaterializable(MachineInstr *MI) const;
/// convertToThreeAddress - This method must be implemented by targets that /// convertToThreeAddress - This method must be implemented by targets that
/// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target