[llvm] [AMDGPU] Add a mir test to verify register-coalesce works for eliminate-save-restore pattern (PR #191583)

Zeng Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 21:54:37 PDT 2026


================

----------------
zwu-2025 wrote:

> Is this representative of the original case? This should have been a COPY to start with

No. The original case is built in this way:
- Using `llc` to get an amdgcn file
- Applying the steps in [python script](https://github.com/ROCm/triton/blob/4837e77a8faac4fd3dd88ac3c6958bf1b5e96130/python/triton/tools/amdgcnas.py#L2888) to manipulate the assembly code directly. The input of this patch is the output of 6th step.

So I manually create the test case in llvm-ir or MIR from the assembly code. In other words, they are feed into `llc`, the register coalescer can do the optimization the same as python script does.

Adding the tests in this patch is in case the register-coalescer is changed in the future.

https://github.com/llvm/llvm-project/pull/191583


More information about the llvm-commits mailing list