[clang] [llvm] [WPD]: Apply speculative WPD in non-lto mode. (PR #145031)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 21:24:26 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h,c -- clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CGVTables.cpp clang/lib/Driver/ToolChains/Clang.cpp clang/test/CodeGenCXX/type-metadata.cpp clang/test/Driver/whole-program-vtables.c llvm/include/llvm/Passes/PassBuilder.h llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h llvm/lib/Passes/PassBuilderPipelines.cpp llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index a257a8b5b..f47a9826d 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -223,11 +223,10 @@ static cl::opt<WPDCheckMode> DevirtCheckMode(
 
 // This pass runs with/out lto mode and the default is lto.
 // For testing, provide a way to tell that we are running outside lto mode.
-static cl::opt<bool> TestNoLTOMode(
-    "wholeprogramdevirt-nolto", cl::Hidden,
-    cl::desc("Run whole program devirt outside LTO mode."),
-    cl::init(false));
-
+static cl::opt<bool>
+    TestNoLTOMode("wholeprogramdevirt-nolto", cl::Hidden,
+                  cl::desc("Run whole program devirt outside LTO mode."),
+                  cl::init(false));
 
 namespace {
 struct PatternList {
@@ -2502,8 +2501,8 @@ bool DevirtModule::run() {
                  .WPDRes[S.first.ByteOffset];
     if (tryFindVirtualCallTargets(TargetsForSlot, TypeMemberInfos,
                                   S.first.ByteOffset, ExportSummary)) {
-      bool SingleImplDevirt = trySingleImplDevirt(ExportSummary, TargetsForSlot, S.second,
-        Res);
+      bool SingleImplDevirt =
+          trySingleImplDevirt(ExportSummary, TargetsForSlot, S.second, Res);
       // In Speculative devirt mode, we skip virtual constant propagation
       // and branch funneling to minimize the drawback if we got wrong
       // speculation during devirtualization.

``````````

</details>


https://github.com/llvm/llvm-project/pull/145031


More information about the llvm-commits mailing list