return false;
}
-static bool isLoad(MachineInstr* MI) {
+// XXX-comments: Returns true if this is a "normal" load, which refers to loads
+// that relaxed loads will be compiled to. This function is useful when we want
+// to extend the effect of a 'dmb ld' fence to subsequent stores (in the same
+// BB) that has not been interrupted by relaxed loads. Note that acquire loads
+// will be compiled to LDA*, and the load part of RMWs will be compiled to LDAX*
+// or LDX*, which would be in a different basic block.
+static bool isNormalLoad(MachineInstr* MI) {
switch (MI->getOpcode()) {
default: { return false; }
case AArch64::LDRBBpost:
DEBUG(dbgs() << "Added barrier instruction\n\t" << *DMBInst
<< "\n\tfor " << *MI << "\n");
// Skip all the way till we reach the end of the basic block or a load.
- while (MBBI != E && !isLoad(&*MBBI) && !isBranch(MBBI)) {
+ while (MBBI != E && !isNormalLoad(&*MBBI) && !isBranch(MBBI)) {
MBBI++;
}
break;