Closed SingleAccretion closed 3 months ago
@dotnet/nativeaot-llvm
Looks good, do the implicit byrefs cover some uses of class/struct fields ?
So in the implicit byref case, what we have is a struct argument that's accessed indirectly. Usually we can already prove this access 'in-bounds' with LEA
s, but it is still beneficial to add the annotation because LLVM can otherwise struggle to lower stuff like:
*implicitByref = some-struct-value;
--> lowered by LLVM as:
*implicitByref = some-struct-value[0];
*(implicitByref + 8) = some-struct-value[1];
optimally due to https://github.com/llvm/llvm-project/issues/79692.
It also theoretically enables some more advanced optimizations like speculative stores, however, I did not see that in the diffs.
For the shadow stack, return buffer and implicit byrefs.
Additionally, annotate the whole funclet tree with
optnone
/optsize
, not just the root function.The diffs are modest, and come from more usage of the WASM address modes: