[PATCH] D36432: [IPSCCP] Add function specialization ability
Matthew Simpson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 11 12:46:32 PDT 2017
mssimpso added a comment.
Thanks very much for the feedback. I have some replies to your comments below (abridged, so it's easier to read in Phab.), but I thought I would first summarize things so far. It sounds like your main points are that (1) the cost model for function specialization is difficult to get right in practice, and that (2) our current IPSCCP infrastructure could be improved to do better than pass-through for arguments and returns. I agree with both of these points. So do we think we should iterate on this patch and add function specialization to our current infrastructure?
In https://reviews.llvm.org/D36432#837245, @dberlin wrote:
> Almost right. Our modeling should be more precise than *most* jump functions. But not all, i believe. I think what we are doing is equivalent to passthrough in reality . Essentially, we have extended the constant prop lattice, for call functions, to to do passthrough of arguments and whatever their value is, and not just constants.
Ah, that's right, we're doing the same thing as pass-through. We would probably need to significantly rework our analysis to do anything better (for ranges, etc.).
> Note: Wegmans SCCP paper covers a variant of IPSCCP.
> They just link all the SSA procedures together, and run IPSCCP on it. What we do should be identical in practice, i believe.
Yes, this is indeed the way we do it now, if I understand correctly.
In https://reviews.llvm.org/D36432#837721, @davide wrote:
> A (somehow) related bug came to my mind https://bugs.llvm.org/show_bug.cgi?id=33253
Interesting. Thanks for the pointer!
> I agree this is a good path forward.
I'm not sure if you're talking about the current patch or IPSCCP improvements in general :)
More information about the llvm-commits