[PATCH] D52002: Switch optimization for known maximum switch values

Ayonam Ray via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 02:54:13 PDT 2018


ayonam added a comment.

In https://reviews.llvm.org/D52002#1237991, @hans wrote:

> The default is unreachable here because it would "fall off" the end of the function without returning, which is undefined behaviour. So the switch lowering should be able to remove the range check for the jump table.


On second thoughts, I realize that the default may not be unreachable in the case that I mentioned since the block beyond the switch block would then be treated as the default.  Am I right?


Repository:
  rL LLVM

https://reviews.llvm.org/D52002





More information about the llvm-commits mailing list