[llvm] [MachineCopyPropagation] When the source of PreviousCopy is undef, we cannot replace sub register (PR #74682)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 06:03:14 PST 2023


================
@@ -0,0 +1,145 @@
+# RUN: llc -o - %s -O3 -mcpu=apple-m1 -mtriple=arm64-apple-macos | FileCheck %s
----------------
DianQK wrote:

Interestingly, I can use it in with `--start-before`.
First run with `--start-before=machine-cp,0 --stop-before=machine-cp,2`, then run with `--start-before=machine-cp,2 --stop-after=machine-cp,2`. The output is:

```
MCP: Copy is a deletion candidate:   $x8 = ORRXrs $xzr, undef $x0, 0, implicit $w0
MCP: copy is a NOP, removing:   dead renamable $w8 = ORRWrs $wzr, $w0, 0, implicit-def dead $x8
```

Maybe an analysis pass is missing?

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


More information about the llvm-commits mailing list