This fixes bug49888. The root cause for this is that simplifyTerminatorLeadingToRet didn't handle lifetime markers well. Another issue also noted in D116327 is that we deleted some inlined optimization pass in CoroSplit so that simplifyTerminatorLeadingToRet need to remove dead instructions by hand.
This patch fixes bug49888 by skipping lifetime markers and bitcast instruction and removing dead instructions by hand in simplifyTerminatorLeadingToRet.
This depends on https://reviews.llvm.org/D116327
GetFirstValidInstructionInBB seems can be removed. GetFirstValidInstruction(Succ->getFirstNonPHI()) is enough.