[llvm] [SimplifyCFG] Add optimization for switches of powers of two (PR #70977)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 05:37:11 PST 2023


DKay7 wrote:

> Shouldn't this transform be part of SwitchToLookupTable()? I'm not sure it makes sense to do this independently, if we can't form a lookup table.

I decided to create separated function to allow another optimizations such as `ReduceSwitchRange` to subsequently affect switch-case before jump table is created. 

https://github.com/llvm/llvm-project/pull/70977


More information about the llvm-commits mailing list