[PATCH] D80651: Harden MLIR detection of misconfiguration when missing dialect registration
Jacques Pienaar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 27 15:50:04 PDT 2020
jpienaar accepted this revision.
jpienaar added a comment.
In D80651#2058607 <https://reviews.llvm.org/D80651#2058607>, @mehdi_amini wrote:
> 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.
I'd prefer if we do keep it light: it would seem that if one is testing this with unit tests/NDEBUG then these would be caught with asserts . So with proper unit tests one should be catching these & should be rare (e.g., how often is a new dialect added to production build?) [which is also why I'm a little bit torn but don't feel strongly against].
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