Skip to content

[mlir][arith] Remove func patterns from populateArithWideIntEmulationPatterns #134316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

matthias-springer
Copy link
Member

This function should populate only patterns that are related to wide integer operation emulation.

@matthias-springer matthias-springer requested a review from kuhar April 3, 2025 23:05
@matthias-springer matthias-springer changed the title [mlir][arith] Remove func patterns in populateArithWideIntEmulationPatterns [mlir][arith] Remove func patterns from populateArithWideIntEmulationPatterns Apr 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 3, 2025

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-arith

Author: Matthias Springer (matthias-springer)

Changes

This function should populate only patterns that are related to wide integer operation emulation.


Full diff: https://github.com/llvm/llvm-project/pull/134316.diff

1 Files Affected:

  • (modified) mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp (+6-6)
diff --git a/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp b/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
index 22babe8123617..d5d1559c658ff 100644
--- a/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
@@ -1208,6 +1208,12 @@ struct EmulateWideIntPass final
     RewritePatternSet patterns(ctx);
     arith::populateArithWideIntEmulationPatterns(typeConverter, patterns);
 
+    // Populate `func.*` conversion patterns.
+    populateFunctionOpInterfaceTypeConversionPattern<func::FuncOp>(
+        patterns, typeConverter);
+    populateCallOpTypeConversionPattern(patterns, typeConverter);
+    populateReturnOpTypeConversionPattern(patterns, typeConverter);
+
     if (failed(applyPartialConversion(op, target, std::move(patterns))))
       signalPassFailure();
   }
@@ -1281,12 +1287,6 @@ arith::WideIntEmulationConverter::WideIntEmulationConverter(
 void arith::populateArithWideIntEmulationPatterns(
     const WideIntEmulationConverter &typeConverter,
     RewritePatternSet &patterns) {
-  // Populate `func.*` conversion patterns.
-  populateFunctionOpInterfaceTypeConversionPattern<func::FuncOp>(patterns,
-                                                                 typeConverter);
-  populateCallOpTypeConversionPattern(patterns, typeConverter);
-  populateReturnOpTypeConversionPattern(patterns, typeConverter);
-
   // Populate `arith.*` conversion patterns.
   patterns.add<
       // Misc ops.

Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised we don't have any tests that exercise this.

@matthias-springer matthias-springer merged commit 6966b4f into main Apr 4, 2025
14 checks passed
@matthias-springer matthias-springer deleted the users/matthias-springer/emulate_wide_int branch April 4, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants