Skip to content

Commit 2db125f

Browse files
committed
Add TODOs and update comments
1 parent 8a3a669 commit 2db125f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

clang/docs/UsersManual.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,7 @@ are listed below.
23592359
when there's a single implementation of the virtual function in the module.
23602360
There could be a single implementation of the virtual function
23612361
either because the function is not overridden in any derived class,
2362-
or because there is a single instantiated object that is using the function.
2362+
or because all objects are instances of the same class/type.
23632363

23642364
Ex of IR before the optimization:
23652365
.. code-block:: llvm

clang/lib/CodeGen/CGClass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2830,6 +2830,9 @@ void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD,
28302830
// Emit the intrinsics of (type_test and assume) for the features of WPD and
28312831
// speculative devirtualization. For WPD, emit the intrinsics only for the
28322832
// case of non_public LTO visibility.
2833+
// TODO: refactor this condition and similar ones into a function (e.g.,
2834+
// ShouldEmitDevirtualizationMD) to encapsulate the details of the different
2835+
// types of devirtualization.
28332836
else if ((CGM.getCodeGenOpts().WholeProgramVTables &&
28342837
!CGM.AlwaysHasLTOVisibilityPublic(RD)) ||
28352838
CGM.getCodeGenOpts().DevirtualizeSpeculatively) {

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,8 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
16521652
// Add devirtualization pass only when LTO is not enabled, as otherwise
16531653
// the pass is already enabled in the LTO pipeline.
16541654
if (PTO.DevirtualizeSpeculatively && LTOPhase == ThinOrFullLTOPhase::None) {
1655+
// TODO: explore a better pipeline configuration that can improve
1656+
// compilation time overhead.
16551657
MPM.addPass(WholeProgramDevirtPass(
16561658
/*ExportSummary*/ nullptr,
16571659
/*ImportSummary*/ nullptr,

0 commit comments

Comments
 (0)