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

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 04:31:17 PST 2018


hans added a comment.

In D52002#1336135 <https://reviews.llvm.org/D52002#1336135>, @ayonam wrote:

> In D52002#1336134 <https://reviews.llvm.org/D52002#1336134>, @hans wrote:
>
> > No, unreachable means unreachable and the compiler should treat it as such. There's nothing that says the program needs to exit, either with a segfault or anything else, when hitting __builtin_unreachable().
>
>
> That settles the matter.  Thanks.  I will go ahead and modify the patch without the "Widened" field in the IR and post it in a few hours again.  If everything else is fine, I would like to upstream it this week before you go on vacation.


Sounds good.

And please include a test.

The one in D55742 <https://reviews.llvm.org/D55742> doesn't really show the change we're discussing here, i.e. how unreachable defaults affect switch lowering.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D52002/new/

https://reviews.llvm.org/D52002





More information about the llvm-commits mailing list