[Mlir-commits] [mlir] [mlir][func] Replace `ValueDecomposer` with target materialization (PR #114192)

Markus Böck llvmlistbot at llvm.org
Wed Oct 30 02:11:08 PDT 2024


================
@@ -14,52 +14,46 @@ using namespace mlir;
 using namespace mlir::func;
 
 //===----------------------------------------------------------------------===//
-// ValueDecomposer
+// Helper functions
 //===----------------------------------------------------------------------===//
 
-void ValueDecomposer::decomposeValue(OpBuilder &builder, Location loc,
-                                     Type type, Value value,
-                                     SmallVectorImpl<Value> &results) {
-  for (auto &conversion : decomposeValueConversions)
-    if (conversion(builder, loc, type, value, results))
-      return;
-  results.push_back(value);
+/// If the given value can be decomposed with the type converter, decompose it.
+/// Otherwise, return the given value.
+static SmallVector<Value> decomposeValue(OpBuilder &builder, Location loc,
----------------
zero9178 wrote:

Think it'd be worth adding a TODO here that this function is a workaround for not yet having a 1:N pattern (as you do at callsites). Worst case to avoid someone copying this thinking this is a desireable pattern

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


More information about the Mlir-commits mailing list