You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Promote Copy aggregate arguments borrowed only by inlined device methods #400
A copyable POD aggregate passed to a kernel by value can be forced into NVPTX local memory solely because an inlined helper method takes &self.
Observed flow:
the kernel receives the aggregate by value;
lowering creates an alloca so the caller can form &self;
the helper performs runtime indexing into small fields through that pointer;
after inlining, dynamic GEPs keep SROA from promoting the aggregate;
PTX contains a local depot and ld.local / st.local.
A small mesh handle dropped from 56 bytes of local memory to zero when its read-only topology query used a value receiver, confirming that the borrow alone caused the frame. Larger kernel parameter bundles show the same retained-alloca shape, but changing every read-only method receiver in application code is not a scalable codegen contract.
#398 deliberately restricts selected-address scalarization to compiler-owned local arrays so external/shared pointers keep exactly one dynamic memory access. This issue concerns a compiler-owned alloca created from a by-value Copy argument after borrowing and inlining.
Desired result
Promote eligible compiler-owned Copy aggregates, including small runtime-indexed fields, without requiring application APIs to replace ordinary &self methods with value receivers. Preserve volatile behavior and do not speculate reads or writes through borrowed external pointers. Add a GPU regression asserting correct behavior and no PTX local-memory operations.
Activity
fix(mir-transforms): fail closed on caller provenance before widening…
codegen: scalarize bounded borrowed aggregate reads in MIR (#650)