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

Owen Anderson resistor at mac.com
Fri Dec 5 17:47:36 PST 2014


> On Dec 5, 2014, at 3:24 PM, Hans Wennborg <hans at chromium.org> wrote:
> 
>>> ! 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 <http://reviews.llvm.org/D6471>

I don’t have any particular knowledge that LowerSwitch is doing something undesirable, I just wanted to make sure we aren’t losing existing functionality on that path.

—Owen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141205/c0509ea3/attachment.html>


More information about the llvm-commits mailing list