[Mlir-commits] [mlir] [mlir] Target Description and Cost Model in MLIR (PR #85141)

Mehdi Amini llvmlistbot at llvm.org
Wed Mar 20 10:44:13 PDT 2024


================
@@ -240,6 +241,9 @@ class MLIRContext {
   /// (attributes, operations, types, etc.).
   llvm::hash_code getRegistryHash();
 
+  /// Get context-specific system description
+  SystemDesc &getSystemDesc();
----------------
joker-eph wrote:

> Most of the above gets clumsy if I have to edit the IR, remove some attributes (and not others), add some attributes (and have merge semantics), etc. And in the end, how many attributes will we have for any small piece of IR for any particular target? If LLVM's TTI is any indication, probably hundreds, per target.

I wouldn't suggest serializing all of TTI as attribute, the attribute is just a "target id" that implement the right interface. It's orthogonal to how the interface is implemented.

> How to use them as cost modelling, how to interpret different target attributes, and what do these things mean. There has to be a piece of infrastructure that handles all of this in MLIR regardless of where it lives or where it comes from. That infrastructure is what this PR is trying to build.

We probably need a better design doc, this PR as it is does not tell enough of the story for me to see where this is going.

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


More information about the Mlir-commits mailing list