[llvm] [AArch64] Guard against non-simple types in udiv sve costs. (PR #148580)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 00:45:56 PDT 2025


================
@@ -4126,10 +4126,10 @@ InstructionCost AArch64TTIImpl::getArithmeticInstrCost(
       if (TLI->isOperationLegalOrCustom(ISD, LT.second) && ST->hasSVE()) {
         // SDIV/UDIV operations are lowered using SVE, then we can have less
         // costs.
-        if (isa<FixedVectorType>(Ty) && cast<FixedVectorType>(Ty)
-                                                ->getPrimitiveSizeInBits()
-                                                .getFixedValue() < 128) {
-          EVT VT = TLI->getValueType(DL, Ty);
+        if (VT.isSimple() && isa<FixedVectorType>(Ty) &&
+            cast<FixedVectorType>(Ty)
----------------
davemgreen wrote:

I believe that the entire expression is unnecessary. But we should focus on fixing the bug, not getting side tracked with other issues. :)

https://github.com/llvm/llvm-project/pull/148580


More information about the llvm-commits mailing list