[Mlir-commits] [mlir] [MLGO][EmitC] Scalarize single-element tensor returns (PR #199686)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri May 29 09:15:07 PDT 2026


================

----------------
banach-space wrote:

[nit] Keep the comment for the top loop near the top loop. Move the comment for the bottom loop near the bottom loop. 
```suggestion
  // First collect every direct function in the module and record the subset
  // that is locally eligible. 
  for (func::FuncOp funcOp : module.getOps<func::FuncOp>()) {
    analysis.moduleFunctions.insert(funcOp);
    FailureOr<ScalarizableFunctionInfo> info =
        getScalarizableFunctionInfo(funcOp);
    if (succeeded(info))
      analysis.candidateInfos.try_emplace(funcOp, std::move(*info));
  }

  // The second pass runs the memoized DFS only for
  // candidates to determine the transitive blocked/rewritable state and build
  // the rewrite order.
  for (func::FuncOp funcOp : module.getOps<func::FuncOp>())
    if (analysis.candidateInfos.contains(funcOp))
      (void)computeScalarizationState(funcOp, analysis);
```

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


More information about the Mlir-commits mailing list