The removal of the cpy instruction is left to the caller of
performCallSlotOptzn(), including the invalidation of MD. Both
call-sites already do this.
Also handle incrementation of NumMemCpyInstr consistently at the
call-site. One of the call-site was already doing this, which
ended up incrementing the statistic twice.
This fix was part of D26739.
LLVMContext::MD_access_group};
combineMetadata(C, cpy, KnownIDs, true);
- // Remove the memcpy.
- MD->removeInstruction(cpy);
- ++NumMemCpyInstr;
-
return true;
}
MD->removeInstruction(M);
M->eraseFromParent();
+ ++NumMemCpyInstr;
return true;
}
}