summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-29 23:58:39 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-29 23:58:39 +0000
commit914f2ff9e6969214d84a75745ec2851f045000f7 (patch)
tree75fc7b31586c0616750a5fbf6696d3fcbe44691e /include/llvm/CodeGen
parent6c9fa437167bf420e6cc4b0b577910d634b09ac5 (diff)
downloadllvm-914f2ff9e6969214d84a75745ec2851f045000f7.tar.gz
llvm-914f2ff9e6969214d84a75745ec2851f045000f7.tar.bz2
llvm-914f2ff9e6969214d84a75745ec2851f045000f7.tar.xz
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')
-rw-r--r--include/llvm/CodeGen/MachineRegisterInfo.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h
index bea64de15f..066c91b36c 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;