This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Change the SCEV Predicates interfaces for conversion to AddRecExpr to return SCEVAddRecExpr* instead of SCEV*
ClosedPublic

Authored by sbaranga on Mar 22 2016, 12:05 PM.

Details

Summary

This changes the conversion functions from SCEV * to SCEVAddRecExpr from
ScalarEvolution and PredicatedScalarEvolution to return a SCEVAddRecExpr*
instead of a SCEV* (which removes the need of most clients to do a
dyn_cast right after calling these functions).

We also don't add new predicates if the transformation was not successful.

This is not entirely a NFC (as it can theoretically remove some predicates
from LAA when we have an unknown dependece), but I couldn't find an obvious
regression test for it.

Diff Detail

Event Timeline

sbaranga updated this revision to Diff 51318.Mar 22 2016, 12:05 PM
sbaranga retitled this revision from to [SCEV] Change the SCEV Predicates interfaces for conversion to AddRecExpr to return SCEVAddRecExpr* instead of SCEV*.
sbaranga updated this object.
sbaranga added a reviewer: sanjoy.
sbaranga added a subscriber: llvm-commits.
sanjoy accepted this revision.Mar 22 2016, 2:09 PM
sanjoy edited edge metadata.

lgtm with minor nits

lib/Analysis/ScalarEvolution.cpp
9916

Use auto * here, to make it obvious that it is a pointer.

10141–10145

Use auto * here (to make it obvious that this is a pointer).

This revision is now accepted and ready to land.Mar 22 2016, 2:09 PM
sbaranga updated this revision to Diff 51423.Mar 23 2016, 8:33 AM
sbaranga edited edge metadata.

Replace auto with auto *.

sbaranga closed this revision.Mar 23 2016, 8:34 AM
This revision was automatically updated to reflect the committed changes.

Thanks! r264161