[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.

llvm-svn: 175226

llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp

index b56d9cd..6b25d2d 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()) {