[ValueTracking] soften assert for invertible recurrence matching
authorSanjay Patel <spatel@rotateright.com>
Mon, 3 May 2021 19:07:10 +0000 (15:07 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 3 May 2021 19:57:40 +0000 (15:57 -0400)
commit15a42339fe5f5daa86651e181df9a4f89d3ededf
tree748a6148fac4f3ef28939e456c46a2b390a67630
parentfd15e2b825f26dd7eac3b4a52aab36c88e52850a
[ValueTracking] soften assert for invertible recurrence matching

There's a TODO comment in the code and discussion in D99912
about generalizing this, but I wasn't sure how to implement that,
so just going with a potential minimal fix to avoid crashing.

The test is a reduction beyond useful code (there's no user of
%user...), but it is based on https://llvm.org/PR50191, so this
is asserting on real code.

Differential Revision: https://reviews.llvm.org/D101772
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstSimplify/icmp.ll