[PATCH] D18634: Don't IPO over functions that can be de-refined

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 10:44:17 PDT 2016


> On Mar 31, 2016, at 10:32 AM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
> 
> 
> 
> Mehdi Amini wrote:
> 
> > If you want this level of abstraction (and it would be a good thing
> > I think), I'm saying you can't achieve this based purely on the
> > linkage type (I hope I'm stating the obvious here, since you wrote
> > that you wanted some function with a linkage type in 2) to be
> > considered as 1) based on an attribute).
> 
> > So we need something higher-level that
> > `predicate(LinkageType)`. Independently of the actual place location.
> 
> I can remove the `static` variants of the predicates, and have them be
> directly on `llvm::Function`, if that's what you're going for.  

I was reluctant about "Function" as a home because I am not sure we don't want to answer the same questions on GlobalVariables in general.
But I can't really find a good example right now and I don't really have time to audit the middle-end to find some inspiration looking at the uses :)


> Right now they'll still be a function of the linkage type, but that would be
> an implementation detail.
> 
> > Maybe we need a new "IPAInfo" kind of class, that would implement a
> > bunch of `predicate(GlobalValue *GV)`?
> 
> A new class for this would be overkill, IMO.

I wrote class, but it could really be a header with free functions declared.

Now if we're sure we will only query these information on a Function, I'd be fine with having members that don't take arguments.

-- 
Mehdi



More information about the llvm-commits mailing list