The test is a crasher reduced from:
https://llvm.org/PR49993
I don't know IndVars / SCEV well enough to say if this fix is sufficient. Also, I didn't see an obvious recursion limit to explain why we need 10 urem instructions to trigger, but removing any of those avoids the bug.