This is an archive of the discontinued LLVM Phabricator instance.

[VE][TTI] don't advertise vregs/vops
ClosedPublic

Authored by simoll on Oct 30 2020, 7:54 AM.

Details

Summary

Claim to not have any vector support to dissuade SLP, LV and friends from generating SIMD IR for the VE target.
We will take this back once vector isel is stable.

Diff Detail

Event Timeline

simoll created this revision.Oct 30 2020, 7:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2020, 7:54 AM
simoll requested review of this revision.Oct 30 2020, 7:54 AM
kaz7 added a comment.Oct 30 2020, 8:12 AM

Please add few regression tests for each modification.

llvm/lib/Target/VE/VETargetTransformInfo.h
67

Do we really need this and following functions?

simoll added inline comments.Oct 30 2020, 8:17 AM
llvm/lib/Target/VE/VETargetTransformInfo.h
67

Not yet.
I put them in because they are related to the notion of not advertising vops and we will define them later anyway.

kaz7 added inline comments.Oct 30 2020, 8:34 AM
llvm/lib/Target/VE/VETargetTransformInfo.h
67

If so, can you add them when those are required with some regression tests please?

simoll updated this revision to Diff 301920.Oct 30 2020, 8:51 AM

Removed TTI info for masked loads, reductions

simoll added a comment.Nov 2 2020, 1:35 AM

Does this LGTM to you?

fhahn added a subscriber: fhahn.Nov 2 2020, 4:41 AM

Might be good to have a test for this?

kaz7 accepted this revision.Nov 2 2020, 6:16 AM

Yeah. Some tests make it easy. I'm trying to understand how these modifications work, but it takes hours.

This revision is now accepted and ready to land.Nov 2 2020, 6:16 AM
kaz7 requested changes to this revision.Nov 2 2020, 6:17 AM

Sorry I accidentally accept this one. Please consider to add some tests.

This revision now requires changes to proceed.Nov 2 2020, 6:17 AM
simoll updated this revision to Diff 302575.Nov 3 2020, 7:06 AM

Added test to show how LV and SLP are not vectorizing for VE but for x86.

fhahn added a comment.Nov 3 2020, 11:17 AM

A more direct way to test the costs would be adding a targeted test in llvm/test/Analysis/CostModel/. Does not look like there are any VE tests there yet.

A more direct way to test the costs would be adding a targeted test in llvm/test/Analysis/CostModel/. Does not look like there are any VE tests there yet.

We will need tests there once we implement a cost model. The idea of this patch is to make sure that LLVM does not auto-vectorize and the current tests check directly for that outcome.

kaz7 added a comment.Nov 4 2020, 3:24 AM

@fhahn -san, thank you for letting us know about llvm/test/Analysis/CostModel/. I didn't know those regression tests. We, @simoll and me actually, will add several cost-model tests in near future. However, the purpose of this patch is disabling vector regs advertisement and it is tested well by newly added regression tests, in my opinion. Therefore, I think this is LGTM. Please let us know if you have any suggestions about it. And thank you very much for reviewing this patch!

fhahn accepted this revision.Nov 5 2020, 11:49 AM

@fhahn -san, thank you for letting us know about llvm/test/Analysis/CostModel/. I didn't know those regression tests. We, @simoll and me actually, will add several cost-model tests in near future. However, the purpose of this patch is disabling vector regs advertisement and it is tested well by newly added regression tests, in my opinion. Therefore, I think this is LGTM. Please let us know if you have any suggestions about it. And thank you very much for reviewing this patch!

Sounds good to me with respect to the cost model tests.

LGTM.

llvm/test/Transforms/LoopVectorize/VE/disable_lv.ll
3

a bit unconventional but I guess it should not cause any problems down the road.

kaz7 accepted this revision.Nov 5 2020, 12:59 PM

LGTM. Thanks!

llvm/test/Transforms/LoopVectorize/VE/disable_lv.ll
3

I hope so too. We need to enable vectorize ASAP to remove these tests. :-)

This revision is now accepted and ready to land.Nov 5 2020, 12:59 PM
fhahn added inline comments.Nov 5 2020, 1:00 PM
llvm/test/Transforms/LoopVectorize/VE/disable_lv.ll
3

Just to clarify, I was referring to the fact that we run X86 tests in the VE/ sub-directory.

This revision was landed with ongoing or failed builds.Nov 6 2020, 2:12 AM
This revision was automatically updated to reflect the committed changes.