aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-02-11 21:23:47 +0000
committermlugg <mlugg@mlugg.co.uk>2024-02-16 11:26:32 +0000
commit2e27967a81d325047e6d82f8c0722a8a654d1ac7 (patch)
treec22414dd9d53298085a27932f071edcbdde2b912 /src/Module.zig
parent51e96a823ce21a6b027bfdf55d94c3872a103703 (diff)
downloadzig-2e27967a81d325047e6d82f8c0722a8a654d1ac7.tar.gz
zig-2e27967a81d325047e6d82f8c0722a8a654d1ac7.zip
AstGen: avoid emitting multiple `ret_type` instructions
This is a small optimization to generated ZIR. In any function where the return type is not a trivial Ref, we know it is almost certainly not `void` (unless the user aliased it or did something else weird to fool AstGen), and thus the return type is very likely to be required for return value RLS at some point. Thus, we can just emit one `ret_type` at the start of the function and use it throughout. This sees a very small improvement in overall ZIR bytes.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions