Repository navigation
feat(mir-importer): support bare struct array constants - #855
Conversation
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: Raul Estrada <[email protected]>
…ntract The PR rewrote promotable_array_element's doc contract (bare-value admission is now wider than promotion; structs fall back to element-wise materialization), but the tuple pointer-to-array test still cited the old cannot-drift-apart phrasing. Comment only. Signed-off-by: nihalpasham <[email protected]>
|
Gist: the project's own missing-arm protocol, done right: the bare-array gate admits Verified here:
The perf follow-up (promoting struct tables to one module-image global, as nvcc emits) is real but correctly out of scope; a tracking issue is being filed. Landing once CI is green. |
Closes #854
Summary
Adds support for bare arrays whose elements are structs.
The MIR importer already has layout-aware struct constant decoding for allocation-backed constants and byte-backed aggregate decoding. This change extends the bare-array element boundary and byte-array dispatch so struct elements can reuse those existing paths.
What changed
MirStructTypeelements in bare array value constants.#[repr(C)]structs,Scope
This intentionally does not change
promotable_array_element.Bare array values can fall back to element-wise materialization, while pointer-to-array constants require the immutable-global path. Widening the promotion predicate here would therefore also widen pointer-to-array semantics, which is outside this change.
Unions are also out of scope.
Validation
The GPU regression covers primitive, enum, tuple, padded/nested/ZST struct, pointer-to-array, and tuple-array static-pointer constants.