[SCEV] Use full logic when infering flags on add and gep
authorPhilip Reames <listmail@philipreames.com>
Sun, 3 Oct 2021 22:32:15 +0000 (15:32 -0700)
committerPhilip Reames <listmail@philipreames.com>
Sun, 3 Oct 2021 22:32:15 +0000 (15:32 -0700)
commitd02db32644b7360bcda54cdf739fa42abe450fcd
tree3e559ac56345b734925a5a2ecfa782eb982d319f
parentf39978b84f1d3a1da6c32db48f64c8daae64b3ad
[SCEV] Use full logic when infering flags on add and gep

This is a followon to D109845. With that landed, we will have fixed all known instances of pr51817, and can thus start inferring flags more aggressively with greatly reduced risk of miscompiles. This patch simply applies the same inference logic used in that patch to our other major flag inference path.

We can still do much better here (on both paths), but this is our first step.

Differential Revision: https://reviews.llvm.org/D111003
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_3d.ll
llvm/test/Analysis/Delinearization/multidim_ivs_and_parameteric_offsets_3d.ll
llvm/test/Analysis/LoopCacheAnalysis/PowerPC/stencil.ll
llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll
llvm/test/Analysis/ScalarEvolution/load.ll
llvm/test/Analysis/ScalarEvolution/ptrtoint.ll
polly/test/IstAstInfo/simple-run-time-condition.ll