[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 15:50:01 PDT 2020


mehdi_amini added a comment.

In D80651#2058483 <https://reviews.llvm.org/D80651#2058483>, @rriddle wrote:

> I wonder if we should also add something to Op::classof. i.e. can you cast to FooOp if it isn't registered?


Right now I was trying to add code that runs in release mode, so I tried to hook into code path that are OK to pay the price: type creation is once per type and op creation is expensive enough to take a nullptr check.
Are you proposing to have an extra nullptr check for every cast to an operation? I can also do that.


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