[PATCH] D106396: Prevent dead uses in register coalescer after rematerialization

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 14:00:06 PDT 2021


rampitec created this revision.
rampitec added reviewers: arsenm, qcolombet, kparzysz, dstuttard.
Herald added subscribers: kerbowa, tpr, hiraditya, nhaehnle, jvesely, MatzeB.
rampitec requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

The coalescer does not check if register uses are available
at the point of rematerialization. If it attempts to rematerialize
an instruction with such uses it can end up with use without a def.

LiveRangeEdit does such check during rematerialization, so just
call LiveRangeEdit::allUsesAvailableAt() to avoid the problem.


https://reviews.llvm.org/D106396

Files:
  llvm/include/llvm/CodeGen/LiveRangeEdit.h
  llvm/lib/CodeGen/RegisterCoalescer.cpp
  llvm/test/CodeGen/AMDGPU/coalescer-remat-dead-use.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106396.360262.patch
Type: text/x-patch
Size: 6787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/6d38164f/attachment-0001.bin>


More information about the llvm-commits mailing list