[PATCH] D22295: Introduce GlobalSplit pass.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 16:10:38 PST 2016


eugenis added a comment.

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



================
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>(
----------------
This is N^2.
N is probably very small in practice, but I guess there can be outliers. Consider switching to an NlogN implementation?


================
Comment at: llvm/lib/Transforms/IPO/GlobalSplit.cpp:103
+
+    std::vector<Value *> Ops;
+    Ops.push_back(ConstantInt::get(Int32Ty, 0));
----------------
SmallVector?


https://reviews.llvm.org/D22295





More information about the llvm-commits mailing list