This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Remove invariant requirement from isSCEVExprNeverPoison
ClosedPublic

Authored by reames on Sep 30 2021, 4:17 PM.

Details

Summary

This code is attempting to prove that I must execute if we enter the defining scope of the SCEV which will be created from I. In the case where it found a defining addrec scope, it had a rather odd restriction that all of the other operands must be loop invariant in that addrec's loop.

As near as I can tell here, we really only need a upper bound on the defining scope. If we can prove the stronger property, then we must also have proven the property on the exact defining scope as well.

In practice, the actual effect of this change is narrow. The compile time restriction at the top of the routine basically limits us to I being an arithmetic in some loop L with both an addrec operand in L, and a unknown operands in L. Possible to demonstrate, but the main value of the change is removing unneeded code.

Diff Detail

Event Timeline

reames created this revision.Sep 30 2021, 4:17 PM
reames requested review of this revision.Sep 30 2021, 4:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2021, 4:17 PM
reames updated this revision to Diff 376395.Sep 30 2021, 4:20 PM

(correct diff this time)

nikic accepted this revision.Oct 1 2021, 1:25 AM

LGTM, I came to the same conclusion when looking at this code yesterday...

This revision is now accepted and ready to land.Oct 1 2021, 1:25 AM