[Mlir-commits] [mlir] [MLIR][XeGPU][TransformOps] Add get_desc_op (PR #166801)

Adam Siemieniuk llvmlistbot at llvm.org
Mon Nov 10 00:54:23 PST 2025


================
@@ -76,6 +79,47 @@ static DiagnosedSilenceableFailure convertMixedValuesToInt(
   return DiagnosedSilenceableFailure::success();
 }
 
+/// Find producer operation of type T for the given value.
+/// It's assumed that producer ops are chained through their first operand.
+/// Producer chain is traced trough loop block arguments (init values).
+template <typename T>
+static std::optional<T> findProducerOfType(Value val) {
+  Value currentValue = val;
+  if (!currentValue.getDefiningOp()) {
+    // Value may be a block argument initialized outside a loop.
+    if (val.getNumUses() == 0) {
+      LLVM_DEBUG(llvm::dbgs()
----------------
adam-smnk wrote:

I'd suggest using newer debug style:
```
#include "llvm/Support/DebugLog.h"
LDBG() << "msg";
```

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


More information about the Mlir-commits mailing list