[llvm-commits] PATCH: instcombine switch on select of constants to br
nicholas at mxc.ca
Sun Jan 9 20:46:39 CST 2011
Alistair Lynn wrote:
> The attached patch catches a previously missed optimisation on switches of the
> form switch (select cond, A, B) where A and B are constants - the switch can be
> folded to a conditional branch on cond.
This isn't safe to do here: InstCombine needs to preserve the CFG, which
means that each block must have the same successors before and after
instcombine runs. Instead, please add this optimization to SimplifyCFG
if it isn't there already.
More information about the llvm-commits