diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-01-12 00:09:37 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-01-12 00:09:37 +0000 |
commit | a5a81d70720a4ce6ac7538927c2a874b0dfa8bd2 (patch) | |
tree | a97a5454dfbd99f0a45929908becf7cc692b74af /include | |
parent | 77beb479f556093c5f1b4854fcbb095cda34f202 (diff) |
Add TargetInstrInfo::isCoalescableInstr. It returns true if the specified
instruction is copy like where the source and destination registers can
overlap. This is to be used by the coalescable to coalesce the source and
destination registers of instructions like X86::MOVSX64rr32. Apparently
some crazy people believe the coalescer is too simple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index c57a2d4c23..6172fcfa64 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -149,6 +149,19 @@ public: return false; } + /// isCoalescableInstr - Return true if the instruction is "coalescable". That + /// is, it's like a copy where it's legal for the source to overlap the + /// destination. e.g. X86::MOVSX64rr32. + virtual bool isCoalescableInstr(const MachineInstr &MI, bool &isCopy, + unsigned &SrcReg, unsigned &DstReg, + unsigned &SrcSubIdx, unsigned &DstSubIdx) const { + if (isMoveInstr(MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { + isCopy = true; + return true; + } + return false; + } + /// isIdentityCopy - Return true if the instruction is a copy (or /// extract_subreg, insert_subreg, subreg_to_reg) where the source and /// destination registers are the same. |