swift
e2bb7e8c - SILOptimizer: Remove switch cases matching unavailable enum elements.

Commit
2 years ago
SILOptimizer: Remove switch cases matching unavailable enum elements. Unavailable enum elements cannot be instantiated at runtime without invoking UB. Therefore the optimizer can consider a basic block unreachable if its only predecessor is a block that terminates in a switch instruction matching an unavailable enum element. Furthermore, removing the switch instruction cases that refer to unavailable enum elements is _mandatory_ when `-unavailable-decl-optimization=complete` is specified because otherwise lowered IR for these instructions could refer to enum tag accessors that will not be lowered, resulting in a failure during linking. Resolves rdar://113872720.
Author
Committer
Parents
Loading