From 30f05f3dc7db1c1ab803bf541960952e9ac46281 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Thu, 14 Feb 2013 23:54:40 +0000 Subject: [PATCH] [mips] Disallow moving load/store instructions past volatile instructions. Unfortunately, I wasn't able to create a test case that demonstrates the problem I was trying to fix with this patch. llvm-svn: 175226 --- llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp index b56d9cd22b34..6b25d2d97cb0 100644 --- a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -208,7 +208,7 @@ bool Filler::delayHasHazard(const MachineInstr &Candidate, bool &SawLoad, // Loads or stores cannot be moved past a store to the delay slot // and stores cannot be moved past a load. - if (Candidate.mayStore()) { + if (Candidate.mayStore() || Candidate.hasOrderedMemoryRef()) { HasHazard |= SawStore | SawLoad; SawStore = true; } else if (Candidate.mayLoad()) { -- GitLab