If an induction variable is provably non-negative, its sign extension is
equal to its zero extension. This means narrow uses like
icmp slt iNarrow %indvar, %rhs
can be widened into
icmp slt iWide zext(%indvar), sext(%rhs)
Differential D12745
[IndVars] Widen more comparisons for non-negative induction vars. sanjoy on Sep 9 2015, 6:07 PM. Authored by
Details If an induction variable is provably non-negative, its sign extension is icmp slt iNarrow %indvar, %rhs can be widened into icmp slt iWide zext(%indvar), sext(%rhs)
Diff Detail Event TimelineComment Actions Minor comments. The direction of the change looks right to me. I'm not comfortable giving a LGTM on this given I don't know the area well enough.
Comment Actions replied inline.
Comment Actions My understanding of the CHECK-LABEL directive is that it matches a single unique strings within a file (e.g., function names). I assumed FileCheck would complain if you have multiple CHECK-LABEL directives with the same (i.e., for.cond:) check, but that doesn't appear to be the case here. What have I missed? Comment Actions The docs are pretty clear about CHECK-LABEL's matching unique lines However, FileCheck does not complain either way. |
A brief bit about what we can use this fact for would be good in the comment.