[llvm-branch-commits] [llvm] [2/2][AMDGPU] Insert IMPLICIT_DEF to provide a reaching def for unspilled reloads (PR #200126)

Dhruva Chakrabarti via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jun 9 19:07:56 PDT 2026


dhruvachak wrote:

https://github.com/llvm/llvm-project/pull/198472#discussion_r3378714457

from @ruiling 

Let me repost my suggestion: `Check the starting point of the liverange of the stack slot. If it points to an instruction which does not store to the stack slot, insert implicit_def before the starting point. If it points to block boundary, then check against the predecessors's first terminator. If the stack slot is not live at the terminator, insert implicit_def before the terminator.` And for your case, when inspecting the live-segment `[start(H), end(H)]`, you need to check the predecessors. As there is no live value in `Entry`, the right insertion point of the implicit_def is before the terminator of `Entry`.

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


More information about the llvm-branch-commits mailing list