[PATCH] SimplifyCFG: don't remove unreachable defaults from switch instructions; exploit them instead!

Hans Wennborg hans at chromium.org
Fri Dec 5 15:24:31 PST 2014


>>! In D6471#14, @resistor wrote:
> Can you update LowerSwitch.cpp to incorporate this optimization?  Otherwise targets that rely on it are losing this functionality.

It seems LowerSwitch.cpp is already set up to exploit unreachable defaults, see the test in test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll

I guess it's a choice of whether that's important, or if moving popular cases into the default is better. If it's the latter I'm happy to implement it.

http://reviews.llvm.org/D6471






More information about the llvm-commits mailing list