[Comgr][hotswap] Add raise_failure + RaiseContext + register file#2551
Open
tgymnich wants to merge 1 commit into
Open
[Comgr][hotswap] Add raise_failure + RaiseContext + register file#2551tgymnich wants to merge 1 commit into
tgymnich wants to merge 1 commit into
Conversation
Author
This was referenced May 15, 2026
93fa2cd to
a827d06
Compare
a006842 to
fbda441
Compare
a827d06 to
19af066
Compare
fbda441 to
dcbd299
Compare
19af066 to
0f28b23
Compare
dcbd299 to
a3e1f92
Compare
0f28b23 to
426a1be
Compare
a3e1f92 to
b30be20
Compare
426a1be to
268cdab
Compare
b30be20 to
d303c65
Compare
268cdab to
9369d97
Compare
d303c65 to
b8a59da
Compare
3473ede to
3d7dfce
Compare
b8a59da to
716a86f
Compare
Foundation infrastructure consumed by every per-format handler:
* raise_failure.{h,cpp} — `RaiseFailure` value type with structured
`Reason`, `Mnemonic`, `Format`, `Detail`, etc. fields plus typed
factories (`unsupportedOpcode`, `unsupportedShape`, `bailReason`,
...). Carries the diagnostic data the kerneldex coverage runner
bucketizes on.
* raise_context.{h,cpp} — `RaiseContext` is the per-kernel mutable
state every handler reads and writes: LLVMContext / Module / IR
builder, decoded inst stream, register file, kernarg layout,
user-SGPR layout, ISA profile, wave projection, lane-active mask
cache, the pending failure for read-path errors, etc.
* reg_file.{h,cpp} — `AllocaRegFile` models the AMDGPU SGPR/VGPR/AGPR
register files as an alloca-per-physical-reg promoted to SSA by
Phase 6 mem2reg. `readReg{32,64,Vec}` / `writeReg{32,64,Vec}`
handle the bitcasts handlers don't want to repeat.
* kernarg_layout.{h,cpp} — `KernargLayout` builds the byref placeholder
type the lifted IR's first parameter takes. Mirrors the source
kernel's MsgPack-derived offset/size layout.
* user_sgpr_layout.{h,cpp} — `UserSgprLayout::tryFromKernelMeta`
derives the source SGPR ABI (workgroup id / private segment buffer
/ kernarg ptr / kernarg-preload SGPRs) from the kernel descriptor.
* handlers.h — forward declarations for every `handleXXX` entry
point. Concrete handler files come in subsequent commits.
Co-Authored-By: Tim Gymnich <tim@gymni.ch>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Alex Zinenko <git@ozinenko.com>
716a86f to
bb73f44
Compare
3d7dfce to
e404635
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Foundation infrastructure consumed by every per-format handler:
RaiseFailurevalue type with structuredReason,Mnemonic,Format,Detail, etc. fields plus typedfactories (
unsupportedOpcode,unsupportedShape,bailReason,...). Carries the diagnostic data the kerneldex coverage runner
bucketizes on.
RaiseContextis the per-kernel mutablestate every handler reads and writes: LLVMContext / Module / IR
builder, decoded inst stream, register file, kernarg layout,
user-SGPR layout, ISA profile, wave projection, lane-active mask
cache, the pending failure for read-path errors, etc.
AllocaRegFilemodels the AMDGPU SGPR/VGPR/AGPRregister files as an alloca-per-physical-reg promoted to SSA by
Phase 6 mem2reg.
readReg{32,64,Vec}/writeReg{32,64,Vec}handle the bitcasts handlers don't want to repeat.
KernargLayoutbuilds the byref placeholdertype the lifted IR's first parameter takes. Mirrors the source
kernel's MsgPack-derived offset/size layout.
UserSgprLayout::tryFromKernelMetaderives the source SGPR ABI (workgroup id / private segment buffer
/ kernarg ptr / kernarg-preload SGPRs) from the kernel descriptor.
handleXXXentrypoint. Concrete handler files come in subsequent commits.