Depends on D29811
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | ||
---|---|---|
404 ↗ | (On Diff #88070) | Document new functions. |
1052 ↗ | (On Diff #88070) | On the export side there were checks on whether TypeID was an MDString, needed here too? |
1057 ↗ | (On Diff #88070) | I forget - is there a constraint that the single implementation function return void and not take any args? |
1059 ↗ | (On Diff #88070) | I assume IsExported should never be true since we invoke this on import? Should that be checked? |
1097 ↗ | (On Diff #88070) | Why can we skip the rest of the function in import mode? E.g. we won't get an optimization remark emitted. Or is the rest of the code only necessary on the export side? Needs a comment at least. |
1162 ↗ | (On Diff #88070) | This guard went away - why? |
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | ||
---|---|---|
1052 ↗ | (On Diff #88070) | No, on the import side all type IDs are MDStrings (ensured by ThinLTOBitcodeWriter). |
1057 ↗ | (On Diff #88070) | The type of the function in the declaration is irrelevant because every call site will cast it to the correct type. Added comment. |
1097 ↗ | (On Diff #88070) | Yes, the rest of the code is only necessary on the export side or during regular LTO (the remarks as well -- the export phase will emit remarks for the whole program). |
1162 ↗ | (On Diff #88070) | It is unnecessary. The map NumUnsafeUsesForTypeTest will be empty if TypeCheckedLoadFunc is null. |
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | ||
---|---|---|
1057 ↗ | (On Diff #88070) | I suppose you could get the correct type then from the IR? Not sure if there is any benefit though... |
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | ||
---|---|---|
1057 ↗ | (On Diff #88070) | Not really. The FunctionType of a declaration is completely unused (or at least it ought to be). There's also not necessarily one "correct" type because there may be multiple call sites and each call site may use a different type for "this". This is one of the reasons why I would like to see FunctionType removed. |