I found this bug when performing a two-stage build of clang with Function Specialization enabled and tuned aggressively. The crash appears only on release builds. Fixes https://github.com/llvm/llvm-project/issues/55000.
Before accessing the contents of the Argument iterator inside SCCPInstVisitor::markArgInFuncSpecialization, we should be checking that the iterator is valid.