OSDN Git Service

Teach IndVarSimplify how to eliminate remainder operators where the
authorDan Gohman <gohman@apple.com>
Tue, 13 Apr 2010 01:46:36 +0000 (01:46 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 13 Apr 2010 01:46:36 +0000 (01:46 +0000)
commita590b79ee227b93c59f60ce1f54cae7a9ebec7c1
treeb8e9077bcb2559facb81be0df532baa82ab134e3
parentafc9a0c6b03d6dd523a8d0dc3e7de4ff723b51f4
Teach IndVarSimplify how to eliminate remainder operators where the
numerator is an induction variable. For example, with code like this:

  for (i=0;i<n;++i)
    x[i%n] = 0;

IndVarSimplify will now recognize that i is always less than n inside
the loop, and eliminate the remainder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101113 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp
test/Transforms/IndVarSimplify/eliminate-rem.ll [new file with mode: 0644]