[PATCH] D158882: RegisterCoalescer: Don't delete IMPLICIT_DEF if it's live into the same block

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 13:02:36 PDT 2023


arsenm created this revision.
arsenm added reviewers: qcolombet, MatzeB, kparzysz, uabelho, wmi, foad, tpr, dstuttard, bjope.
Herald added subscribers: StephenFan, pengfei, hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Live out implicit_defs need to be kept, but the check for this only
checked if the block parent was the same. This doesn't work if the
parent blocks are the same but the value is live. Fixes verifier error
"Instruction ending live segment doesn't read the register", which
would appear at the coalesced non-implicit_def def.

      

Fixes #38788


https://reviews.llvm.org/D158882

Files:
  llvm/lib/CodeGen/RegisterCoalescer.cpp
  llvm/test/CodeGen/X86/pr38795-verifier-error-pr38788.ll
  llvm/test/CodeGen/X86/pr38795-verifier-error-pr38788.mir
  llvm/test/CodeGen/X86/pr38795.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158882.553583.patch
Type: text/x-patch
Size: 16518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230825/62dd86d9/attachment.bin>


More information about the llvm-commits mailing list