[PATCH] D64258: [InferFuncAttributes] extend 'dereferenceable' attribute based on loads

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 09:53:42 PDT 2019


jdoerfert added a comment.

I do not want to block this patch but I still believe that this is the wrong way to go (middle/long term). The fact that we need to put this not in FunctionAttrs.cpp, where the other deductions live, but in InferFunctionAttrs.cpp, where we so far only annotated library functions, should be a first sign. Also, the functionality here is only one way to deduce dereferenceable, arguably, you want all the ways together such that they can benefit from each other.

In D64258#1576166 <https://reviews.llvm.org/D64258#1576166>, @lebedev.ri wrote:

> Passing-by thought:
>  Does `attributor` already being run in the pipeline?
>  Is it in the state where it should be extended instead of adding more backlog for porting into it?


The pass is always "run" in the pipeline but by default the Attributor object will not be created. The cmd line flag `attributor-disable` defaults to true for now.

I think we can reasonably extend it and we are making progress getting rid of the backlog. Multiple deductions got in already and if one doesn't depend on any AbstractAttribute stuck in the pipeline (which you can choose not to in the beginning), one can easily get it in.

---

Going the Attributor route:
I'll upload a prototype of a very generic visitor that can be used to inspect all instructions that "must be executed with" a given one. That functionality is useful on its own and for various attributes so I will first finish the visitor, then we need an interface for AbstractAttributes, and then we can add deductions based on instructions that are executed with.


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

https://reviews.llvm.org/D64258





More information about the llvm-commits mailing list