When bailing out in rewriteLoopExitValues() you could be left with PHI
nodes in the DeadInsts vector. Those would be not handled by the use of
RecursivelyDeleteTriviallyDeadInstructions() in IndVarSimplify. This resulted
in the IndVarSimplify pass returning an incorrect modified status. This was
caught by the expensive check introduced in D86589.
This patches changes IndVarSimplify so that it deletes those PHI nodes,
using RecursivelyDeleteDeadPHINode().
This fixes PR47486.
Do I understand correctly that if RecursivelyDeleteTriviallyDeadInstructions is given a Phi as argument, it doesn't work with it correctly? Maybe we should do this inside of this function? Its name suggests that it should handle any instructions.