Hi,
The function getInductionVariable mandates the loop to be in “SimplifyForm”.
Loop::getInductionVariable(ScalarEvolution &SE) {
if (!isLoopSimplifyForm())
return nullptr;
…
…
}
bool Loop::isLoopSimplifyForm() {
return getLoopPreheader() && getLoopLatch() && hasDedicatedExits();
}
/// Return true if no exit block for the loop has a predecessor that is
/// outside the loop.
bool hasDedicatedExits() const;
Is it necessary for the loop to have DedicatedExists to find the induction variable?
Can this condition be relaxed?