}
// Taints the 'Inst' (i.e., adds a fake conditional block that uses the 'Inst')
-// at the beginning of basic block 'BB'. Note that if 'Inst' does not dominate
-// 'BB', we need to add appropriate an PHI node and taint the PHI node. Returns
-// true if the code is changed, and false otherwise.
-void TaintAtBlockBeginning(Instruction* Inst, BasicBlock* BB, DominatorTree* DT) {
+// at the beginning of basic block 'BB'. Note that we need to add an appropriate
+// PHI node and taint the PHI node. Returns true if the code is changed, and
+// false otherwise.
+void TaintAtBlockBeginning(Instruction* Inst, BasicBlock* BB) {
auto* CurBB = Inst->getParent();
auto* FirstInst = BB->getFirstNonPHI();
- if (DT->dominates(Inst, FirstInst)) {
- return TaintRelaxedLoads(&*Inst, FirstInst);
- }
IRBuilder<true, NoFolder> Builder(FirstInst);
auto* Phi = Builder.CreatePHI(Inst->getType(), 0, Inst->getName() + ".phi");
// Multiple blocks going to BB. We should add a PHI node w.r.t. 'Inst'.
void TaintRelaxedLoads(Instruction* UsageInst, Instruction* InsertPoint);
// Taints the 'Inst' (i.e., adds a fake conditional block that uses the 'Inst')
-// at the beginning of basic block 'BB'. Note that if 'Inst' does not dominate
-// 'BB', we need to add appropriate an PHI node and taint the PHI node. Returns
-// true if the code is changed, and false otherwise.
-void TaintAtBlockBeginning(Instruction* Inst, BasicBlock* BB, DominatorTree* DT);
+// at the beginning of basic block 'BB'. Note that we need to add an appropriate
+// PHI node and taint the PHI node. Returns true if the code is changed, and
+// false otherwise.
+void TaintAtBlockBeginning(Instruction* Inst, BasicBlock* BB);
// XXX-comment: Finds the appropriate Value derived from an atomic load.
// 'ChainedBB' contains all the blocks chained together with unconditional