[mips] Disallow moving load/store instructions past volatile instructions.
authorAkira Hatanaka <ahatanaka@mips.com>
Thu, 14 Feb 2013 23:54:40 +0000 (23:54 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Thu, 14 Feb 2013 23:54:40 +0000 (23:54 +0000)
Unfortunately, I wasn't able to create a test case that demonstrates the
problem I was trying to fix with this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175226 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsDelaySlotFiller.cpp

index b56d9cd22b3488fb582293934cb97c9d642e4d2d..6b25d2d97cb0e2cc970228a207a1f8eb0a4594e3 100644 (file)
@@ -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()) {