Page MenuHomePhabricator

[InstSimplify] simplifyUnsignedRangeCheck(): handle more cases (PR43251)

Authored by lebedev.ri on Tue, Sep 10, 12:06 PM.



I don't have a direct motivational case for this,
but it would be good to have this for completeness/symmetry.

This pattern is basically the motivational pattern from
but with different predicate that requires that the offset is non-zero.

The completeness bit comes from the fact that a similar pattern (offset != zero)
will be needed for,
so it'd seem to be good to not overlook very similar patterns..


Also, there is something odd with isKnownNonZero(), if the non-zero
knowledge was specified as an assumption, it didn't pick it up (PR43267)

Diff Detail

Event Timeline

lebedev.ri created this revision.Tue, Sep 10, 12:06 PM
lebedev.ri edited the summary of this revision. (Show Details)Tue, Sep 10, 1:12 PM
spatel added inline comments.Wed, Sep 11, 8:11 AM

Can the diffs to thread the full SimplifyQuery through the calls be done as a preliminary step?
I'm not sure how to expose a diff in a test, but I'd think it's not quite 'NFC', so it should be an independent change.

lebedev.ri added inline comments.Wed, Sep 11, 8:16 AM

I actually messed up in D67332, i didn't actually mean to *only* pass DL, it just kind-of fell through cracks :/
So passing SimplifyQuery is actually *intended* as NFC, but then i'm trying to balance
between having too much patches, and having too big patches.
Let me see if i can come up with a test.

spatel added inline comments.Wed, Sep 11, 8:24 AM

I'm fine with just changing the code by inspection as a preliminary to this patch; it's clearly an improvement.

lebedev.ri marked 4 inline comments as done.Wed, Sep 11, 8:31 AM
lebedev.ri added inline comments.

Done in rL371630, will rebase in a sec.

lebedev.ri marked an inline comment as done.

Rebased to only contain the actual change itself and none of the SimplifyQuery threading-in.

spatel accepted this revision.Wed, Sep 11, 12:54 PM


This revision is now accepted and ready to land.Wed, Sep 11, 12:54 PM


Thank you for the review.

This revision was automatically updated to reflect the committed changes.