Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp | ||
---|---|---|
228 | vecotr->vector | |
229 | i64/f64 aren't always legal types either. Need to check ELEN | |
234 | You should probably call getTypeLegalizationCost first. If the type is really wide, we'll emit multiple reduction instructions. It will also esnure VL is a power 2. Otherwise you probably need to use Log2_32_Ceil(VL). | |
250 | vecotr->vector |
The update uses getMaxELENForFixedLengthVectors to check ELEN and replace Log2_32 by Log2_32_Ceil.
I think getTypeLegalizationCost is imprecise for RVV fixed length vector. Take v4i8 as an example, getTypeLegalizationCost thinks v4i8 should split to 4 v1i8 since v4i8 is not legal type. But v4i8 is expanded to extract_subvector of a nxv1i8.
I think that's because you didn't pass -riscv-v-vector-bits-min in the test. Fixed vectors are scalarized without that. That also means the cost model needs to check ST->useRVVForFixedLengthVectors().
The update add getTypeLegalizationCost to support split vector cases. And use getTypeLegalizationCost to make sure the fixed vector type is legal.
vecotr->vector