From: Peizhao Ou Date: Wed, 4 Apr 2018 23:23:31 +0000 (-0700) Subject: Taints upcoming store and adds bogus conditional branches else where. Now as a separa... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=49c02eaad55b68f58d4abdbc22eb08b92a024437;hp=ac6ac4cb6c567726b5ea8c823906a4ab6c8c089a Taints upcoming store and adds bogus conditional branches else where. Now as a separate branch --- diff --git a/lib/CodeGen/CodeGenPrepare.cpp b/lib/CodeGen/CodeGenPrepare.cpp index f4ff3787e63..c9d22a29865 100644 --- a/lib/CodeGen/CodeGenPrepare.cpp +++ b/lib/CodeGen/CodeGenPrepare.cpp @@ -964,19 +964,20 @@ bool AddFakeConditionalBranchAfterMonotonicLoads( } } - // 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(FirstInst); II = dyn_cast(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 = @@ -985,8 +986,7 @@ bool AddFakeConditionalBranchAfterMonotonicLoads( LI->setOrdering(Acquire); Changed = true; } else { - TaintRelaxedLoads(Inst, FirstInst); - Changed = true; + Changed |= taintStoreAddress(SI, Inst); } } } else {