[PATCH] D80651: Harden MLIR detection of misconfiguration when missing dialect registration

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 20:44:13 PDT 2020


mehdi_amini marked 2 inline comments as done.
mehdi_amini added inline comments.


================
Comment at: mlir/include/mlir/IR/OpDefinition.h:1238
       return TypeID::get<ConcreteType>() == abstractOp->typeID;
-    return op->getName().getStringRef() == ConcreteType::getOperationName();
+    llvm_unreachable(("Can't cast to unregistered operation" +
+                      ConcreteType::getOperationName())
----------------
rriddle wrote:
> You will still want to check here. This path is only taken if the operation being casted is unregistered, not `ConcreteType` itself.
Yeah I figured when the test were failing...
So unfortunately this isn't "free" and I had to make it an assertion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80651/new/

https://reviews.llvm.org/D80651





More information about the llvm-commits mailing list