This patch adds a cost model for SK_Broadcast in
AArch64TTIImpl::getShuffleCost with scalable vector.
Without this patch, the scalable vector type relies on BasicTTIImpl cost
implementation and assert.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp | ||
---|---|---|
1210 | I don't see any reason why we need this if here. | |
1263 | We can, but I thought that having one table cost for fixed vector and one for scalable makes the code clear. |
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp | ||
---|---|---|
1257 | I think we also need one for the type MVT::nxv8bf16 here. | |
1257 | nit: Whitespace change | |
llvm/test/Analysis/CostModel/AArch64/sve-shuffle-broadcast.ll | ||
12 | Hi Carol, this is just a suggestion, but a reviewer (David Green) on one of my recent cost model patches suggested that we could do all tests in one function, i.e. define void @broadcast_legal() { and so on. I found it really useful as all the CHECK lines can go in the same function and it reduces the test size. He mentioned that in my patch here - https://reviews.llvm.org/D95039. It means we can reduce the number of functions and number of unnecessary checks for the "ret void" instruction. |
@Thank you all for the suggestion.
I have added the support for MVT::nxv8bf16 and simplify the test.
LGTM with nit addressed!
llvm/test/Analysis/CostModel/AArch64/sve-shuffle-broadcast.ll | ||
---|---|---|
12 | nit: It looks like '%v' isn't used anymore here so can delete? |
Why did you remove this condition?