From 720baf04163983ad885dcec17b61e74fe42b9933 Mon Sep 17 00:00:00 2001 From: Robert Lougher Date: Wed, 3 Jul 2019 17:43:55 +0000 Subject: [X86] Avoid SFB - Skip meta instructions This patch generalizes the fix in D61680 to ignore all meta instructions, not just debug info. Patch by Chris Dawson. Differential Revision: https://reviews.llvm.org/D62605 llvm-svn: 365061 --- llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp b/llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp index 3dcc1015dc7..c307700e70b 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 = skipDebugInstructionsBackward( + auto PrevInstrIt = skipMetaInstructionsBackward( 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 StorePrevNonDbgInstr = skipDebugInstructionsBackward( + auto StorePrevNonMetaInstr = skipMetaInstructionsBackward( 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 (StorePrevNonDbgInstr == LoadInst) + if (StorePrevNonMetaInstr == LoadInst) LastLoad = LoadInst->getPrevNode()->getPrevNode(); getBaseOperand(LastLoad).setIsKill(LoadBase.isKill()); } if (StoreBase.isReg()) { MachineInstr *StInst = StoreInst; - if (StorePrevNonDbgInstr == LoadInst) + if (StorePrevNonMetaInstr == LoadInst) StInst = LoadInst; getBaseOperand(StInst->getPrevNode()).setIsKill(StoreBase.isKill()); } -- cgit v1.2.3