[Mlir-commits] [mlir] [mlir][gpu] Fix crash in RemoveDeadValues pass with gpu.launch ops (PR #182711)

Fedor Nikolaev llvmlistbot at llvm.org
Mon Feb 23 00:28:50 PST 2026


================
@@ -237,6 +238,12 @@ RunLivenessAnalysis::RunLivenessAnalysis(Operation *op) {
         for (auto blockArg : llvm::enumerate(block.getArguments())) {
           if (getLiveness(blockArg.value()))
             continue;
+          // Skip block args of ops with regions that are not
+          // RegionBranchOpInterface or FunctionOpInterface
+          // (e.g. gpu.launch) - solver doesn't analyze their regions
+          if (!isa<RegionBranchOpInterface>(op) &&
----------------
felichita wrote:

The solver only understands DataFlow through RegionBranchOpInterface and FunctionOpInterface. For ops like gpu.launch that have regions but don't implement these interfaces, the solver has no info about how values flow into/out of those regions. Analyzing block args in that case would produce incorrect liveness results, so I decided to skip them

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


More information about the Mlir-commits mailing list