[llvm] 2750a22 - Passes: Consolidate EnableKnowledgeRetention declarations into a header file (#71695)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 11:03:52 PST 2023


Author: Tom Stellard
Date: 2023-11-13T11:03:49-08:00
New Revision: 2750a2274556e318a4fa9aa0edd4778da4eac7ee

URL: https://github.com/llvm/llvm-project/commit/2750a2274556e318a4fa9aa0edd4778da4eac7ee
DIFF: https://github.com/llvm/llvm-project/commit/2750a2274556e318a4fa9aa0edd4778da4eac7ee.diff

LOG: Passes: Consolidate EnableKnowledgeRetention declarations into a header file (#71695)

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
    llvm/lib/Passes/PassBuilderPipelines.cpp
    llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
index 7c3c8eb8d6a44e9..85c49d39098bc1d 100644
--- a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
+++ b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
@@ -18,6 +18,7 @@
 
 #include "llvm/Analysis/AssumeBundleQueries.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/CommandLine.h"
 
 namespace llvm {
 class AssumeInst;
@@ -26,6 +27,8 @@ class Instruction;
 class AssumptionCache;
 class DominatorTree;
 
+extern cl::opt<bool> EnableKnowledgeRetention;
+
 /// Build a call to llvm.assume to preserve informations that can be derived
 /// from the given instruction.
 /// If no information derived from \p I, this call returns null.

diff  --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index f4a4802bcb649f3..f3d280316e04077 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -302,7 +302,6 @@ PipelineTuningOptions::PipelineTuningOptions() {
 
 namespace llvm {
 extern cl::opt<unsigned> MaxDevirtIterations;
-extern cl::opt<bool> EnableKnowledgeRetention;
 } // namespace llvm
 
 void PassBuilder::invokePeepholeEPCallbacks(FunctionPassManager &FPM,

diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index b0d31a92464e375..64cbfebf0102876 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -89,12 +89,6 @@ static cl::opt<unsigned> GuardWideningWindow(
     cl::desc("How wide an instruction window to bypass looking for "
              "another guard"));
 
-namespace llvm {
-/// enable preservation of attributes in assume like:
-/// call void @llvm.assume(i1 true) [ "nonnull"(i32* %PTR) ]
-extern cl::opt<bool> EnableKnowledgeRetention;
-} // namespace llvm
-
 /// Return the specified type promoted as it would be to pass though a va_arg
 /// area.
 static Type *getPromotedType(Type *Ty) {

diff  --git a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
index a8a05e0caeee5d1..7a86e28ed59e6ad 100644
--- a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
+++ b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
@@ -22,7 +22,6 @@ using namespace llvm;
 
 namespace llvm {
 extern cl::opt<bool> ShouldPreserveAllAttributes;
-extern cl::opt<bool> EnableKnowledgeRetention;
 } // namespace llvm
 
 static void RunTest(


        


More information about the llvm-commits mailing list