This is an archive of the discontinued LLVM Phabricator instance.

[NFC][ValueTracking] Hoist isValidAssumeForContext out of switch
ClosedPublic

Authored by mkazantsev on May 5 2023, 1:45 AM.

Details

Summary

There is a lot of copy-paste-ish checks while this can be done once.

Diff Detail

Event Timeline

mkazantsev created this revision.May 5 2023, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2023, 1:45 AM
mkazantsev requested review of this revision.May 5 2023, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2023, 1:45 AM

I don't know, does it have any negative CT impact? If not, then I think this should be done.

nikic accepted this revision.May 5 2023, 2:10 AM

LGTM. I'm not seeing a compile-time impact, though CTMark probably isn't using assumes much. But generally, isValidAssumeForContext() shouldn't be that expensive nowadays.

This revision is now accepted and ready to land.May 5 2023, 2:10 AM