+ // For better performance, we can add a "AND X 0" instruction before the
+ // condition.
+ auto* FirstInst = findFirstStoreCondBranchInst(LI);
+ Instruction* InsertPoint = nullptr;
+ if (FirstInst == nullptr) {
+ InsertPoint = LI->getParent()->getTerminator();
+ InsertPoint = LI->getNextNode();
+ } else {
+ InsertPoint = LI->getNextNode();
+ }
+ IRBuilder<true, NoFolder> Builder(InsertPoint);
+ auto* AndZero = dyn_cast<Instruction>(
+ Builder.CreateAnd(LI, Constant::getNullValue(LI->getType())));