This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Smart range calculation for SCEVUnknown Phis
ClosedPublic

Authored by mkazantsev on Feb 27 2018, 1:20 AM.

Details

Summary

The range of SCEVUnknown Phi which merges values X1, X2, ..., XN
can be evaluated as U(Range(X1), Range(X2), ..., Range(XN)).

Diff Detail

Repository
rL LLVM

Event Timeline

mkazantsev created this revision.Feb 27 2018, 1:20 AM

Added a test with cycled phis to show explicitly that we do not crush on them.

sanjoy accepted this revision.Feb 28 2018, 12:51 AM

lgtm

include/llvm/Analysis/ScalarEvolution.h
1102 ↗(On Diff #136050)

Triple slash to be consistent.

1103 ↗(On Diff #136050)

Might want to make this a set of PHINode to make what we store here obvious in the type system.

lib/Analysis/ScalarEvolution.cpp
5537 ↗(On Diff #136050)

Can this be a range for?

5545 ↗(On Diff #136050)

assert that deletion was successful.

This revision is now accepted and ready to land.Feb 28 2018, 12:51 AM
This revision was automatically updated to reflect the committed changes.
mkazantsev marked 4 inline comments as done.