diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-05-19 20:36:22 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-05-19 20:36:22 +0000 |
commit | 7ebc4d63db05ac214d36bc01b4d60adadaf923e5 (patch) | |
tree | 3f1df7259be24bb781440916e2a2ba4868216143 /include | |
parent | aa6c72ec9579cf7a9e65cbc7a56c6a40e9c5ad47 (diff) | |
download | llvm-7ebc4d63db05ac214d36bc01b4d60adadaf923e5.tar.gz llvm-7ebc4d63db05ac214d36bc01b4d60adadaf923e5.tar.bz2 llvm-7ebc4d63db05ac214d36bc01b4d60adadaf923e5.tar.xz |
Add MachineInstr::readsVirtualRegister() in preparation for proper handling of
partial redefines.
We are going to treat a partial redefine of a virtual register as a
read-modify-write:
%reg1024:6 = OP
Unless the register is fully clobbered:
%reg1024:6 = OP, %reg1024<imp-def>
MachineInstr::readsVirtualRegister() knows the difference. The first case is a
read, the second isn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index eefbd36daa..ffec00fd8c 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -230,10 +230,17 @@ public: /// readsRegister - Return true if the MachineInstr reads the specified /// register. If TargetRegisterInfo is passed, then it also checks if there /// is a read of a super-register. + /// This does not count partial redefines of virtual registers as reads: + /// %reg1024:6 = OP. bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI = NULL) const { return findRegisterUseOperandIdx(Reg, false, TRI) != -1; } + /// readsVirtualRegister - Return true if the MachineInstr reads the specified + /// virtual register. Take into account that a partial define is a + /// read-modify-write operation. + bool readsVirtualRegister(unsigned Reg) const; + /// killsRegister - Return true if the MachineInstr kills the specified /// register. If TargetRegisterInfo is passed, then it also checks if there is /// a kill of a super-register. |