[llvm-commits] [Patch] SimplifyCFG: Forward switch condition value to phi node

Hans Wennborg hans at chromium.org
Sat Jun 11 09:25:14 PDT 2011


The attached patch is an attempt to fix PR10103.

In cases such as the attached test, where the case value for a switch
destination is used in a phi node that follows the destination, it
might be better to replace that value with the condition value of the
switch, so that more blocks can be folded away with
TryToSimplifyUncondBranchFromEmptyBlock because there are less
conflicts in the phi node.

I'm not familiar with the optimizations code, so please take a look
and let me know if this is a good idea or not. Your comments are most
welcome.

Thanks,
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: forward-switch-condition-to-phi.patch
Type: text/x-patch
Size: 5402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110611/f5accba5/attachment.bin>


More information about the llvm-commits mailing list