This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Prove isKnown(Non)Negative using CtxI when possible
AbandonedPublic

Authored by mkazantsev on Sep 26 2021, 11:05 PM.

Details

Summary

Sometimes the (non)negativity of something may only be inferred via context.
Use it when it is available.

Diff Detail

Event Timeline

mkazantsev created this revision.Sep 26 2021, 11:05 PM
mkazantsev requested review of this revision.Sep 26 2021, 11:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2021, 11:05 PM

Theoretically can be costly in terms of CT. Nikita, could you pls check?

nikic requested changes to this revision.Sep 27 2021, 12:50 PM

Theoretically can be costly in terms of CT. Nikita, could you pls check?

Yeah, it is: https://llvm-compile-time-tracker.com/compare.php?from=02d425d09d9da6786500f7bc620fe615c1c2dbf6&to=6373f1816403f66a10407d4227895aaa3b3b85b2&stat=instructions +50% on ClamAV

I think we ran into this with pretty much all attempts to use more context-sensitive reasoning in SCEV, though this is probably the worst impact yet. Probably because this is doing a context-sensitive walk inside another context-sensitive walk.

This revision now requires changes to proceed.Sep 27 2021, 12:50 PM
mkazantsev planned changes to this revision.EditedSep 27 2021, 9:11 PM

Ok that's not good, I'll try to figure something out... Thanks for checking!

mkazantsev abandoned this revision.Oct 12 2021, 1:11 AM

Too expensive, not gonna happen, at least not in current implementation.