[Mlir-commits] [mlir] [mlir][affine][gpu] support unroll dynamic value and apply it to gpu.thread_id op (PR #128113)
Uday Bondhugula
llvmlistbot at llvm.org
Sun Feb 23 20:21:55 PST 2025
================
@@ -84,6 +85,67 @@ void mlir::affine::getTripCountMapAndOperands(
tripCountValueMap.getOperands().end());
}
+/// Replace thread_id with its maximum value, if `replaceWithZero` is true,
+/// thread_id will be replaced by its minimum value 0.
+static void replaceGPUOperands(AffineForOp forOp,
+ SmallVectorImpl<Value> &operands,
+ SmallVectorImpl<AffineExpr> &symReplacements,
+ unsigned numDim, bool replaceWithZero = false) {
+ auto launchOp = forOp->getParentOfType<gpu::LaunchOp>();
+ if (!launchOp)
+ return;
----------------
bondhugula wrote:
This is very specific to gpu.launch and shouldn't be living here. In fact, the approach itself isn't general enough, that's necessitating this kind of transformation.
https://github.com/llvm/llvm-project/pull/128113
More information about the Mlir-commits
mailing list