[SCEV] BuildConstantFromSCEV(): properly handle SCEVZeroExtend from ptr
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 13 Oct 2020 08:45:33 +0000 (11:45 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 13 Oct 2020 08:47:44 +0000 (11:47 +0300)
commit7324616660fc0995fa8c166e3c392361222d5dbc
tree643c4bc3b591124253efc4c010245196cc8aa7d2
parent6c23cbc5603cf0011f8d57b0354954aeca695daf
[SCEV] BuildConstantFromSCEV(): properly handle SCEVZeroExtend from ptr

As being reported in https://reviews.llvm.org/D88806#2326944,
this is pretty much the sibling problem of https://reviews.llvm.org/D88806#2325340,
with root cause being that SCEV now models `ptrtoint` as trunc/zext/self of unknown.

The appropriate (currently crashing) test coverage added.
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/ptrtoint-constantexpr-loop.ll