This is an archive of the discontinued LLVM Phabricator instance.

[LowerSwitch] Fixed faulty PHI node update
ClosedPublic

Authored by Ka-Ka on May 18 2018, 1:02 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

Ka-Ka created this revision.May 18 2018, 1:02 AM
arsenm accepted this revision.May 21 2018, 11:36 PM

LGTM

This revision is now accepted and ready to land.May 21 2018, 11:36 PM
This revision was automatically updated to reflect the committed changes.