[Mlir-commits] [clang] [llvm] [mlir] [Flang][OpenMP] Enable no-loop kernels (PR #155818)
Sergio Afonso
llvmlistbot at llvm.org
Fri Aug 29 08:12:49 PDT 2025
================
@@ -2106,6 +2106,29 @@ Operation *TargetOp::getInnermostCapturedOmpOp() {
});
}
+/// Check if we can promote SPMD kernel to No-Loop kernel
+static bool canPromoteToNoLoop(Operation *capturedOp, TeamsOp teamsOp,
+ WsloopOp *wsLoopOp) {
+ // num_teams clause can break no-loop teams/threads assumption
+ if (teamsOp.getNumTeamsUpper())
+ return false;
+ // reduction kernels are slower in no-loop mode
+ if (teamsOp.getNumReductionVars())
+ return false;
+ if (wsLoopOp->getNumReductionVars())
+ return false;
+ // check if the user allows the promotion of kernels to no-loop mode
----------------
skatrak wrote:
```suggestion
// Check if the user allows the promotion of kernels to no-loop mode.
```
https://github.com/llvm/llvm-project/pull/155818
More information about the Mlir-commits
mailing list