[PATCH] D21053: IR: New representation for CFI and virtual call optimization pass metadata.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 13 17:00:43 PDT 2016
pcc added inline comments.
================
Comment at: lib/Transforms/IPO/CrossDSOCFI.cpp:52
@@ -51,3 +51,3 @@
- ConstantInt *extractBitSetTypeId(MDNode *MD);
+ ConstantInt *extractBitSetTypeId(GlobalObject &GO, MDNode *MD);
void buildCFICheck();
----------------
eugenis wrote:
> rename to extractTypeMetadataTypeId?
Done (to `extractNumericTypeId`).
================
Comment at: lib/Transforms/IPO/CrossDSOCFI.cpp:98
@@ -103,1 +97,3 @@
+ // but before the jump slots created in LowerTypeTests.
llvm::DenseSet<uint64_t> BitSetIds;
+ SmallVector<MDNode *, 2> Types;
----------------
eugenis wrote:
> There are still some references to "BitSet" in this file. Is it intentional?
> I understand the devirt thing is using BitSet to refer to the bits stored near the virtual table, which is a completely separate concept from the type test metadata.
No. I spotted a few more missed references in LowerTypeTests, also fixed.
Yes, the references in devirt are correct.
================
Comment at: lib/Transforms/IPO/LowerTypeTests.cpp:960
@@ -988,1 +959,3 @@
+ for (GlobalVariable &GV : M->globals())
+ AddGlobalToEqClass(GV);
}
----------------
eugenis wrote:
> Would you like to factor out this code that applies a function to all functions and globals in a module?
I considered it, but I'm not sure whether that or a `Module::global_objects()` range would be better.
http://reviews.llvm.org/D21053
More information about the llvm-commits
mailing list