mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Create a isFullCopy predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -278,6 +278,9 @@ public:
|
|||||||
bool isCopy() const {
|
bool isCopy() const {
|
||||||
return getOpcode() == TargetOpcode::COPY;
|
return getOpcode() == TargetOpcode::COPY;
|
||||||
}
|
}
|
||||||
|
bool isFullCopy() const {
|
||||||
|
return isCopy() && !getOperand(0).getSubReg() && !getOperand(1).getSubReg();
|
||||||
|
}
|
||||||
|
|
||||||
/// isCopyLike - Return true if the instruction behaves like a copy.
|
/// isCopyLike - Return true if the instruction behaves like a copy.
|
||||||
/// This does not include native copy instructions.
|
/// This does not include native copy instructions.
|
||||||
|
@ -180,11 +180,7 @@ Spiller *createInlineSpiller(MachineFunctionPass &pass,
|
|||||||
/// isFullCopyOf - If MI is a COPY to or from Reg, return the other register,
|
/// isFullCopyOf - If MI is a COPY to or from Reg, return the other register,
|
||||||
/// otherwise return 0.
|
/// otherwise return 0.
|
||||||
static unsigned isFullCopyOf(const MachineInstr *MI, unsigned Reg) {
|
static unsigned isFullCopyOf(const MachineInstr *MI, unsigned Reg) {
|
||||||
if (!MI->isCopy())
|
if (!MI->isFullCopy())
|
||||||
return 0;
|
|
||||||
if (MI->getOperand(0).getSubReg() != 0)
|
|
||||||
return 0;
|
|
||||||
if (MI->getOperand(1).getSubReg() != 0)
|
|
||||||
return 0;
|
return 0;
|
||||||
if (MI->getOperand(0).getReg() == Reg)
|
if (MI->getOperand(0).getReg() == Reg)
|
||||||
return MI->getOperand(1).getReg();
|
return MI->getOperand(1).getReg();
|
||||||
|
Reference in New Issue
Block a user