Add comments and move assignment statement. If sawStore is true, sawLoad does
not have to be set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141147 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp
index b69e579..9d10447 100644
--- a/lib/Target/Mips/MipsDelaySlotFiller.cpp
+++ b/lib/Target/Mips/MipsDelaySlotFiller.cpp
@@ -174,10 +174,12 @@
if (candidate->isImplicitDef() || candidate->isKill())
return true;
+ // Loads or stores cannot be moved past a store to the delay slot
+ // and stores cannot be moved past a load.
if (candidate->getDesc().mayLoad()) {
- sawLoad = true;
if (sawStore)
return true;
+ sawLoad = true;
}
if (candidate->getDesc().mayStore()) {