The current loop or any of its sub-loops may be infinite. Unless the
function or the loops are marked as mustprogress, this in itself makes
the loop *not* dead.
This patch moves the logic to check whether the current loop is finite
or mustprogress to isLoopDead and also extends it to check the
sub-loops. This should fix PR50511.
Apart from FnMustProgress, aren't these checks redundant with the ones in the worklist loop?