This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Allow sinking from unique predecessor with multiple edges
ClosedPublic

Authored by junbuml on Aug 19 2016, 11:06 AM.

Details

Summary

We can allow sinking if the single user block has only one unique predecessor, regardless of the number of edges. Note that a switch statement with multiple cases can have the same destination.

Diff Detail

Repository
rL LLVM

Event Timeline

junbuml updated this revision to Diff 68714.Aug 19 2016, 11:06 AM
junbuml retitled this revision from to [InstCombine] Allow sinking from unique predecessor with multiple edges.
junbuml updated this object.
junbuml added reviewers: mcrosier, majnemer, spatel.
junbuml added a subscriber: llvm-commits.
reames accepted this revision.Aug 20 2016, 12:12 PM
reames added a reviewer: reames.
reames added a subscriber: reames.

LGTM

In general, I don't like the fact we have sinking logic in InstCombine at all, but this is a perfectly reasonable extension of the existing design.

This revision is now accepted and ready to land.Aug 20 2016, 12:12 PM
This revision was automatically updated to reflect the committed changes.