[MLIR][DataFlow] Fix two crashes in DeadCodeAnalysis on empty/no-terminator regions (#188548) Two related assertion failures in DeadCodeAnalysis when processing OpenACC operations: 1. visitRegionBranchEdges (issue #187972): When a RegionSuccessor refers to an empty region (no blocks), calling getSuccessor()->front() dereferences a sentinel ilist iterator, crashing with "\!NodePtr->isKnownSentinel()". Fix: skip successors whose region is empty. 2. isRegionOrCallableReturn (issue #188408): When iterating over ops in a nested acc region whose blocks do not have a required terminator, Block::getTerminator() is called without first checking mightHaveTerminator(), triggering "Assertion `mightHaveTerminator()' failed". Fix: guard the getTerminator() call with mightHaveTerminator(). Fixes #187972, #188408 Assisted-by: Claude Code GitOrigin-RevId: 820eaa427a14566856a3d5f8104605a4a352a822
See https://mlir.llvm.org/ for more information.