diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-06-30 21:15:52 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-06-30 21:15:52 +0000 |
| commit | 070f96c567f7b0b3a0aa03178d2b6f05cdb2e447 (patch) | |
| tree | bb063060a3966abbbce288c5181ac5f5a4eb9331 /llvm | |
| parent | 7c5ba830159746da859d50e4a015e2deb160ebd1 (diff) | |
| download | bcm5719-llvm-070f96c567f7b0b3a0aa03178d2b6f05cdb2e447.tar.gz bcm5719-llvm-070f96c567f7b0b3a0aa03178d2b6f05cdb2e447.zip | |
Create a isFullCopy predicate.
llvm-svn: 134189
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineInstr.h | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/InlineSpiller.cpp | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index 07a14cf0c15..788d149c868 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -278,6 +278,9 @@ public: bool isCopy() const { 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. /// This does not include native copy instructions. diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp index 19ae333115c..0273891d690 100644 --- a/llvm/lib/CodeGen/InlineSpiller.cpp +++ b/llvm/lib/CodeGen/InlineSpiller.cpp @@ -180,11 +180,7 @@ Spiller *createInlineSpiller(MachineFunctionPass &pass, /// isFullCopyOf - If MI is a COPY to or from Reg, return the other register, /// otherwise return 0. static unsigned isFullCopyOf(const MachineInstr *MI, unsigned Reg) { - if (!MI->isCopy()) - return 0; - if (MI->getOperand(0).getSubReg() != 0) - return 0; - if (MI->getOperand(1).getSubReg() != 0) + if (!MI->isFullCopy()) return 0; if (MI->getOperand(0).getReg() == Reg) return MI->getOperand(1).getReg(); |

