[llvm] [AArch64] Add a basic i128 mul cost. (PR #203271)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 06:35:50 PDT 2026


================
@@ -4409,6 +4409,15 @@ InstructionCost AArch64TTIImpl::getArithmeticInstrCost(
   case ISD::SUB:
     return LT.first; // Also works for i128
   case ISD::MUL:
+    // i128 multiply is umulh + 2*madd + mul and grows ~n^2.
+    if (Ty->getScalarSizeInBits() > 64) {
----------------
david-arm wrote:

Should this explicitly check for 128-bit types? i256 is also a valid type and we do code generate muls for them: https://godbolt.org/z/jaE4T7eff

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


More information about the llvm-commits mailing list