[llvm] Mips: Mark the $gp setup copy dead when erasing the call's $gp use (PR #227216)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 01:41:15 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-mips
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
MipsOptimizePICCall drops the implicit $gp operand from a call when the
lazy binding stub for the callee has already run. The copy that set $gp
up for that call then has no reader left, but nothing flagged it, so the
MIR carried a live def until a later liveness recomputation cleaned it
up.
The pass already walks each block in order, so track the reaching
definition of $gp as it goes and mark it dead when the use is erased.
Co-Authored-By: Claude Opus 5 <noreply@<!-- -->anthropic.com>
---
Full diff: https://github.com/llvm/llvm-project/pull/227216.diff
2 Files Affected:
- (modified) llvm/lib/Target/Mips/MipsOptimizePICCall.cpp (+35-25)
- (added) llvm/test/CodeGen/Mips/optimize-pic-call-dead-gp.ll (+78)
``````````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/227216
More information about the llvm-commits
mailing list