[PATCH] D50754: Implementation of a vtable interleaving algorithm
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 11 13:18:35 PDT 2018
pcc added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/InterleaveVTables.cpp:419
+ // corresponding entry in the interleaved table does.
+#ifdef ENABLE_EXPENSIVE_CHECKS
+ for (const auto &GV : OrderedGlobals) {
----------------
Restore the `#ifdef ENABLE_EXPENSIVE_CHECKS`.
================
Comment at: llvm/lib/Transforms/IPO/InterleaveVTables.cpp:742
+ // We can only interleave vtables when they have been split.
+ // If there are unsplit vtables, we still cannot just bail out because
+ // there may be offset global variables that we need to replace.
----------------
Maybe move this check to `interleaveGlobalVariables` where you access the global variables?
================
Comment at: llvm/lib/Transforms/IPO/InterleaveVTables.cpp:825
+ OGV->replaceAllUsesWith(
+ UndefValue::get(PointerType::get(OffsetGVTy, 0)));
+ OGV->eraseFromParent();
----------------
Instead of using `PointerType::get(OffsetGVTy, 0)` here you can just use `OGV->getType()` and drop the `OffsetGVTy` field.
https://reviews.llvm.org/D50754
More information about the llvm-commits
mailing list