[PATCH] D85592: [Attributor] Add flag for undef value to the state of AAPotentialValues

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 9 22:10:07 PDT 2020


jdoerfert added a comment.

In D85592#2205702 <https://reviews.llvm.org/D85592#2205702>, @okura wrote:

> In D85592#2205403 <https://reviews.llvm.org/D85592#2205403>, @jdoerfert wrote:
>
>> We need tests though.
>
> It seems difficult for me to reflect this change in IR of tests because we have not implemented any `updateImpl` of `AAPotentialValues` and have not made any use of it yet.
> Should I add test and land this after implementing them?

I would prefer to land this with a patch. If we need another one first, so be it. However, I think `AACallSiteReturnedFromReturned` and `AAReturnedFromReturnedValues` could save us here.

What happens if you have

  static int foo(int c) {
    int x;
    if (c == -2)
     return -2;
    if (c == 2)
     return 2;
    return x;
  }
  int bar(int c) {
    return foo(c) != 0;
  }

With the patch I'd expect bar to just return 1. Is this the case?


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

https://reviews.llvm.org/D85592



More information about the llvm-commits mailing list