diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-29 23:58:39 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-29 23:58:39 +0000 |
commit | 914f2ff9e6969214d84a75745ec2851f045000f7 (patch) | |
tree | 75fc7b31586c0616750a5fbf6696d3fcbe44691e /include/llvm/CodeGen/MachineRegisterInfo.h | |
parent | 6c9fa437167bf420e6cc4b0b577910d634b09ac5 (diff) | |
download | external_llvm-914f2ff9e6969214d84a75745ec2851f045000f7.zip external_llvm-914f2ff9e6969214d84a75745ec2851f045000f7.tar.gz external_llvm-914f2ff9e6969214d84a75745ec2851f045000f7.tar.bz2 |
Begin implementation of an inline spiller.
InlineSpiller inserts loads and spills immediately instead of deferring to
VirtRegMap. This is possible now because SlotIndexes allows instructions to be
inserted and renumbered.
This is work in progress, and is mostly a copy of TrivialSpiller so far. It
works very well for functions that don't require spilling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineRegisterInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index bea64de..066c91b 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/include/llvm/CodeGen/MachineRegisterInfo.h @@ -363,7 +363,18 @@ public: defusechain_iterator operator++(int) { // Postincrement defusechain_iterator tmp = *this; ++*this; return tmp; } - + + /// skipInstruction - move forward until reaching a different instruction. + /// Return the skipped instruction that is no longer pointed to, or NULL if + /// already pointing to end(). + MachineInstr *skipInstruction() { + if (!Op) return 0; + MachineInstr *MI = Op->getParent(); + do ++*this; + while (Op && Op->getParent() == MI); + return MI; + } + MachineOperand &getOperand() const { assert(Op && "Cannot dereference end iterator!"); return *Op; |