[Mlir-commits] [mlir] [mlir][ArmSME] Remove func patterns from vector lowering (PR #121640)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat Jan 4 03:40:06 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-sve
@llvm/pr-subscribers-mlir
Author: Matthias Springer (matthias-springer)
<details>
<summary>Changes</summary>
Remove `func.call` and `func.return` patterns from `populateArmSVELegalizeForLLVMExportPatterns`. This function is called from `ConvertVectorToLLVMPass::runOnOperation`. That pass should lower `vector` dialect ops, not `func` dialect ops. These patterns also seem to be unnecessary, as no test cases are failing without them.
---
Full diff: https://github.com/llvm/llvm-project/pull/121640.diff
1 Files Affected:
- (modified) mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp (-20)
``````````diff
diff --git a/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp b/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp
index 845a32c4d97b5e..2bdb640699d036 100644
--- a/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp
+++ b/mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp
@@ -20,22 +20,6 @@
using namespace mlir;
using namespace mlir::arm_sve;
-template <typename OpTy>
-class ForwardOperands : public OpConversionPattern<OpTy> {
- using OpConversionPattern<OpTy>::OpConversionPattern;
-
- LogicalResult
- matchAndRewrite(OpTy op, typename OpTy::Adaptor adaptor,
- ConversionPatternRewriter &rewriter) const final {
- if (adaptor.getOperands().getTypes() == op->getOperands().getTypes())
- return rewriter.notifyMatchFailure(op, "operand types already match");
-
- rewriter.modifyOpInPlace(op,
- [&]() { op->setOperands(adaptor.getOperands()); });
- return success();
- }
-};
-
using SdotOpLowering = OneToOneConvertToLLVMPattern<SdotOp, SdotIntrOp>;
using SmmlaOpLowering = OneToOneConvertToLLVMPattern<SmmlaOp, SmmlaIntrOp>;
using UdotOpLowering = OneToOneConvertToLLVMPattern<UdotOp, UdotIntrOp>;
@@ -204,10 +188,6 @@ void mlir::populateArmSVELegalizeForLLVMExportPatterns(
// Populate conversion patterns
// clang-format off
- patterns.add<ForwardOperands<func::CallOp>,
- ForwardOperands<func::CallIndirectOp>,
- ForwardOperands<func::ReturnOp>>(converter,
- &converter.getContext());
patterns.add<SdotOpLowering,
SmmlaOpLowering,
UdotOpLowering,
``````````
</details>
https://github.com/llvm/llvm-project/pull/121640
More information about the Mlir-commits
mailing list