[llvm] [CodeGen][AMDGPU] TwoAddress: Only skip undef COPY at REG_SEQUENCE lowering when there is Live info or no uses for subreg (PR #175598)
Felipe Quezada via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 22 09:55:55 PST 2026
kezada94 wrote:
I have updated the solution to what I believe to be a better and safer approach.
Currently, the compiler doesn't create a COPY for undef operands while lowering REG_SEQUENCE, and only if LIS information is available, it propagates the undef flag to the subreg uses. So, if LIS isn't available, we can end up with some uses without def of those lanes.
Now, we check which lanes are used in a single scan of use_nodbg_operands() per REG_SEQ, and perform the skip of the COPY only if LIS is avaible (as undef will be propagated later) or if there are no uses for that lane.
There is still a scan of the use list, but now it's only one per REG_SEQ and I think it's necessary, as there is no guarantee to have LIS or other analysis pass information at this stage.
https://github.com/llvm/llvm-project/pull/175598
More information about the llvm-commits
mailing list