[PATCH] D12249: Remove the final bit test during lowering switch statement if all cases in bit test cover a contiguous range.

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 16:42:53 PDT 2015


congh added a comment.

In http://reviews.llvm.org/D12249#230525, @davidxl wrote:

> If subtraction is always done (when it is contiguous), it is always a win? There are cases the last test is rarely taken.


OK. So should I calculated the potential win by taking the probability of the last test into consideration? Or if the value can fit in 64-bit we don't to this optimization?


http://reviews.llvm.org/D12249





More information about the llvm-commits mailing list