[llvm] Reapply "[MemCpyOpt] support offset slices for performStackMoveOptzn and processMemCpy", with bug fixed (PR #180002)
Jameson Nash via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 06:16:37 PST 2026
================
@@ -1662,8 +1684,13 @@ bool MemCpyOptPass::performStackMoveOptzn(Instruction *Load, Instruction *Store,
// Check that, from after the Load to the end of the BB,
// - if the dest has any Mod, src has no Ref, and
- // - if the dest has any Ref, src has no Mod except full-sized lifetimes.
- MemoryLocation SrcLoc(SrcAlloca, LocationSize::precise(Size));
+ // - if the dest has any Ref, src has no Mod except full-sized lifetimes
+ // - from SrcPtr minus DestOffset to min(DestSize, SrcSize minus SrcOffset)
+ // - where DestOffset and DestSize could be computed by DestModRefCallback
+ // to be the bounds of the first and last mod region, which is at least
+ // DestOffset to DestSize.
----------------
vtjnash wrote:
Bad reuse of variable names in the comment on my part. They are supposed to be clarifying which are names used in the doc string vs which are indeed existing variables.
https://github.com/llvm/llvm-project/pull/180002
More information about the llvm-commits
mailing list