[PATCH] D85184: [Attributor][WIP] Deduce noundef attribute

Shinji Okumura via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 10:52:33 PDT 2020


okura added a comment.

In D85184#2207205 <https://reviews.llvm.org/D85184#2207205>, @jdoerfert wrote:

> One last question. Shouldn't we use `isGuaranteedNotToBeUndefOrPoison` in the initialization on the associated value?
> Unsure but this example might be impacted:
>
>   void unknown();
>   void bar(int*);
>   void foo() {
>     int x;
>     unknown();
>     bar(&x /* <- should be noundef as far as I can tell */);
>   }

I think we can deduce noundef more strongly by using `isGuaranteedNotToBeUndefOrPoison` in the initialization.
But I'm not sure whether we "should" do or not.

In your example, I understand a pointer of an allocated variable should be noundef, but I don't understand why `unknown` function is needed and important.


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

https://reviews.llvm.org/D85184



More information about the llvm-commits mailing list