[SCEV] Support negative values in signed/unsigned predicate reasoning
authorMax Kazantsev <mkazantsev@azul.com>
Mon, 20 Sep 2021 04:26:33 +0000 (11:26 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Mon, 20 Sep 2021 04:26:33 +0000 (11:26 +0700)
commitdef15c5fb6a117c1b6d8b2835f6760f814410582
treebb92e68ed62814e901d6fbd099e65f61bf82145d
parentcb42bb355061235f1c4190c8a35e59e4cfb15163
[SCEV] Support negative values in signed/unsigned predicate reasoning

There is a piece of logic that uses the fact that signed and unsigned
versions of the same predicate are equivalent when both values are
non-negative. It's also true when both of them are negative.

Differential Revision: https://reviews.llvm.org/D109957
Reviewed By: nikic
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Transforms/IndVarSimplify/negative_ranges.ll