Revert "[SCEV] Model `ashr exact x, C` as `(abs(x) EXACT/u (1<<C)) * signum(x)`"
authorRoman Lebedev <lebedev.ri@gmail.com>
Sun, 18 Apr 2021 13:20:34 +0000 (16:20 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sun, 18 Apr 2021 13:26:45 +0000 (16:26 +0300)
commitd480f968ad8b56d3ee4a6b6df5532d485b0ad01e
treee17e69614f624f013a9632873809aaec61173f9c
parentd4528cbb0e703ee17ee6fb4abe72b7246ccb38f1
Revert "[SCEV] Model `ashr exact x, C` as `(abs(x) EXACT/u (1<<C)) * signum(x)`"

As being discussed in https://reviews.llvm.org/D100721,
this modelling is lossy, we can't reconstruct `ash`/`ashr exact`
from it, which means that whenever we actually expand the IR,
we've just pessimized the code..

It would be good to model this pattern, after all it comes up every time
you want to compute a distance between two pointers, but not at this cost.

This reverts commit ec54867df5e7f20e12146e628af34f0384308bcb.
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/ashr.ll
llvm/test/Analysis/ScalarEvolution/ptrtoint.ll
llvm/test/Transforms/IndVarSimplify/ashr-expansion.ll