[llvm] [AArch64] Add costs of Promoted types for compressstore (PR #220257)
Jack Styles via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 2 00:52:44 PDT 2026
================
@@ -335,21 +335,12 @@ class AArch64TTIImpl final : public BasicTTIImplBase<AArch64TTIImpl> {
bool isElementTypeLegalForCompressStore(Type *Ty) const {
assert(Ty->isIntegerTy() || Ty->isFloatingPointTy());
- // 32-bit and 64-bit element types are legal if we have SVE.
- if (is_contained({32u, 64u}, Ty->getScalarSizeInBits()))
- return true;
-
- // 8-bit and 16-bit types require +sve2p2 or +sme2p2.
- if (is_contained({8u, 16u}, Ty->getScalarSizeInBits()))
- return ST->hasSVE2p2() || ST->hasSME2p2();
-
- return false;
+ return is_contained({8u, 16u, 32u, 64u}, Ty->getScalarSizeInBits());
----------------
Stylie777 wrote:
> If you want to see if the type gets promoted, you should query explicitly what the legal type will be after legalization, and then use that type. But at this point, you don't yet know the VF (the interface only takes a scalar Type*) so you don't know how it will be legalised.
On reflection, I agree and this creates a better solution here, while also not removing the guards here as we still need to guard against promoted i8/i16 types (something like <8 x i8> becoming <16 x i8> would still be illegal without SME2p2/SVE2p2).
https://github.com/llvm/llvm-project/pull/220257
More information about the llvm-commits
mailing list