Allow emitting more enums as SSA values #138373
Labels
A-codegen
Area: Code generation
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In https://github.com/rust-lang/rust/pull/138157/files#diff-ec1143edac0931158bf79d598432eb162f53400086d30bfe1ba5266559831174R17 you can see that,
because it's in a loop(I think [ed: wrongly, apparently]), theOption<u32>
ends up getting spilled to analloca
despite it havingScalarPair
ABI.However it's only used in the same basic block, with the use after the initialization. Thus ideally we'd be able to just emit it as SSA values directly, rather than needing the read/write to the
alloca
.(The full rule is probably a dominance check, but I don't know if the full one is worth doing, vs a simple approximation that catches common cases.)
The text was updated successfully, but these errors were encountered: