Files
metal2vulkan/docs
Anees Iqbal 5e4e9bc60c Make a byval argument's copy at its call, so the inliner takes the call
A byval(T) parameter is the callee's own copy of the T its argument
points to, made at the call. Apple's OpenCL compiler passes a struct
kernel argument so: __entry_st copies the value from its constant buffer
into an alloca and calls st with that pointer byval. The inliner refused
every byval call (DirectCall), so a struct passed by value did not
compile (msi job m3-max-4674: the engine's by-value reflection test).

canon::byval::explicit now runs before pointer erasure: each call that
passes a thread-memory argument byval gets an alloca T and an
llvm.memcpy of T's bytes from the argument just before the call, passes
the copy as a plain pointer, and the attribute leaves the call and every
function's parameters. An argument outside thread memory, or a T
without a size, leaves the module as it was, and the call stays
refused, typed.

Tests: a byval argument is copied at its call and inlined; one outside
thread memory stays DirectCall at the call, naming the callee.

(cherry picked from commit 85844bd545602fa1bc14cb410e6e0b89b3a8c696)
2026-11-07 11:43:21 -08:00
..