[PATCH] D49362: [ThinLTO] Compute constant references

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 13:06:33 PDT 2018


tejohnson added a comment.

In https://reviews.llvm.org/D49362#1164028, @evgeny777 wrote:

> > I think it would be cleaner/clearer to encode this info along with the Ref edges
>
> This would be a bit of overhead for global to global refs, wouldn't it? We can't make any assumption about them until we traverse an entire index.


My understanding of your patch is that there would be a 1-1 association between each bit in the RefAccessBits BitVector and ref edges on that same function. I think my suggestion just reorganizes that slightly by moving the bit onto the ref edge. Does that make sense or am I missing something?

> 
> 
>> When importing a variable definition when the ref has this bit set, it can be imported as a local copy, without promoting the name/linkage type
> 
> What if we have non-static variable? We can't make a local copy of it, but opt pass can still handle this case if there are no external references

If it is non-static to start with, but is globally read-only, then it can be imported as a local copy. In order to do something with an opt pass, don't you also need global analysis during the thin link to ensure there are no writes anywhere?

> 
> 
>> Will we miss some cases if the reference is on something like a bitcast that feeds a non-volatile load?
> 
> I'll check




https://reviews.llvm.org/D49362





More information about the llvm-commits mailing list