[Mlir-commits] [mlir] [mlir][x86] Support multiple result uses in AMX nanokernel (PR #236811)
Adam Siemieniuk
llvmlistbot at llvm.org
Fri Oct 30 05:56:37 PDT 2026
================
@@ -45,10 +45,13 @@ static bool isZeroVectorConstant(Operation *op) {
}
// Recursively follows single-use values through scf.yield operations
-// and returns the first non-yield user result in the contraction chain.
-static Value contractionUsersAfterYield(Value v) {
- if (v.getNumUses() != 1)
+// and returns the first value that has more than one user, or is not used by a
+// yield operation. Returns nullptr if the chain is ultimately unused.
+static Value contractionResultAfterYield(Value v) {
+ if (v.hasNUses(0))
return nullptr;
+ if (v.hasNUsesOrMore(2))
+ return v;
----------------
adam-smnk wrote:
I found this helper's behavior always a bit confusing.
Why return itself with multiple uses but null without uses? Does it help with current usage?
If you're simply retaining previous behavior that's fine too.
https://github.com/llvm/llvm-project/pull/236811
More information about the Mlir-commits
mailing list