[llvm] [AMDGPU][GIsel] Fix constrainRegAttrs to retain whichever of the two types is more specific instead of always adopting ConstrainingRegTy (PR #227226)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 02:05:38 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-globalisel
Author: adeshcom14
<details>
<summary>Changes</summary>
On extended-LLT targets, a scalar type can be either an untyped s32 or a specifically typed i32/f32. When a combine merges two equivalent registers, code that unifies their types treated these as interchangeable and overwrote the specifically typed registers type with the untyped one, even though its defining instruction never changed. Since GlobalISel's compiled matcher tables only match the specific type, which makes the register as unselectable and crashes.
This patch fixes it to keep the more specific type instead of always taking whichever side happens to be the replacement register.
Fixes: LCOMPILER-2715
Assisted by: Claude Sonnet
---
Full diff: https://github.com/llvm/llvm-project/pull/227226.diff
2 Files Affected:
- (modified) llvm/lib/CodeGen/MachineRegisterInfo.cpp (+10-1)
- (added) llvm/test/CodeGen/AMDGPU/GlobalISel/regbank-combiner-constrain-reg-attrs.ll (+174)
``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````
</details>
https://github.com/llvm/llvm-project/pull/227226
More information about the llvm-commits
mailing list