This is an archive of the discontinued LLVM Phabricator instance.

[SLP][RISCV] Implement unsigned getMinVectorRegisterBitWidth() for RISCV
ClosedPublic

Authored by luke957 on Aug 31 2021, 1:19 AM.

Details

Summary

Implement method unsigned getMinVectorRegisterBitWidth() for RISCV

Diff Detail

Event Timeline

luke957 created this revision.Aug 31 2021, 1:19 AM
luke957 requested review of this revision.Aug 31 2021, 1:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 1:19 AM

Should we implement method unsigned getMinVectorRegisterBitWidth() to avoid potential errors?

Is this function just picking the minimum size of vector SLP will use? Do we want that to follow getRegisterBitWidth() or should it be allowed to be lower?

Tests?

Em, I haven't got a proper test case for this. Without this methed being implemented, the mothed in super class will be called and got a return value of 128.

Is this function just picking the minimum size of vector SLP will use? Do we want that to follow getRegisterBitWidth() or should it be allowed to be lower?

Oh, I get your point. For RVV, we can use a vector registor fractionally, so minimum size of vector could be less than MinVectorRegisterBitWidth. But I'm not sure whether it is appropriate for a methed naming getMinVectorRegisterBitWidth.

craig.topper accepted this revision.Aug 31 2021, 9:40 PM

Tests?

Em, I haven't got a proper test case for this. Without this methed being implemented, the mothed in super class will be called and got a return value of 128.

Is this function just picking the minimum size of vector SLP will use? Do we want that to follow getRegisterBitWidth() or should it be allowed to be lower?

Oh, I get your point. For RVV, we can use a vector registor fractionally, so minimum size of vector could be less than MinVectorRegisterBitWidth. But I'm not sure whether it is appropriate for a methed naming getMinVectorRegisterBitWidth.

There was a vague suggestion about possibly adding a new getMinVectorizationBitWidth mentioned here https://reviews.llvm.org/D103925

Anyway this patch is probably good as a starting point. LGTM

This revision is now accepted and ready to land.Aug 31 2021, 9:40 PM

Tests?

Em, I haven't got a proper test case for this. Without this methed being implemented, the mothed in super class will be called and got a return value of 128.

Is this function just picking the minimum size of vector SLP will use? Do we want that to follow getRegisterBitWidth() or should it be allowed to be lower?

Oh, I get your point. For RVV, we can use a vector registor fractionally, so minimum size of vector could be less than MinVectorRegisterBitWidth. But I'm not sure whether it is appropriate for a methed naming getMinVectorRegisterBitWidth.

There was a vague suggestion about possibly adding a new getMinVectorizationBitWidth mentioned here https://reviews.llvm.org/D103925

Anyway this patch is probably good as a starting point. LGTM

Thanks. I'll look into this patch.