summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRobert Lougher <rob.lougher@gmail.com>2019-07-05 12:20:21 +0000
committerRobert Lougher <rob.lougher@gmail.com>2019-07-05 12:20:21 +0000
commit3bea2b15f5366eb706282085b494b2b99c5ec28f (patch)
treeb7d7e7fa8b67062d183471ee447883fd6ce98c57 /llvm/lib
parent5e17ee1e35e4535b51c749186ffbec694b06494b (diff)
downloadbcm5719-llvm-3bea2b15f5366eb706282085b494b2b99c5ec28f.tar.gz
bcm5719-llvm-3bea2b15f5366eb706282085b494b2b99c5ec28f.zip
This reverts r365061 and r365062 (test update)
Revision r365061 changed a skip of debug instructions for a skip of meta instructions. This is not safe, as IMPLICIT_DEF is classed as a meta instruction. llvm-svn: 365198
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp9
-rw-r--r--llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp8
2 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index c3e9c185be9..6f69a0f0bd3 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -1384,7 +1384,7 @@ MachineBasicBlock::computeRegisterLiveness(const TargetRegisterInfo *TRI,
// Try searching forwards from Before, looking for reads or defs.
const_iterator I(Before);
for (; I != end() && N > 0; ++I) {
- if (I->isDebugInstr())
+ if (I->isMetaInstruction())
continue;
--N;
@@ -1423,7 +1423,7 @@ MachineBasicBlock::computeRegisterLiveness(const TargetRegisterInfo *TRI,
do {
--I;
- if (I->isDebugInstr())
+ if (I->isMetaInstruction())
continue;
--N;
@@ -1456,6 +1456,11 @@ MachineBasicBlock::computeRegisterLiveness(const TargetRegisterInfo *TRI,
} while (I != begin() && N > 0);
}
+ // Check for the edge condition where the only instructions between I and
+ // begin() are meta instructions.
+ if (I != begin() && std::prev(I)->isMetaInstruction())
+ I = skipMetaInstructionsBackward(std::prev(I), begin());
+
// Did we get to the start of the block?
if (I == begin()) {
// If so, the register's state is definitely defined by the live-in state.
diff --git a/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp b/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
index c307700e70b..3dcc1015dc7 100644
--- a/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
+++ b/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
@@ -408,7 +408,7 @@ void X86AvoidSFBPass::buildCopy(MachineInstr *LoadInst, unsigned NLoadOpcode,
// If the load and store are consecutive, use the loadInst location to
// reduce register pressure.
MachineInstr *StInst = StoreInst;
- auto PrevInstrIt = skipMetaInstructionsBackward(
+ auto PrevInstrIt = skipDebugInstructionsBackward(
std::prev(MachineBasicBlock::instr_iterator(StoreInst)),
MBB->instr_begin());
if (PrevInstrIt.getNodePtr() == LoadInst)
@@ -496,7 +496,7 @@ void X86AvoidSFBPass::buildCopies(int Size, MachineInstr *LoadInst,
static void updateKillStatus(MachineInstr *LoadInst, MachineInstr *StoreInst) {
MachineOperand &LoadBase = getBaseOperand(LoadInst);
MachineOperand &StoreBase = getBaseOperand(StoreInst);
- auto StorePrevNonMetaInstr = skipMetaInstructionsBackward(
+ auto StorePrevNonDbgInstr = skipDebugInstructionsBackward(
std::prev(MachineBasicBlock::instr_iterator(StoreInst)),
LoadInst->getParent()->instr_begin()).getNodePtr();
if (LoadBase.isReg()) {
@@ -505,13 +505,13 @@ static void updateKillStatus(MachineInstr *LoadInst, MachineInstr *StoreInst) {
// then the partial copies were also created in
// a consecutive order to reduce register pressure,
// and the location of the last load is before the last store.
- if (StorePrevNonMetaInstr == LoadInst)
+ if (StorePrevNonDbgInstr == LoadInst)
LastLoad = LoadInst->getPrevNode()->getPrevNode();
getBaseOperand(LastLoad).setIsKill(LoadBase.isKill());
}
if (StoreBase.isReg()) {
MachineInstr *StInst = StoreInst;
- if (StorePrevNonMetaInstr == LoadInst)
+ if (StorePrevNonDbgInstr == LoadInst)
StInst = LoadInst;
getBaseOperand(StInst->getPrevNode()).setIsKill(StoreBase.isKill());
}
OpenPOWER on IntegriCloud