[llvm] [SROA] Pre-split overlapping move slices within a partition (PR #210061)

Yonah Goldberg via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 15:05:32 PDT 2026


================
@@ -4923,7 +4962,37 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
       assert(Offsets.Splits.empty() &&
              "Should not have splits the first time we see an instruction!");
       Offsets.S = &S;
-      Offsets.Splits.push_back(P.endOffset() - S.beginOffset());
+      if (CopyOverlap) {
+        // S is being moved to CopyOverlap, which overlaps with S, so we split S
+        // into three part, which:
+        //  * Starts outside the overlap and is copied into the overlap
----------------
YonahGoldberg wrote:

start outside and start inside rather than starts outside and starts inside

https://github.com/llvm/llvm-project/pull/210061


More information about the llvm-commits mailing list