[PATCH] D22295: Introduce GlobalSplit pass.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 14:37:45 PST 2016


pcc added a comment.

In https://reviews.llvm.org/D22295#592417, @eugenis wrote:

> What happens to !dbg metadata when a global is split?


It gets discarded. This isn't important for the vtable use case (vtables don't normally have debug info of their own). I think we may be able to represent this using DW_OP_piece, but that can be done separately.



================
Comment at: llvm/lib/Transforms/IPO/GlobalSplit.cpp:82
+    // Rebuild type metadata, adjusting by the split offset.
+    for (MDNode *Type : Types) {
+      uint64_t ByteOffset = cast<ConstantInt>(
----------------
eugenis wrote:
> This is N^2.
> N is probably very small in practice, but I guess there can be outliers. Consider switching to an NlogN implementation?
On my machine this pass takes 0.4 seconds to run during an LTO link of chrome. So I don't think it's worth making major changes for performance here.


https://reviews.llvm.org/D22295





More information about the llvm-commits mailing list