This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Add test reproducing PR53252 (NFC)
ClosedPublic

Authored by rickyz on Feb 13 2022, 10:33 PM.

Details

Summary

Also adds some more test coverage of cases where the
canonicalizeClampLike transaction should not apply.

Diff Detail

Event Timeline

rickyz requested review of this revision.Feb 13 2022, 10:33 PM
rickyz created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2022, 10:33 PM

Feedback in D119690 is that we should have a few more tests to cover other predicate combinations.

rickyz updated this revision to Diff 409086.Feb 15 2022, 4:05 PM

Add test coverage of the other unsigned compare cases.

rickyz added inline comments.Feb 15 2022, 4:25 PM
llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-negative-and-positive-thresholds.ll
201

I omitted the constant offset on x (add i32 %x, C0) in these tests because other transformations that these tests aren't trying to exercise would rewrite them. Happy to add them if preferred - it'd just mean that changes to those other transformations would cause churn in these tests.

rickyz updated this revision to Diff 409114.Feb 15 2022, 6:14 PM
rickyz retitled this revision from [InstCombine] Add test reproducing PR53252 (NFC) to [InstCombine] Add tests reproducing PR53252 (NFC).
rickyz edited the summary of this revision. (Show Details)

Update description.

rickyz updated this revision to Diff 409843.Feb 17 2022, 7:33 PM

Remove non-strict comparison tests.

These do not add any real coverage, as any interesting comparisons
against constants will have been canonicalized to use strict predicates
beforehand.

RKSimon accepted this revision.Apr 26 2022, 1:15 AM
RKSimon added a subscriber: RKSimon.

LGTM with one minor

llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-negative-and-positive-thresholds.ll
190

(trivial) Move the FIXME above the define

This revision is now accepted and ready to land.Apr 26 2022, 1:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2022, 1:15 AM
rickyz updated this revision to Diff 425148.Apr 26 2022, 1:45 AM

Add negative tests exercising Pred0 = {UGE, ULE}.

rickyz updated this revision to Diff 425159.EditedApr 26 2022, 2:25 AM
rickyz marked an inline comment as done.

Update description to clarify that this change only adds a single test triggering PR53252.

rickyz updated this revision to Diff 425161.Apr 26 2022, 2:27 AM
rickyz retitled this revision from [InstCombine] Add tests reproducing PR53252 (NFC) to [InstCombine] Add test reproducing PR53252 (NFC).

Update description for real.

Forgot to specify --verbatim, sorry for the noise!

This revision was landed with ongoing or failed builds.Apr 26 2022, 2:24 PM
This revision was automatically updated to reflect the committed changes.