[PATCH] D122118: [MachineCopyPropagation] Eliminate spillage copies that might be caused by eviction chain

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 00:57:34 PST 2022


lkail added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineCopyPropagation.cpp:1071
+// r4 = COPY r1
+// r1 = COPY r0
+// The algorithm is trying to keep
----------------
qcolombet wrote:
> Technically we could collapse this sequence to:
> ```
> // r0 = COPY r4
> // <def-use r4>
> // r4 = COPY r0
> ```
> 
> I.e., I think it is worth explaining that the propagation doesn't check whether or not `r0` can be altered outside of the chain and that's why we conservatively keep its value as it was before the rewrite. (Would be a nice follow-up fix BTW :)).
Maybe we can check if `r0` is killed to remove one more COPY.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122118/new/

https://reviews.llvm.org/D122118



More information about the llvm-commits mailing list