Skip to content

Commit 2dcb3b9

Browse files
[mlir][ArmSME] Remove func patterns from vector lowering (#121640)
Remove `func.call` and `func.return` patterns from `populateArmSVELegalizeForLLVMExportPatterns`. This function is called from `ConvertVectorToLLVMPass::runOnOperation`. That pass should lower only `vector` dialect ops, not `func` dialect ops. These patterns also seem to be unnecessary, as no test cases are failing without them. Also note that there is no `func.func` pattern, so any application of the above-mentioned patterns produces invalid IR.
1 parent 486f83f commit 2dcb3b9

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@
2020
using namespace mlir;
2121
using namespace mlir::arm_sve;
2222

23-
template <typename OpTy>
24-
class ForwardOperands : public OpConversionPattern<OpTy> {
25-
using OpConversionPattern<OpTy>::OpConversionPattern;
26-
27-
LogicalResult
28-
matchAndRewrite(OpTy op, typename OpTy::Adaptor adaptor,
29-
ConversionPatternRewriter &rewriter) const final {
30-
if (adaptor.getOperands().getTypes() == op->getOperands().getTypes())
31-
return rewriter.notifyMatchFailure(op, "operand types already match");
32-
33-
rewriter.modifyOpInPlace(op,
34-
[&]() { op->setOperands(adaptor.getOperands()); });
35-
return success();
36-
}
37-
};
38-
3923
using SdotOpLowering = OneToOneConvertToLLVMPattern<SdotOp, SdotIntrOp>;
4024
using SmmlaOpLowering = OneToOneConvertToLLVMPattern<SmmlaOp, SmmlaIntrOp>;
4125
using UdotOpLowering = OneToOneConvertToLLVMPattern<UdotOp, UdotIntrOp>;
@@ -204,10 +188,6 @@ void mlir::populateArmSVELegalizeForLLVMExportPatterns(
204188
// Populate conversion patterns
205189

206190
// clang-format off
207-
patterns.add<ForwardOperands<func::CallOp>,
208-
ForwardOperands<func::CallIndirectOp>,
209-
ForwardOperands<func::ReturnOp>>(converter,
210-
&converter.getContext());
211191
patterns.add<SdotOpLowering,
212192
SmmlaOpLowering,
213193
UdotOpLowering,

0 commit comments

Comments
 (0)