This fixes an overly restrictive assumption that the vector is a FixedVectorType,
in code that tries to calculate the cost of a cast operation when splitting
a too-wide vector. The algorithm works the same for scalable vectors, so this
patch removes the cast<FixedVectorType>.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/Analysis/CostModel/AArch64/cast.ll | ||
---|---|---|
711 | Hi @sdesmalen, given you've added support in the cost function for scalable vectors of the type <vscale x 1 x ElTy> perhaps it's worth adding a test for that too? i.e. %loadnxv1i32 = load <vscale x 1 x i32>, <vscale x 1 x i32>* undef |
llvm/test/Analysis/CostModel/AArch64/cast.ll | ||
---|---|---|
711 | I could, but I'm not sure how helpful that is, because we can't currently vectorize <vscale x 1 x <eltty>>. For this the cost should return Invalid, but it just returns some value now. This is probably something to fix in a follow-up patch at some point. It also wouldn't help test the code-change in this patch. |
LGTM!
llvm/test/Analysis/CostModel/AArch64/cast.ll | ||
---|---|---|
711 | OK that's fine. I think it'd be good to fix getCastInstrCost to deal with the <vscale x 1 x> case properly then at some point, since at the moment it just lets them through. I guess this is a general problem for a lot of our cost model right now. |
Hi @sdesmalen, given you've added support in the cost function for scalable vectors of the type <vscale x 1 x ElTy> perhaps it's worth adding a test for that too? i.e.