[PATCH] D63604: [Attributor] Deduce "nonnull" attribute

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 14:39:47 PDT 2019


uenoku marked an inline comment as done.
uenoku added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:801
+    if (!NonNullCSArgAA || !NonNullCSArgAA->isAssumedNonNull())
+      return false;
+
----------------
jdoerfert wrote:
> We have to make sure we do not get the `AANonNullImpl` for the argument back when none exists for the call site argument. So you have to test that the associated value of `NonNullCSArgAA` is the call site operand, or you check that `NonNullCSArgAA` is not `this`.
> We have to make sure we do not get the AANonNullImpl for the argument back when none exists for the call site argument. So you have to test that the associated value of NonNullCSArgAA is the call site operand, or you check that NonNullCSArgAA is not this.

I could understand the previous implementation didn't work well. But I couldn't understand the latter. I think it is sufficient to query `CS.getArgOperand(ArgNo)` to Attributor, isn't it?



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

https://reviews.llvm.org/D63604





More information about the llvm-commits mailing list