diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-01 01:26:01 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-01 01:26:01 +0000 |
commit | d256c21666a883b2baafed84732a57f737223cfa (patch) | |
tree | 2aec7db9ccf4b027a05117cf640b9154a59ddada /llvm/lib/CodeGen | |
parent | aba3503639178eef6a1074b9ce8f44df4e7d0b8b (diff) | |
download | bcm5719-llvm-d256c21666a883b2baafed84732a57f737223cfa.tar.gz bcm5719-llvm-d256c21666a883b2baafed84732a57f737223cfa.zip |
Move getBundleStart() into MachineInstrBundle.h.
This allows the function to be inlined, and makes it suitable for use in
getInstructionIndex().
Also provide a const version. C++ is great for touch typing practice.
llvm-svn: 151782
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 10 |
2 files changed, 1 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 03ca72e0818..3e16efa7285 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1522,7 +1522,7 @@ void LiveIntervals::handleMove(MachineInstr* MI) { SlotIndex OldIndex = indexes_->getInstructionIndex(MI); indexes_->removeMachineInstrFromMaps(MI); SlotIndex NewIndex = MI->isInsideBundle() ? - indexes_->getInstructionIndex(MI->getBundleStart()) : + indexes_->getInstructionIndex(MI) : indexes_->insertMachineInstrInMaps(MI); assert(getMBBStartIdx(MI->getParent()) <= OldIndex && OldIndex < getMBBEndIdx(MI->getParent()) && diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 3ab98e1bf57..ff32a66b14c 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -900,16 +900,6 @@ bool MachineInstr::isBundled() const { return nextMI != Parent->instr_end() && nextMI->isInsideBundle(); } -MachineInstr* MachineInstr::getBundleStart() { - if (!isInsideBundle()) - return this; - MachineBasicBlock::reverse_instr_iterator MII(this); - ++MII; - while (MII->isInsideBundle()) - ++MII; - return &*MII; -} - bool MachineInstr::isStackAligningInlineAsm() const { if (isInlineAsm()) { unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm(); |