[llvm] [SimplifyCFG] Simplify switch with implicit default (PR #95665)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 15 09:38:46 PDT 2024


https://github.com/nikic commented:

This looks like a reasonable addition.

A possible way to make this more flexible would be to require that the default is unreachable, and then check whether all the cases satisfy the predicate. This would allow case holes, though maybe those don't appear in practice.

(The unreachable default ensures that we don't care about non-cases not satisfying the predicate.)

https://github.com/llvm/llvm-project/pull/95665


More information about the llvm-commits mailing list