OSDN Git Service

[SCEV] Add explicit representations of umin/smin
authorKeno Fischer <keno@alumni.harvard.edu>
Tue, 7 May 2019 15:28:47 +0000 (15:28 +0000)
committerKeno Fischer <keno@alumni.harvard.edu>
Tue, 7 May 2019 15:28:47 +0000 (15:28 +0000)
commit35a5cc8b4979917a7dd051517d31c3f681e82819
treeafa1a2dc3c953c78cbb02630908611f6adaa1633
parent7d5c0c3683b86af401a5e77982e3c62294ea1d72
[SCEV] Add explicit representations of umin/smin

Summary:
Currently we express umin as `~umax(~x, ~y)`. However, this becomes
a problem for operands in non-integral pointer spaces, because `~x`
is not something we can compute for `x` non-integral. However, since
comparisons are generally still allowed, we are actually able to
express `umin(x, y)` directly as long as we don't try to express is
as a umax. Support this by adding an explicit umin/smin representation
to SCEV. We do this by factoring the existing getUMax/getSMax functions
into a new function that does all four. The previous two functions were
largely identical.

Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D50167

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360159 91177308-0d34-0410-b5e6-96231b3b80d8
25 files changed:
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Analysis/ScalarEvolutionExpander.h
include/llvm/Analysis/ScalarEvolutionExpressions.h
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ScalarEvolutionExpander.cpp
test/Analysis/LoopAccessAnalysis/memcheck-ni.ll [new file with mode: 0644]
test/Analysis/LoopAccessAnalysis/reverse-memcheck-bounds.ll
test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll
test/Analysis/ScalarEvolution/max-expr-cache.ll
test/Analysis/ScalarEvolution/min-max-exprs.ll
test/Analysis/ScalarEvolution/predicated-trip-count.ll
test/Analysis/ScalarEvolution/trip-count14.ll
test/Analysis/ScalarEvolution/trip-count3.ll
test/Transforms/IRCE/conjunctive-checks.ll
test/Transforms/IRCE/decrementing-loop.ll
test/Transforms/IRCE/multiple-access-no-preloop.ll
test/Transforms/IRCE/ranges_of_different_types.ll
test/Transforms/IRCE/rc-negative-bound.ll
test/Transforms/IRCE/single-access-no-preloop.ll
test/Transforms/IRCE/single-access-with-preloop.ll
test/Transforms/IRCE/unsigned_comparisons_ugt.ll
test/Transforms/IRCE/unsigned_comparisons_ult.ll
test/Transforms/IndVarSimplify/replace-loop-exit-folds.ll
test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll
test/Transforms/LoopVectorize/X86/pr35432.ll