[BasicAA] Add simple depth limit to avoid stack overflow (PR49151)
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 18 Feb 2021 22:13:33 +0000 (23:13 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 19 Feb 2021 10:05:42 +0000 (11:05 +0100)
commit1d9f4903c6151f1b3f90a743eac339dde8ef5d29
tree7b458cbd5ebf8e9acbc9b6be33ee1b91c98c5f0d
parentd12fa33d736d60d419f86b4ec5f3e77e602d4b1e
[BasicAA] Add simple depth limit to avoid stack overflow (PR49151)

This is a simpler variant of D96647. It just adds a straightforward
depth limit with a high cutoff, without introducing complex logic
for BatchAA consistency. It accepts that we may cache a sub-optimal
result if the depth limit is hit.

Eventually this should be more fully addressed by D96647 or similar,
but in the meantime this avoids stack overflows in a cheap way.

Differential Revision: https://reviews.llvm.org/D96996
llvm/lib/Analysis/BasicAliasAnalysis.cpp