Missed optimization: layout optimized enums produce slow derived code #55030
Labels
A-codegen
Area: Code generation
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Changing
https://play.rust-lang.org/?gist=9d1ff0355fbfabbc0c47f15e78e94687&version=nightly&mode=debug&edition=2015
to
https://play.rust-lang.org/?gist=faf6db37cdc627b1c5f8d582ad5c6779&version=nightly&mode=release&edition=2015
While this will result in pretty much the same layout as before, any derived code on
Foo
will now generate less optimal code. Apparently llvm can't manage to clean that up.The llvm IR for the first playground link is
while the one for the second link is
We can't improve the derives, because the derives on
Foo
can't see the definition ofBar
.The text was updated successfully, but these errors were encountered: