[llvm] [AArch64] Improve operand sinking for mul instructions (PR #116604)

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 07:23:02 PST 2024


================
@@ -5168,26 +5168,41 @@ bool AArch64TTIImpl::isProfitableToSinkOperands(
     return false;
   }
   case Instruction::Mul: {
+    auto ShouldSinkSplatForIndexedVariant = [](Value *V) {
+      auto VT = MVT::getVT(V->getType(), /*HandleUnknown=*/true);
+      return (VT == MVT::v4i16 || VT == MVT::v8i16 || VT == MVT::v2i32 ||
+              VT == MVT::v4i32);
----------------
hazzlim wrote:

Good point - I've refactored it to sink any (non-scalable) vector type with i16 or i32 elements, rather than adding all the possible element counts, because that seemed to make more sense - I'm not sure if there's a reason not to do it this way?

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


More information about the llvm-commits mailing list