OSDN Git Service

[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)
commit9a0f2ee60ef2dd9aa66309afc03b400fa623827f
tree13ff7fa082dd351f40387e54b00f98a30bf7e350
parent76074cad4dea68a13d7feed987f909439df6d4e2
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316711 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
test/Transforms/CodeGenPrepare/skip-merging-case-block.ll