diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-07-22 00:25:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-07-22 00:25:27 +0000 |
commit | fc6ad402fb267cba1625801444aad30da43d383a (patch) | |
tree | 4e621438426c6c89519c7175029f6b26899afff5 /include/llvm | |
parent | e922c0201916e0b980ab3cfe91e1413e68d55647 (diff) | |
download | external_llvm-fc6ad402fb267cba1625801444aad30da43d383a.zip external_llvm-fc6ad402fb267cba1625801444aad30da43d383a.tar.gz external_llvm-fc6ad402fb267cba1625801444aad30da43d383a.tar.bz2 |
Let each target determines whether a machine instruction is dead. If true, that allows late codeine passes to delete it.
This is considered a workaround. The problem is some targets are not modeling side effects correctly. PPC is apparently one of those. This patch allows ppc llvm-gcc to bootstrap on Darwin. Once we find out which instruction definitions are wrong, we can remove the PPCInstrInfo workaround.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 0ab57ca..538d139 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -470,6 +470,10 @@ public: return true; } + /// isDeadInstruction - Return true if the instruction is considered dead. + /// This allows some late codegen passes to delete them. + virtual bool isDeadInstruction(const MachineInstr *MI) const = 0; + /// GetInstSize - Returns the size of the specified Instruction. /// virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const { @@ -501,6 +505,8 @@ public: MachineBasicBlock::iterator MI, unsigned DestReg, unsigned SubReg, const MachineInstr *Orig) const; + virtual bool isDeadInstruction(const MachineInstr *MI) const; + virtual unsigned GetFunctionSizeInBytes(const MachineFunction &MF) const; }; |