Skip to content

Commit 2750a22

Browse files
authored
Passes: Consolidate EnableKnowledgeRetention declarations into a header file (#71695)
1 parent a195d1f commit 2750a22

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "llvm/Analysis/AssumeBundleQueries.h"
2020
#include "llvm/IR/PassManager.h"
21+
#include "llvm/Support/CommandLine.h"
2122

2223
namespace llvm {
2324
class AssumeInst;
@@ -26,6 +27,8 @@ class Instruction;
2627
class AssumptionCache;
2728
class DominatorTree;
2829

30+
extern cl::opt<bool> EnableKnowledgeRetention;
31+
2932
/// Build a call to llvm.assume to preserve informations that can be derived
3033
/// from the given instruction.
3134
/// If no information derived from \p I, this call returns null.

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ PipelineTuningOptions::PipelineTuningOptions() {
302302

303303
namespace llvm {
304304
extern cl::opt<unsigned> MaxDevirtIterations;
305-
extern cl::opt<bool> EnableKnowledgeRetention;
306305
} // namespace llvm
307306

308307
void PassBuilder::invokePeepholeEPCallbacks(FunctionPassManager &FPM,

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ static cl::opt<unsigned> GuardWideningWindow(
8989
cl::desc("How wide an instruction window to bypass looking for "
9090
"another guard"));
9191

92-
namespace llvm {
93-
/// enable preservation of attributes in assume like:
94-
/// call void @llvm.assume(i1 true) [ "nonnull"(i32* %PTR) ]
95-
extern cl::opt<bool> EnableKnowledgeRetention;
96-
} // namespace llvm
97-
9892
/// Return the specified type promoted as it would be to pass though a va_arg
9993
/// area.
10094
static Type *getPromotedType(Type *Ty) {

llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ using namespace llvm;
2222

2323
namespace llvm {
2424
extern cl::opt<bool> ShouldPreserveAllAttributes;
25-
extern cl::opt<bool> EnableKnowledgeRetention;
2625
} // namespace llvm
2726

2827
static void RunTest(

0 commit comments

Comments
 (0)