6 Commits

Author SHA1 Message Date
Erik Eckstein
f5ca12d42b Simplification: check for isolated conformances when simplifying metatype casts
rdar://147417762
2025-04-05 09:00:30 +02:00
Erik Eckstein
d52f7d1619 AST/SIL: Refactor and simplify AST.Type, AST.CanonicalType and SIL.Type
* let `SIL.Type` conform to `TypeProperties` to share the implementation of common type properties between the AST types and `SIL.Type`
* call references to an `AST.Type` `rawType` (instead of just `type`)
* remove unneeded stuff
* add comments
2025-03-14 09:40:22 +01:00
Erik Eckstein
35097b5a71 Optimizer: simplify unconditional_checked_cast to existential metatypes.
Replace `unconditional_checked_cast` to an existential metatype with an `init_existential_metatype`, it the source is a conforming type.
Note that init_existential_metatype is better than unconditional_checked_cast because it does not need to do any runtime casting.
2025-03-07 15:59:33 +01:00
Erik Eckstein
3f95ce9645 Optimizer: fix spelling of the Simplifiable protocol
Rename `Simplifyable` -> `Simplifiable`

NFC
2025-02-12 09:01:11 +01:00
Erik Eckstein
cd59a5e1d0 SimplifyCheckedCast: only simplify if source and destination address types match
Fixes a crash when creating a copy_addr with mismtaching types.
rdar://128195403
2024-05-17 15:07:40 +02:00
Erik Eckstein
1d4054ca32 Optimizer: add simplification for checked_cast_addr_br instructions 2024-03-19 11:58:15 +01:00