[SimplifyIndvar] Replace the sdiv used by IV if we can prove both of its operands...
authorHongbin Zheng <etherzhhb@gmail.com>
Thu, 30 Mar 2017 21:56:56 +0000 (21:56 +0000)
committerHongbin Zheng <etherzhhb@gmail.com>
Thu, 30 Mar 2017 21:56:56 +0000 (21:56 +0000)
commitbfd7c38de785fcbd52adf4f93eff8ec346f8b1bc
tree9d0bcf9382c063a942dbc82aa55e4582353cc507
parent623efd8a75fef823c83ce5dc1a5666c9e667793c
[SimplifyIndvar] Replace the sdiv used by IV if we can prove both of its operands are non-negative

Since there is no sdiv in SCEV, an 'udiv' is a better canonical form than an 'sdiv' as the user of induction variable

Differential Revision: https://reviews.llvm.org/D31488

llvm-svn: 299118
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
llvm/test/Transforms/IndVarSimplify/replace-sdiv-by-udiv.ll [new file with mode: 0644]