[PATCH] D148123: [AArch64][CostModel] Make sext/zext free if folded into a masked load
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 18 03:32:00 PDT 2023
david-arm added a comment.
In D148123#4277223 <https://reviews.llvm.org/D148123#4277223>, @dmgreen wrote:
> That would make sense for normal loads, but masked loads will not split like that (unless they can extend the mask). https://godbolt.org/z/x9T8vP6Kx. It may be simpler to be more precise about the cost if it returned it directly.
I see what you mean. At the moment we won't lower to two extending loads, although we could do if we thought it help - it would just require a punpklo and punpkhi instead of sunpklo and sunpkhi. However, I think that extends the scope of this patch beyond what was originally intended, which is to only consider extends to legal types. This patch isn't changing the behaviour of BasicTTIImpl::getCastInstrCost - before and after this patch we are splitting the types in exactly the same way. I can have a look at what's required to be more precise, but I think that's going to require adding many entries adding to the existing table to deal with all the possible combinations. I feel that might be better in a separate patch, rather than complicate this one?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148123/new/
https://reviews.llvm.org/D148123
More information about the llvm-commits
mailing list