[PATCH] Switch To Select optimization , fixed case with multiple incoming edges from same block

Marcello Maggioni hayarms at gmail.com
Sun Oct 12 17:00:31 PDT 2014


Hi hans, joerg, Jiangning,

Hello, this is a reattempt to push the Switch To Select optimization for switches with only two cases

This is the fix for this patch http://reviews.llvm.org/D5620  that assumed that PHIs should never have multiple incoming edges from the same block , but even if the IR Verifier enforces this condition, it seems to be not followed in the code in SimplifyCFG where it is actually expected by certain optimizations.

This patch makes sure this code follows that convention as well.

http://reviews.llvm.org/D5746

Files:
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Transforms/SimplifyCFG/UnreachableEliminate.ll
  test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
  test/Transforms/SimplifyCFG/switch-to-select-two-case.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5746.14779.patch
Type: text/x-patch
Size: 10597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141013/a483e542/attachment.bin>


More information about the llvm-commits mailing list