Index: lib/Transforms/Scalar/ADCE.cpp =================================================================== --- lib/Transforms/Scalar/ADCE.cpp +++ lib/Transforms/Scalar/ADCE.cpp @@ -267,9 +267,10 @@ auto *BB = PDTChild->getBlock(); auto &Info = BlockInfo[BB]; // Real function return - if (isa(Info.Terminator)) { - DEBUG(dbgs() << "post-dom root child is a return: " << BB->getName() - << '\n';); + if (isa(Info.Terminator) || + isa(Info.Terminator)) { + DEBUG(dbgs() << "post-dom root child is a return or unreachable: " + << BB->getName() << '\n';); continue; }