Commit Graph

8 Commits

Author SHA1 Message Date
Erik Eckstein
efb85ff50d tests: Fix two optimizer tests for rebranch 2024-08-23 11:12:19 +02:00
Erik Eckstein
da0dea1ffb tests: adapt some optimizer tests for rebranch
rdar://133510613
2024-08-09 10:59:17 +02:00
Zak Kent
3b4e94f65b [SILGen] Emit toplevel code through emitFunctionDefinition
Emit SILDeclRefs representing entry points with SourceFile
source correctly.
2023-08-08 11:25:11 -07:00
Erik Eckstein
fe367e8013 Optimizer/IRGen: allow enums in static initializers of globals
The main change here is in IRGen which needs to be able to emit constant enum values.
Use `emitValueInjection` to create the enum constant.
Usually this method creates code in the current function.
But if all arguments to the enum are constant, the builder never has to emit an instruction.
Instead it can constant fold everything and just returns the final constant.

Also, create statically initialized let-globals as constant global (`constant` instead of `global`).
2023-05-25 16:28:41 +02:00
Erik Eckstein
5c0ae940eb Optimizer: add simplification for the value_to_bridge_object instruction
This comes up in the code for constructing an empty string literal.
With this optimization it's possible to statically initialize empty string global variables.
2023-05-25 16:28:41 +02:00
Erik Eckstein
ed54253d29 SIL Optimizer: remove legacy C++ passes
They were used as a backup during the transition to Swift passes. Now they are not needed anymore.
2022-10-20 18:31:06 +02:00
zoecarver
1f66767609 Update requirements for test 2019-12-24 15:40:10 -08:00
Erik Eckstein
4191149fc0 tests: add an end-to-end test to check that the compiler generates optimal code for static String constants. 2018-06-07 13:44:03 -07:00