mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, switches over extremely large integers (e.g. i832) were emitted when emitting switches with many spare bits. Such switches result in unfortunate downstream codegen. Here, for large enums (currently, more than two words) the preexisting EnumPayload::emitCompare function is used to compare each of the enum cases in turn with the payload's value. The result is a series of cond_br where the conditional is made by anding together word-size chunks of the payload value with word-size chunks of each enum case's tag, subject to masking. rdar://83158525
1.3 KiB
1.3 KiB