This is an archive of the discontinued LLVM Phabricator instance.

[SLP][NFC] Test for a follow-up fix of the the vector min/max instrinsic cost calculation.
ClosedPublic

Authored by vporpo on Feb 23 2022, 3:24 PM.

Details

Summary

The code in this test should not have been vectorized.
It looks worse than the scalar code.

Diff Detail

Event Timeline

vporpo requested review of this revision.Feb 23 2022, 3:24 PM
vporpo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2022, 3:24 PM
This revision is now accepted and ready to land.Feb 23 2022, 3:26 PM
vporpo updated this revision to Diff 410978.Feb 23 2022, 5:14 PM

Fixed function name in checks.

fhahn added a comment.Feb 24 2022, 2:33 AM

Should this go into one of the existing max tests we already have for X86 (e.g. llvm/test/Transforms/SLPVectorizer/X86/arith-smax.ll). Also, do we need the same case for unsigned?

Good point. I tried adding this function to arith-smax.ll but the issue is that the test maps multiple RUN lines to the same check-prefix and for this particular function that I am adding the output is actually different. I could fix this by adding a few more check-prefixes in arith-small.ll to avoid this conflict. But I think that arith-smax.ll is already quite a large test with four check-prefixes, so we should probably avoid making it even larger? I could rename this test to arith-smax-cost.ll and add the unsigned case? What do you think?

fhahn added a comment.Feb 24 2022, 1:35 PM

t. But I think that arith-smax.ll is already quite a large test with four check-prefixes, so we should probably avoid making it even larger? I could rename this test to arith-smax-cost.ll and add the unsigned case? What do you think?

Yeah sounds not worth extending the existing test if it requires more surgery to the check lines. Renaming the file to be in line with the existing tests should be fine. Maybe arith-max-cost.ll so the unsigned test can also be included?

vporpo updated this revision to Diff 411236.Feb 24 2022, 2:35 PM

Renamed test to arirth-max-cost.ll and included unsigned case.

fhahn accepted this revision.Feb 24 2022, 2:43 PM

Lgtm thanks

This revision was landed with ongoing or failed builds.Feb 24 2022, 6:29 PM
This revision was automatically updated to reflect the committed changes.