[Mlir-commits] [mlir] [mlir][ArmSME] Verify ops on tile types post LLVM conversion (PR #92076)

Cullen Rhodes llvmlistbot at llvm.org
Wed May 15 05:38:37 PDT 2024


================
@@ -877,6 +878,26 @@ struct ConvertArmSMEToLLVMPass
 
     if (failed(applyPartialConversion(function, target, std::move(patterns))))
       signalPassFailure();
+
+    // Walk the function and fail if there are unexpected operations on SME
+    // tile types after conversion.
+    function->walk([&](Operation *op) {
+      // These ops are legal post conversion, skip these.
+      if (isa<arm_sme::CopyTileOp, arm_sme::GetTileOp, cf::BranchOp>(op) ||
+          !op->isRegistered())
+        return;
+      if (llvm::any_of(op->getResultTypes(),
+                       [](Type type) {
+                         return arm_sme::isValidSMETileVectorType(type);
+                       }) ||
+          llvm::any_of(op->getOperandTypes(), [](Type type) {
+            return arm_sme::isValidSMETileVectorType(type);
+          })) {
----------------
c-rhodes wrote:

I tried this already but it didnt like that neither
> /home/culrho01/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1074:12: error: taking the address of a temporary object of type 'mlir::Type' [-Waddress-of-temporary]
 1074 |     return &*Begin;
      |            ^~~~~~~

wasn't sure how to fix it.

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


More information about the Mlir-commits mailing list