-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.optimization
Milestone
Description
Currently the ABI for passing optional and error parameters prevent full optimization by LLVM.
-
Sub optimal code generation with full optimization when using
catch |...|
https://godbolt.org/z/xqTKWKW37 -
Optimal code generation with full optimization when performing essentially the same but using
catch 1
https://godbolt.org/z/PWe4GPb3c
For Optional, both variants produce sub optimal code:
https://godbolt.org/z/qGavK9aWK
Note that Swift has a similar strategy (passing a struct), but manages to get better optimization:
https://godbolt.org/z/4xa5Y85Gx
Airbus5717 and komuw
Metadata
Metadata
Assignees
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.optimization