[PATCH] D60584: Conversion of a switch table to a bitmap is not profitable for -Os and -Oz compilation

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 04:57:12 PDT 2019


hans added a comment.

First I was confused because your message mentions jump tables, but this is only about the switch-to-lookup table transformation in SimplifyCFG. So there are no jump tables involved, this is just about whether packing the lookup table into a "bitmap" scalar is a good idea or not.

Adding a -fno-switch-bitmap option doesn't seem like a great idea to me. Would it be possible to tweak the heuristic for when to emit the "bitmap lookup table" in some way instead? Currently we always do it if the table fits in a register. Maybe it should be more conservative, at least when optimizing for size, maybe depending on target?


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

https://reviews.llvm.org/D60584





More information about the llvm-commits mailing list