OSDN Git Service

[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)
commitdbc8b93e8ae0e41cf126ab070e0bb2dc167a6e1d
tree46d1d83ca3ad5e29b6d5e2925e5e6c96145edd82
parent373055293b04c63fefe690f0c1568c72bc8cbd8c
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299118 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyIndVar.cpp
test/Transforms/IndVarSimplify/replace-sdiv-by-udiv.ll [new file with mode: 0644]