[llvm] [mlir] Poly canonicalization (PR #91410)

Jeremy Kun via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 10:27:15 PDT 2024


================
@@ -183,3 +185,26 @@ LogicalResult INTTOp::verify() {
   auto ring = getOutput().getType().getRing();
   return verifyNTTOp(this->getOperation(), ring, tensorType);
 }
+
+//===----------------------------------------------------------------------===//
+// TableGen'd canonicalization patterns
+//===----------------------------------------------------------------------===//
+
+namespace {
+#include "PolynomialCanonicalization.inc"
+} // namespace
+
+void SubOp::getCanonicalizationPatterns(RewritePatternSet &results,
+                                        MLIRContext *context) {
+  populateWithGenerated(results);
+}
+
+void NTTOp::getCanonicalizationPatterns(RewritePatternSet &results,
+                                        MLIRContext *context) {
+  populateWithGenerated(results);
+}
+
+void INTTOp::getCanonicalizationPatterns(RewritePatternSet &results,
+                                         MLIRContext *context) {
+  populateWithGenerated(results);
+}
----------------
j2kun wrote:

Populated with the specific pattern names in ab63790e45f7bdcd2b2a8b0a4db05bfe39686679

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


More information about the llvm-commits mailing list