[PATCH] D98422: [ValueTracking] Handle two PHIs in isKnownNonEqual()

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 25 12:22:26 PDT 2021


jaykang10 added a comment.

In D98422#2650952 <https://reviews.llvm.org/D98422#2650952>, @nikic wrote:

> This looks mostly good. Only remaining issue is that we need to aggressively limit recursion when it comes to phi nodes. What most other ValueTracking code does is to use `MaxAnalysisRecursionDepth - 1` as the depth for recursion over phis, which means that only one more level of recursion is allowed. If that still covers your motivating case, then I'd suggest to follow that pattern. If that doesn't cover your motivating case, then the alternative here would be to only allow full recursion over one pair of phi operands, and only check that the others are trivially non-equal (i.e. distinct ConstantInts). That should definitely cover your case, and would also be in line with existing practice for isKnownNonEqual(). Either way is fine by me.

@nikic Thanks for kind comments. I can see my case is fixed with `MaxAnalysisRecursionDepth - 1`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98422/new/

https://reviews.llvm.org/D98422



More information about the llvm-commits mailing list