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

Mehdi Amini llvmlistbot at llvm.org
Tue Mar 19 17:18:59 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:

Sorry I don't quite follow, so I think I need to ask more questions:

>  This cannot be an attribute to a particular op

Why? What about the top-level module for example? The module could give you the handle to the entire target description (since this is repeating my previous pointer to DLTI and the GPU target ops, it likely means we're talking past each others here).

> Moreover, device transformations may need to know about the host properties to make efficient decisions, so we should have a way to ask about any target from any place in the code that handles IR. The MLIRContext is one of those places, but not the only one. 

I mean sure, but I still don't quite get the limitation of "an attribute on the ModuleOp": an attribute is in the MLIRContext already and you get access to it from the IR.



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


More information about the Mlir-commits mailing list