Files
swift-mirror/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification
Erik Eckstein bd1af9283f Optimizer: fix the enum tag comparison optimization
This optimization replaces (the very inefficient) RawRepresentable comparison to a simple compare of enum tags.
However if the raw type is a custom type we don't know how the comparison is implemented.
A custom raw type can implement the case comparison in a way that comparing different cases will return `true`.
Therefore only do the optimization for known stdlib raw value types.

Fixes a mis-compile
https://github.com/swiftlang/swift/issues/87906
rdar://172746003
2026-03-24 08:54:09 +01:00
..