Revert "Reland "[SCEV] Model ptrtoint(SCEVUnknown) cast not as unknown, but as zext...
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 14 Oct 2020 11:56:58 +0000 (14:56 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 14 Oct 2020 13:09:18 +0000 (16:09 +0300)
commit7ee6c402474a2f5fd21c403e7529f97f6362fdb3
treec8796f00b6994aba87548b2670fb9b19adf223d7
parent2c4226f8ac2c925d7e1d59d1de1660cd1dd63f31
Revert "Reland "[SCEV] Model ptrtoint(SCEVUnknown) cast not as unknown, but as zext/trunc/self of SCEVUnknown"" and it's follow-ups

While we haven't encountered an earth-shattering problem with this yet,
by now it is pretty evident that trying to model the ptr->int cast
implicitly leads to having to update every single place that assumed
no such cast could be needed. That is of course the wrong approach.

Let's back this out, and re-attempt with some another approach,
possibly one originally suggested by Eli Friedman in
https://bugs.llvm.org/show_bug.cgi?id=46786#c20
which should hopefully spare us this pain and more.

This reverts commits 1fb610429308a7c29c5065f5cc35dcc3fd69c8b1,
7324616660fc0995fa8c166e3c392361222d5dbc,
aaafe350bb65dfc24c2cdad4839059ac81899fbe,
e92a8e0c743f83552fac37ecf21e625ba3a4b11e.

I've kept&improved the tests though.
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
llvm/test/Analysis/ScalarEvolution/add-expr-pointer-operand-sorting.ll
llvm/test/Analysis/ScalarEvolution/no-wrap-add-exprs.ll
llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll
llvm/test/Analysis/ScalarEvolution/ptrtoint.ll
llvm/test/CodeGen/ARM/lsr-undef-in-binop.ll
llvm/test/CodeGen/X86/ragreedy-hoist-spill.ll
llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
llvm/unittests/Analysis/IVDescriptorsTest.cpp
polly/test/Isl/CodeGen/scev_looking_through_bitcasts.ll