[PATCH] D75617: [WPD] Provide a way to prevent function(s) from being devirtualized

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 11:15:39 PST 2020


tejohnson added a comment.

This won't work for the index-only WPD. Probably the best way to cover that case is to use the option in ModuleSummaryAnalysis.cpp to block functions from being added to the VTableFuncs in the summary in findFuncPointers.



================
Comment at: llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll:2
 ; RUN: opt -S -wholeprogramdevirt -whole-program-visibility -pass-remarks=wholeprogramdevirt %s 2>&1 | FileCheck %s
+; Skipping vf0i1 is identical to setting public LTO visibility. We don't devirtualize vf0i1 and all other
+; virtual call targets.
----------------
Why does skipping this one in particular cause both vf0i1 and vf1i1 to be skipped?

Also the comment here says that we won't devirtualize vf0i1 "and all other virtual call targets" except that the checking still looks for devirtualizations of vf*i32.


================
Comment at: llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll:6
+; We have two set of call targets {vf0i1, vf1i1} and {vf1i32, vf2i32, vf3i32, vf4i32}.
+; The command below prevents both of them from devirtualization.
+; RUN: opt -S -wholeprogramdevirt -whole-program-visibility -pass-remarks=wholeprogramdevirt -wholeprogramdevirt-skip=vf0i1,vf1i32 %s 2>&1 | FileCheck %s --check-prefix=SKIP-ALL
----------------
Similar question here about why skipping one blocks the devirt of the others


================
Comment at: llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll:25
 
+; SKIP: remark: <unknown>:0:0: devirtualized vf1i32
+; SKIP: remark: <unknown>:0:0: devirtualized vf2i32
----------------
Should there be a SKIP-NOT: devirtualized above here too to make sure there are no devirt messages before this?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75617/new/

https://reviews.llvm.org/D75617





More information about the llvm-commits mailing list