[Mlir-commits] [mlir] [mlir][DFA] Treat gpu.kernel functions as externally callable (PR #181491)
Mehdi Amini
llvmlistbot at llvm.org
Sun Feb 15 07:52:35 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")) {
----------------
joker-eph wrote:
That seems very fishy: these operations should not be "special" in any way and the general rules of visibility should apply.
This can't be the right way to fix the issue here.
Looking at your test, the `gpu.func` has `sym_visibility = "private"` ; which makes it entirely dead here: it's not visible outside the gpu.module and can be just eliminated.
https://github.com/llvm/llvm-project/pull/181491
More information about the Mlir-commits
mailing list