Page MenuHomePhabricator

[SCEV] Remove validity check on lookup (NFC)

Authored by nikic on Nov 19 2021, 9:52 AM.



When the value held by SCEVUnknown is removed, we will call forgetMemoizedValues() on it in

After recent changes, this will also forget memoized values on recursive users. After D113349 this additionally clears the values from the ValueExprMap. This means that the nullptr SCEVUnknown will no longer be directly or indirectly part of ValueExprMap, and we can drop the validity check in getSCEV().

This simplifies our invariants (we essentially remove the notion of an "invalid" SCEV) and saves a bit of compile-time:

Diff Detail

Event Timeline

nikic created this revision.Nov 19 2021, 9:52 AM
nikic requested review of this revision.Nov 19 2021, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2021, 9:52 AM

Can we replace it with assert for the first time, and then delete it when we make sure it never fails?

nikic abandoned this revision.Nov 26 2021, 12:02 PM

Abandoning in favor of D114633, which has the requested assert.