[SplitLandingPadPredecessors] Create a PHINode for the original landingpad only if...
authorChen Li <meloli87@gmail.com>
Wed, 6 Jan 2016 20:32:05 +0000 (20:32 +0000)
committerChen Li <meloli87@gmail.com>
Wed, 6 Jan 2016 20:32:05 +0000 (20:32 +0000)
commita03271ee00d26433c028576c66db8f79130f03c6
tree030db069ed265b26477704bace84113db0e5e626
parentbb81476a2869c30fcd85cfd4365f33211eeab061
[SplitLandingPadPredecessors] Create a PHINode for the original landingpad only if it has some uses

Summary: This patch adds a check in SplitLandingPadPredecessors to see if the original landingpad instruction has any uses. If not, we don't need to create a PHINode for it in the joint block since it's gonna be a dead code anyway. The motivation for this patch is that we found a bug that SplitLandingPadPredecessors created a PHINode of token type landingpad, which failed the verifier since PHINode can not be token type. However, the created PHINode will never be used in our code pattern. This patch will workaround this bug, and we might add supports in SplitLandingPadPredecessors to handle token type landingpad with uses in the future.

Reviewers: reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15835

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256972 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/BasicBlockUtils.cpp
test/Transforms/RewriteStatepointsForGC/two-invokes-one-landingpad.ll [new file with mode: 0644]