After r249211, getSCEV(X) == getSCEV(Y) does not guarantee that X and
Y are related in the dominator tree, even if X is an operand to Y (I've
included a toy example in comments, and a real example as a test case).
This commit changes SimplifyIndVar to require a DominatorTree. I
don't think this is a problem because ScalarEvolution requires it
anyway.
Fixes PR25051.
Depends on D13459.
Not sure if it is related, but about live-out value for loops, if the exit value is the same you could RAUW uses that are outside of the loop. Does it mean that we will pessimize this case? Is it handled somewhere else?