This is an archive of the discontinued LLVM Phabricator instance.

[SCEV][NFC] API for tracking of SCEV users
ClosedPublic

Authored by mkazantsev on Oct 22 2021, 1:06 AM.

Details

Summary

This patch introduces API that keeps track of SCEVs users of
another SCEVs, required to handle invalidations of users along
with operands that comes in follow-up patches.

Diff Detail

Event Timeline

mkazantsev created this revision.Oct 22 2021, 1:06 AM
mkazantsev requested review of this revision.Oct 22 2021, 1:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 22 2021, 1:06 AM
nikic added inline comments.Oct 22 2021, 1:22 AM
llvm/lib/Analysis/ScalarEvolution.cpp
13307

Something we might want to consider is to not track users of SCEVConstant. I believe this is where things are moving in IR (dropping use lists for ConstantData) and we might want to avoid repeating that mistake from the start.

I don't think it's possible for a SCEVConstant to ever become invalid (as they are just integers -- constant expressions are SCEVUnknown), so not having SCEVConstant users should not present an issue for invalidation purposes.

reames accepted this revision.Oct 22 2021, 10:14 AM

LGTM.

llvm/lib/Analysis/ScalarEvolution.cpp
13307

I agree with Nikita here. I'm fine with this either being added before commit (e.g. treating my LGTM as conditional), or a separate follow on commit.

This revision is now accepted and ready to land.Oct 22 2021, 10:14 AM
mkazantsev added inline comments.Oct 24 2021, 9:34 PM
llvm/lib/Analysis/ScalarEvolution.cpp
13307

It's a good point, but I'd prefer to make it a follow-up.

This revision was landed with ongoing or failed builds.Oct 24 2021, 10:15 PM
This revision was automatically updated to reflect the committed changes.