This patch implements part 2 described in https://reviews.llvm.org/D76911 which handle conditional branch in simplifyTerminatorLeadingToRet
We do not use LazyValueInfo to handle this since it is too heavy here. Instead, when case number of suspend switch instruction is reduced to 1, llvm::ConstantFoldTerminator simplifies it to 'icmp eq' , so we only need handle this.
@lewissbaker, the two patches fix the stack overflow failure.
TestPlan: check-llvm , cppcoro
I don't have an opinion either way, but just for information the clang-tidy pre-merge check thinks you ought to name this variable It with a capital I, that's why it's failing on this revision.