[CGP] Merge empty case blocks if no extra moves are added.
authorBalaram Makam <bmakam@codeaurora.org>
Thu, 26 Oct 2017 22:34:01 +0000 (22:34 +0000)
committerBalaram Makam <bmakam@codeaurora.org>
Thu, 26 Oct 2017 22:34:01 +0000 (22:34 +0000)
commitcddf3c5e1c4c99c56aebe56b3fe96d56fe2fe578
tree7eea3930f1837597ef9803a02d5071454a88a647
parentbfa84325ee6017ff3e9628e0c9cee9076d0963fa
[CGP] Merge empty case blocks if no extra moves are added.

Summary:
Currently we skip merging when extra moves may be added in the header of switch instead of the case block, if the case block is used as an incoming
block of a PHI. If all the incoming values of the PHIs are non-constants and the destination block is dominated by the switch block then extra moves are likely not added by ISel, so there is no need to skip merging in this case.

Reviewers: efriedma, junbuml, davidxl, hfinkel, qcolombet

Reviewed By: efriedma

Subscribers: dberlin, kuhar, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D37343

llvm-svn: 316711
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/Transforms/CodeGenPrepare/skip-merging-case-block.ll