This is an archive of the discontinued LLVM Phabricator instance.

[SCCP] Handle assume predicates
ClosedPublic

Authored by nikic on Jul 6 2020, 1:36 PM.

Details

Summary

Take assume predicates into account when visiting ssa.copy. The handling is the same as for branch predicates, with the difference that we're always on the true edge.

Diff Detail

Event Timeline

nikic created this revision.Jul 6 2020, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2020, 1:36 PM
nikic marked an inline comment as done.Jul 6 2020, 1:47 PM
nikic added inline comments.
llvm/lib/Transforms/Scalar/SCCP.cpp
1337

We could set MayIncludeUndef=false for assumes (as undef/poison has always been UB there), but I didn't think it worthwhile to make the distinction, as we plan to flip this for branches in the future anyway.

nikic retitled this revision from [SCCP] Handle assume predictes to [SCCP] Handle assume predicates.Jul 6 2020, 11:50 PM
fhahn accepted this revision.Jul 7 2020, 2:39 AM

LGTM, thanks!

llvm/lib/Transforms/Scalar/SCCP.cpp
1337

It's probably not worth the trouble and we should just prioritize flipping the flag in general.

This revision is now accepted and ready to land.Jul 7 2020, 2:39 AM
This revision was automatically updated to reflect the committed changes.