From 6bc3e13133fc291e2ca373512fc3e443e1cb8b59 Mon Sep 17 00:00:00 2001 From: Chris Dewhurst Date: Mon, 23 May 2016 11:52:28 +0000 Subject: [PATCH] [Sparc] LEON erratum fix - Delay Slot Filler modification. This code should have been with the previous check-in (r270417) and prevents the DelaySlotFiller pass being utilized in functions where the erratum fix has been applied as this will break the run-time code. llvm-svn: 270418 --- llvm/lib/Target/Sparc/DelaySlotFiller.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/llvm/lib/Target/Sparc/DelaySlotFiller.cpp b/llvm/lib/Target/Sparc/DelaySlotFiller.cpp index 48c15cab376f..442e7263e399 100644 --- a/llvm/lib/Target/Sparc/DelaySlotFiller.cpp +++ b/llvm/lib/Target/Sparc/DelaySlotFiller.cpp @@ -273,6 +273,15 @@ bool Filler::delayHasHazard(MachineBasicBlock::iterator candidate, return true; } } + + unsigned Opcode = candidate->getOpcode(); + // LD and LDD may have NOPs inserted afterwards in the case of some LEON + // processors, so we can't use the delay slot if this feature is switched-on. + if (Subtarget->insertNOPLoad() + && + Opcode >= SP::LDDArr && Opcode <= SP::LDrr) + return true; + return false; }