[PATCH] D11995: [SimplifyCFG] Prune code from a provably unreachable switch default

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 09:41:03 PDT 2015


hans accepted this revision.
hans added a comment.
This revision is now accepted and ready to land.

I was trying to remember where I'd seen something like this before, and found this in a patch that never got submitted: http://reviews.llvm.org/D6269#inline-51754

It's taking the same idea a little further by taking known bits into account. For example, if the condition is an i4 where we know the two most significant bits are always 0, having four "live" cases (0,1,2,3) means the default is unreachable.

Would you like to add that here? Could also be a follow-up if you like.


http://reviews.llvm.org/D11995





More information about the llvm-commits mailing list