https://github.com/nikic approved this pull request. This looks like the right approach to me. I'm a bit unsure about the ad-hoc known predicate logic vs using isKnownViaNonRecursiveReasoning. Tentative LGTM. https://github.com/llvm/llvm-project/pull/207729