Why is the "omp" dialect loaded by default?


I wrote a dialect, along with its compiler. This compiler registers and loads two other dialects: std and llvm, which it uses as lowering targets. But for some reason, when I call context.getLoadedDialects() the omp dialect is listed as well. I guess this is why when linking I need to include libMLIROpenMP…

Is there a way to remove it?


Could please let us know the motivation behind doing this ? why do you want to remove it ?
@kiranchandramohan @mehdi_amini

1 Like

Thanks @dpotop for your question.

I think this happens because the OpenMP dialect is listed as a dependency for the LLVM dialect. There is actually no dependency, it is just that the tool that is used to translate the LLVM dialect is also capable of translating the mix of OpenMP+LLVM dialect. This is currently listed as a FIXME, see link below.

1 Like

@kiranchandramohan Thanks for this explanation.
@SouraVX I’m a scientist, when there’s stuff around in my work and I don’t understand why I tend to wonder why.

We could lift this restriction by fixing the translator to LLVM IR, it is just an implementation quirks right now.

Sent: https://reviews.llvm.org/D88351 to make it not loaded by default. It is still a link dependency to export to LLVM IR though.

1 Like