RegisterCoalescer: Fix verifier error on redef of subregister for live out implicit_defs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Jun 2023 12:36:22 +0000 (08:36 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 24 Jul 2023 16:18:34 +0000 (12:18 -0400)
commit2a53b6c06b2c02c5b06c6138523a83c507adf00f
treeced978e7594e2a597478417c6143c32fe6bc0e72
parent8698262a4365bf22b5b0c96e77bfecd3dcf084a7
RegisterCoalescer: Fix verifier error on redef of subregister for live out implicit_defs

A live out implicit_def wasn't deleted, but the subranges weren't
correctly updated. The main range was correct but the def
corresponding to the initial main range def instruction was missing
from the lanes redefined in another block.

The written lanes are not quite the same as the valid lanes in the
case of an implicit_def.

Fixes verifier error in blender. There is an additional verifier in
some of the testcase variants where an empty subrange remains.
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/test/CodeGen/AMDGPU/blender-coalescer-verifier-error-empty-subrange.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/blender-no-live-segment-at-def-implicit-def.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/liveout-implicit-def-subreg-redef-blender-verifier-error.mir [new file with mode: 0644]