[Mlir-commits] [mlir] [mlir] add MlirOptMain config callback for context configuration (PR #68228)

Mehdi Amini llvmlistbot at llvm.org
Wed Oct 4 09:48:45 PDT 2023


joker-eph wrote:

> What is the rationale behind this ?

Preserving the abstraction. 
If you don't want the abstraction, don't use it, fork it, build your own, etc. But providing direct access to the context is entirely against the whole design of the "Config" API! 

Originally the API was taking a MLIRContext setup by the user, there wasn't a "config" at all.
Folks were preloading dialects in the MLIRContext, and setting up the context options directly that way. We built abstraction for all the possible ways the context should be setup. This makes the `*-opt` tools not testing what we wanted to: `mlir-opt` is a testing tool with a specific contract, intended to ensure a specific behavior. For example "preloading dialects" is only hiding issues, we made sure that users can't do it because that should never be needed from `opt`!


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


More information about the Mlir-commits mailing list