Before this, LoopReroll would fail an assertion, falsely assuming that
there can only possibly a single loop control only induction variable.
For example:
%a = phi i16 [ %dec2, %for.body ], [ 0, %entry ] %b = phi i16 [ %dec1, %for.body ], [ 0, %entry ] %a.next = add nsw i16 %1, -1 %b.next = add nsw i16 %0, -1 %add = add nsw i16 %a, %b ; ... rerollable code %cmp.not = icmp eq i16 -10, %add br i1 %cmp.not, label %exit, label %loop
Both %a and %b are valid loop control only induction vars
Additionally, some NFC changes to remove unnecessary isa<PHINode> check
Updated complex_reroll checks
to is dropped. Is it intentional?