This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Simplify/generalize howFarToZero solving.
ClosedPublic

Authored by efriedma on Jan 18 2017, 5:24 PM.

Details

Summary

Make SolveLinEquationWithOverflow take the start as a SCEV, so we can solve more cases. With that implemented, get rid of the unnecessary special case for powers of two.

The additional functionality probably isn't particularly useful, but it might help a little for certain cases involving pointer arithmetic.

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Jan 18 2017, 5:24 PM
sanjoy accepted this revision.Jan 25 2017, 5:32 PM

LGTM

lib/Analysis/ScalarEvolution.cpp
7037 ↗(On Diff #84914)

Can't we keep this same assert using getScalarTypeInBits?

This revision is now accepted and ready to land.Jan 25 2017, 5:32 PM
This revision was automatically updated to reflect the committed changes.