Skip to content

Commit 515a826

Browse files
committed
[NFC][InferAlignment] Swap extern declaration and definition of EnableInferAlignmentPass
This prevents a linker issue when only InstCombine is linked without PassBuilder, like in the case of bugpoint.
1 parent fcde8c8 commit 515a826

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,7 @@ cl::opt<bool> EnableMemProfContextDisambiguation(
275275
"enable-memprof-context-disambiguation", cl::init(false), cl::Hidden,
276276
cl::ZeroOrMore, cl::desc("Enable MemProf context disambiguation"));
277277

278-
cl::opt<bool> EnableInferAlignmentPass(
279-
"enable-infer-alignment-pass", cl::init(true), cl::Hidden, cl::ZeroOrMore,
280-
cl::desc("Enable the InferAlignment pass, disabling alignment inference in "
281-
"InstCombine"));
278+
extern cl::opt<bool> EnableInferAlignmentPass;
282279

283280
PipelineTuningOptions::PipelineTuningOptions() {
284281
LoopInterleaving = true;

llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ static cl::opt<unsigned> MaxCopiedFromConstantUsers(
3636
cl::desc("Maximum users to visit in copy from constant transform"),
3737
cl::Hidden);
3838

39-
extern cl::opt<bool> EnableInferAlignmentPass;
39+
cl::opt<bool> EnableInferAlignmentPass(
40+
"enable-infer-alignment-pass", cl::init(true), cl::Hidden, cl::ZeroOrMore,
41+
cl::desc("Enable the InferAlignment pass, disabling alignment inference in "
42+
"InstCombine"));
4043

4144
/// isOnlyCopiedFromConstantMemory - Recursively walk the uses of a (derived)
4245
/// pointer to an alloca. Ignore any reads of the pointer, return false if we

0 commit comments

Comments
 (0)