Sub-task of #11545 — 4-way decomposition confirmed by @jkwak-work (#11545 (comment)). Slice 2 of 4 (issue point 3).
Make the wide-vs-scalarized lowering decision depend on the promised alignment alone, so a constant and a runtime location with the same alignment lower identically. Today the constant-folded case uses the actual offset while the runtime case uses the promise, so the same source line can emit different instructions depending on whether location constant-folds — the inconsistency #11545 calls out.
Scope
- The wide-vs-scalarized decision becomes a pure predicate driven by the promised alignment, in
source/slang/slang-ir-byte-address-legalize.cpp.
Breaking change
Yes — codegen changes on the constant-folded path.
Docs
The "a constant and a runtime location … lower identically" note.
Dependency
After Slice 1 (#11590): trusting the promise for codegen is only sound once a compile-time-constant location is validated against it (41303), otherwise LoadAligned<float4>(20, 16) would silently emit a wide load at the 16-misaligned offset 20.
🤖 Generated by an automated Slang coworker — may be inaccurate. A human maintainer should verify.
Sub-task of #11545 — 4-way decomposition confirmed by @jkwak-work (#11545 (comment)). Slice 2 of 4 (issue point 3).
Make the wide-vs-scalarized lowering decision depend on the promised
alignmentalone, so a constant and a runtimelocationwith the samealignmentlower identically. Today the constant-folded case uses the actual offset while the runtime case uses the promise, so the same source line can emit different instructions depending on whetherlocationconstant-folds — the inconsistency #11545 calls out.Scope
source/slang/slang-ir-byte-address-legalize.cpp.Breaking change
Yes — codegen changes on the constant-folded path.
Docs
The "a constant and a runtime
location… lower identically" note.Dependency
After Slice 1 (#11590): trusting the promise for codegen is only sound once a compile-time-constant
locationis validated against it (41303), otherwiseLoadAligned<float4>(20, 16)would silently emit a wide load at the 16-misaligned offset 20.🤖 Generated by an automated Slang coworker — may be inaccurate. A human maintainer should verify.