[IndVars] Widen more comparisons for non-negative induction vars
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 18 Sep 2015 21:21:02 +0000 (21:21 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 18 Sep 2015 21:21:02 +0000 (21:21 +0000)
commit9025a1f8609d0f472e07cc8dfd568921cab347f7
tree38108a0993f28e84edd34aefa4162f416a0e9423
parent204847af9d05e32171f761217145a8517b75ec35
[IndVars] Widen more comparisons for non-negative induction vars

Summary:
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)

Reviewers: atrick, mcrosier, hfinkel

Subscribers: hfinkel, reames, llvm-commits

Differential Revision: http://reviews.llvm.org/D12745

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248045 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp
test/Transforms/IndVarSimplify/widen-loop-comp.ll