diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp index b56d9cd22b3..6b25d2d97cb 100644 --- a/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/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()) {