[PATCH] D127516: RegisterCoalescer: Fix verifier error when merging copy of undef

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 11:31:09 PDT 2022


MatzeB added inline comments.


================
Comment at: llvm/lib/CodeGen/RegisterCoalescer.cpp:1648
+  // copy introduced a live value.
+  if ((V && V->isPHIDef()) || (!V && !DstLI.liveAt(Idx) && !SrcLI.liveAt(Idx))) {
+    CopyMI->setDesc(TII->get(TargetOpcode::IMPLICIT_DEF));
----------------
- This `DstLI.liveAt(Idx)` can only really be true if we assign to a subregister, can't it? (Otherwise the fact that we are about to (re-)assign the register means that it wouldn't be alive immediately before the copy (except for degenerate cases where the source and destination register of the COPY is the same)...

- Can `SrcLI.liveAt(Idx)` ever be true? Don't we filter for that above in lines 1624-1636?


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

https://reviews.llvm.org/D127516



More information about the llvm-commits mailing list