Skip to content

Commit 2b1d72e

Browse files
committed
Add TODOs and update comments
1 parent eac8e32 commit 2b1d72e

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
@@ -2368,7 +2368,7 @@ are listed below.
23682368
when there's a single implementation of the virtual function in the module.
23692369
There could be a single implementation of the virtual function
23702370
either because the function is not overridden in any derived class,
2371-
or because there is a single instantiated object that is using the function.
2371+
or because all objects are instances of the same class/type.
23722372

23732373
Ex of IR before the optimization:
23742374
.. 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
@@ -1666,6 +1666,8 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
16661666
// Add devirtualization pass only when LTO is not enabled, as otherwise
16671667
// the pass is already enabled in the LTO pipeline.
16681668
if (PTO.DevirtualizeSpeculatively && LTOPhase == ThinOrFullLTOPhase::None) {
1669+
// TODO: explore a better pipeline configuration that can improve
1670+
// compilation time overhead.
16691671
MPM.addPass(WholeProgramDevirtPass(
16701672
/*ExportSummary*/ nullptr,
16711673
/*ImportSummary*/ nullptr,

0 commit comments

Comments
 (0)