Index: llvm/lib/Transforms/Scalar/SCCP.cpp =================================================================== --- llvm/lib/Transforms/Scalar/SCCP.cpp +++ llvm/lib/Transforms/Scalar/SCCP.cpp @@ -2052,11 +2052,9 @@ F->removeParamAttr(A.getArgNo(), Attribute::Returned); for (Use &U : F->uses()) { CallBase *CB = dyn_cast(U.getUser()); - if (!CB) - continue; - for (auto &arg : CB->args()) { - CB->removeParamAttr(CB->getArgOperandNo(&arg), Attribute::Returned); - } + assert(CB && "Use of zapped functions should be valid direct calls!"); + for (Use &Arg : CB->args()) + CB->removeParamAttr(CB->getArgOperandNo(&Arg), Attribute::Returned); } } // If we inferred constant or undef values for globals variables, we can