This is an archive of the discontinued LLVM Phabricator instance.

[SCEV][NFC] Mark methods related to Loop Disposition computation as const
AbandonedPublic

Authored by mkazantsev on Sep 18 2022, 10:53 PM.

Details

Summary

The only field they modify is the corresponding cache, which in this case
should be marked as mutable. This will allow us to verify loop disposition
which is not currently something that we do.

Diff Detail

Event Timeline

mkazantsev created this revision.Sep 18 2022, 10:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2022, 10:53 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
mkazantsev requested review of this revision.Sep 18 2022, 10:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2022, 10:53 PM

I'm not a fan of this -- I'd rather have the const_cast when you call this with UseCache=false. The thing is that SCEV caching is not at all transparent, it is order dependent and riddled with invalidation issues (as you know ^^), so pretending that that these are const does not feel right.

mkazantsev abandoned this revision.Sep 19 2022, 3:27 AM

const_cast may lead to UB unfortunately, and this is the type of bugs I don't want to deal with. :)

Because now verifier only calls it on a local object, I don't care enough if it goes or not. Let's just abandon it.