This is an archive of the discontinued LLVM Phabricator instance.

[SCCP] zap multiple return values
ClosedPublic

Authored by davide on Jul 13 2016, 10:03 PM.

Details

Summary

We can replace the return values with undef if we replaced all the call uses with a constant/undef, in the multiple return value case.

Diff Detail

Repository
rL LLVM

Event Timeline

davide updated this revision to Diff 63918.Jul 13 2016, 10:03 PM
davide retitled this revision from to [SCCP] WIP.
davide updated this object.
davide retitled this revision from [SCCP] WIP to [SCCP] zap multiple return values.Jul 13 2016, 10:37 PM
davide updated this object.
davide added a reviewer: eli.friedman.
davide added a subscriber: llvm-commits.
eli.friedman added inline comments.Jul 13 2016, 10:54 PM
lib/Transforms/Scalar/SCCP.cpp
1908 ↗(On Diff #63918)

Given the isStructTy assert, can you just use cast<> here?

1914 ↗(On Diff #63918)

If this actually passes make check, we need more tests. (There are two loops here.)

davide updated this revision to Diff 64061.Jul 14 2016, 4:00 PM

Fixed a silly bug, added a test.

lib/Transforms/Scalar/SCCP.cpp
1908 ↗(On Diff #63918)

Done.

1914 ↗(On Diff #63918)

Indeed.

davide updated this revision to Diff 64062.Jul 14 2016, 4:02 PM

Pass AddressTakenFunctions by reference to avoid an useless copy.

eli.friedman accepted this revision.Jul 20 2016, 12:36 PM
eli.friedman edited edge metadata.

Sorry about the delay. LGTM.

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

ping

Sorry about the delay. LGTM.

Thanks for your review, Eli.