[Mlir-commits] [mlir] [mlir][DFA] Treat gpu.kernel functions as externally callable (PR #181491)
Ayush Kumar Gaur
llvmlistbot at llvm.org
Sun Feb 15 08:33:13 PST 2026
================
@@ -187,6 +187,16 @@ void DeadCodeAnalysis::initializeSymbolCallables(Operation *top) {
if (!symbol)
continue;
+ // Treat GPU kernels as externally callable entry points.
+ Operation *op = callable.getOperation();
+ if (op->getName().getStringRef() == "gpu.func" &&
+ op->hasAttr("gpu.kernel")) {
----------------
Ayush3941 wrote:
Okay here the deal what I was running into while debugging is that even when the private kernel is considered dead aka -- remove-dead-values erases the producers inside the function some structural ops like sci.if containg gpu.barrier are preserved due to side effects , then dropAllUses() inside RemoveDeadValues.cpp leaves sci.if with an null value that asserts in folding step and crashes
Given you comment I kind of agree with yah my workaround was reinventing gpu kernel logic but I am still confused weather this inconsistency is originated from RDV logic or gpu.barrier where do you think requires adjustment 🤔
https://github.com/llvm/llvm-project/pull/181491
More information about the Mlir-commits
mailing list