Commit Graph

2 Commits

Author SHA1 Message Date
Erik Eckstein
cac594fb86 Optimizer: peephole optimization for raw-value enum comparsions
Optimize (the very inefficient) RawRepresentable comparison function call to a simple compare of enum tags.
For example,
```
  enum E: String {
    case  a, b, c
  }
```
is compared by getting the raw values of both operands and doing a string compare.
This peephole optimizations replaces the call to such a comparison function with a direct compare of the enum tags, which boils down to a single integer comparison instruction.

rdar://151788987
2025-05-27 12:11:03 +02:00
Anthony Latsis
0772f68601 Sema: Fix operator function witness lookup for local adoptees
Operator function witnesses are looked up globally. However, an additional, qualified lookup is warranted if the conforming type is declared in a local context.
2022-06-04 14:03:43 +03:00