summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorMarkus Lavin <markus.lavin@ericsson.com>2019-01-03 08:36:06 +0000
committerMarkus Lavin <markus.lavin@ericsson.com>2019-01-03 08:36:06 +0000
commit72b9deb21f12469d025e96fdb9af6aa316f96a47 (patch)
treee54a3161d5cc443bda46ad2c4ff333c18f8e2228 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
parent74e7d26090be48fb99b2c69e48ec66b5007390f3 (diff)
downloadbcm5719-llvm-72b9deb21f12469d025e96fdb9af6aa316f96a47.tar.gz
bcm5719-llvm-72b9deb21f12469d025e96fdb9af6aa316f96a47.zip
[CodeGen] Skip over dbg-instr in twoaddr pass
A DBG_VALUE between a two-address instruction and a following COPY would prevent rescheduleMIBelowKill optimization inside TwoAddressInstructionPass. Differential Revision: https://reviews.llvm.org/D55987 llvm-svn: 350289
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 2e2fe72e539..4b72f6a84ca 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -929,9 +929,12 @@ rescheduleMIBelowKill(MachineBasicBlock::iterator &mi,
MachineBasicBlock::iterator Begin = MI;
MachineBasicBlock::iterator AfterMI = std::next(Begin);
MachineBasicBlock::iterator End = AfterMI;
- while (End->isCopy() &&
- regOverlapsSet(Defs, End->getOperand(1).getReg(), TRI)) {
- Defs.push_back(End->getOperand(0).getReg());
+ while (End != MBB->end()) {
+ End = skipDebugInstructionsForward(End, MBB->end());
+ if (End->isCopy() && regOverlapsSet(Defs, End->getOperand(1).getReg(), TRI))
+ Defs.push_back(End->getOperand(0).getReg());
+ else
+ break;
++End;
}
OpenPOWER on IntegriCloud