[PATCH] D47055: [LowerSwitch] Fixed faulty PHI node update

Karl-Johan Karlsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 01:02:13 PDT 2018


Ka-Ka created this revision.
Ka-Ka added reviewers: hans, reames, arsenm.
Herald added a subscriber: wdng.

When lowerswitch merge several cases into a new default block it's not
updating the PHI nodes accordingly. The code that update the PHI nodes
for the default edge only update the first entry and do not remove the
remaining ones, to make sure the number of entries match the number of
predecessors.

This is easily fixed by replacing the code that update the PHI node with
the already existing utility function for updating PHI nodes.


Repository:
  rL LLVM

https://reviews.llvm.org/D47055

Files:
  lib/Transforms/Utils/LowerSwitch.cpp
  test/Transforms/Util/lowerswitch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47055.147445.patch
Type: text/x-patch
Size: 4226 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180518/74d69e06/attachment.bin>


More information about the llvm-commits mailing list