}
}
- // We really need to process the relaxed load now.
+ // We really need to process the relaxed load now. Note that if the next
+ // instruction is a RMW, it will be transformed into a control block, so we
+ // can safely only taint upcoming store instructions.
StoreInst* SI = nullptr;
IntrinsicInst* II = nullptr;
if (FirstInst) {
SI = dyn_cast<StoreInst>(FirstInst);
II = dyn_cast<IntrinsicInst>(FirstInst);
}
- if (FirstInst &&
- (SI || (II && II->getIntrinsicID() == Intrinsic::aarch64_stlxr))) {
+ if (FirstInst && SI) {
// For immediately coming stores, taint the address of the store.
if (FirstInst->getParent() == LI->getParent() ||
DT->dominates(LI, FirstInst)) {
- TaintRelaxedLoads(LI, FirstInst);
+ Changed != taintStoreAddress(SI, LI);
Changed = true;
} else {
auto* Inst =
LI->setOrdering(Acquire);
Changed = true;
} else {
- TaintRelaxedLoads(Inst, FirstInst);
- Changed = true;
+ Changed |= taintStoreAddress(SI, Inst);
}
}
} else {