DianQK wrote: Could you put your code in `eliminateDeadSwitchCases`? As for how to handle unreachable cases, I think we can introduce a new transformation (or `simplifyUnreachable`). https://github.com/llvm/llvm-project/pull/95665