[PATCH] D147330: [Matrix] Refine cost estimate for dot-product.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 14 03:02:36 PDT 2023
fhahn marked 2 inline comments as done.
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp:1345
+ // the returned cost is < 0, the argument is cheaper to use in the
+ // dot-product lowering. An invalid cost is return if the operand is not
+ // supported by the lowering code.
----------------
thegameg wrote:
>
I adjusted the code slightly to include an estimate of the cost of embedding the columns into a vector, so we can compute valid costs for all cases. I removed that part.
================
Comment at: llvm/test/Transforms/LowerMatrixIntrinsics/dot-product-int.ll:326
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = mul <8 x i64> [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: [[TMP1:%.*]] = call i64 @llvm.vector.reduce.add.v8i64(<8 x i64> [[TMP0]])
-; CHECK-NEXT: [[TMP2:%.*]] = insertelement <1 x i64> poison, i64 [[TMP1]], i64 0
-; CHECK-NEXT: ret <1 x i64> [[TMP2]]
+; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <8 x i64> [[A:%.*]], <8 x i64> poison, <1 x i32> zeroinitializer
+; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <8 x i64> [[A]], <8 x i64> poison, <1 x i32> <i32 1>
----------------
thegameg wrote:
> Wonder which part made this go back, the cost of the mul maybe?
Yep, I think vector integer multiply doesn't support i64 elements on ARM64.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147330/new/
https://reviews.llvm.org/D147330
More information about the llvm-commits
mailing list