[PATCH] D49362: [ThinLTO] Compute constant references

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


tejohnson added a comment.

Awesome, thanks! This was future work that we didn't have the bandwidth to address. A few comments/suggestions:

I think it would be cleaner/clearer to encode this info along with the Ref edges. Similar to how there is callee info for each call edge, we should have a ref info that for now can just be this bit.

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. That will avoid the need to do any modification to the optimization passes. On the exporting side, we could do prevent the promotion if we knew that all modules importing a reference also imported the referenced variable definition. It does however look like we should be importing all non-interposable linkage constant variables that are referenced, which should be all we care about for this anyway.

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


https://reviews.llvm.org/D49362





More information about the llvm-commits mailing list