Skip to content

Commit e34d614

Browse files
authored
[Passes] Remove -enable-infer-alignment-pass flag (#111873)
This flag has been on for a while without any complaints.
1 parent f6e93b8 commit e34d614

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ extern cl::opt<std::string> UseCtxProfile;
300300

301301
namespace llvm {
302302
extern cl::opt<bool> EnableMemProfContextDisambiguation;
303-
304-
extern cl::opt<bool> EnableInferAlignmentPass;
305303
} // namespace llvm
306304

307305
PipelineTuningOptions::PipelineTuningOptions() {
@@ -1250,8 +1248,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
12501248
FPM.addPass(LoopVectorizePass(
12511249
LoopVectorizeOptions(!PTO.LoopInterleaving, !PTO.LoopVectorization)));
12521250

1253-
if (EnableInferAlignmentPass)
1254-
FPM.addPass(InferAlignmentPass());
1251+
FPM.addPass(InferAlignmentPass());
12551252
if (IsFullLTO) {
12561253
// The vectorizer may have significantly shortened a loop body; unroll
12571254
// again. Unroll small loops to hide loop backedge latency and saturate any
@@ -1369,8 +1366,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
13691366
FPM.addPass(SROAPass(SROAOptions::PreserveCFG));
13701367
}
13711368

1372-
if (EnableInferAlignmentPass)
1373-
FPM.addPass(InferAlignmentPass());
1369+
FPM.addPass(InferAlignmentPass());
13741370
FPM.addPass(InstCombinePass());
13751371

13761372
// This is needed for two reasons:

llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ static cl::opt<unsigned> MaxCopiedFromConstantUsers(
3737
cl::desc("Maximum users to visit in copy from constant transform"),
3838
cl::Hidden);
3939

40-
namespace llvm {
41-
cl::opt<bool> EnableInferAlignmentPass(
42-
"enable-infer-alignment-pass", cl::init(true), cl::Hidden, cl::ZeroOrMore,
43-
cl::desc("Enable the InferAlignment pass, disabling alignment inference in "
44-
"InstCombine"));
45-
}
46-
4740
/// isOnlyCopiedFromConstantMemory - Recursively walk the uses of a (derived)
4841
/// pointer to an alloca. Ignore any reads of the pointer, return false if we
4942
/// see any stores or other unknown uses. If we see pointer arithmetic, keep
@@ -1010,14 +1003,6 @@ Instruction *InstCombinerImpl::visitLoadInst(LoadInst &LI) {
10101003
if (Instruction *Res = combineLoadToOperationType(*this, LI))
10111004
return Res;
10121005

1013-
if (!EnableInferAlignmentPass) {
1014-
// Attempt to improve the alignment.
1015-
Align KnownAlign = getOrEnforceKnownAlignment(
1016-
Op, DL.getPrefTypeAlign(LI.getType()), DL, &LI, &AC, &DT);
1017-
if (KnownAlign > LI.getAlign())
1018-
LI.setAlignment(KnownAlign);
1019-
}
1020-
10211006
// Replace GEP indices if possible.
10221007
if (Instruction *NewGEPI = replaceGEPIdxWithZero(*this, Op, LI))
10231008
return replaceOperand(LI, 0, NewGEPI);
@@ -1358,14 +1343,6 @@ Instruction *InstCombinerImpl::visitStoreInst(StoreInst &SI) {
13581343
if (combineStoreToValueType(*this, SI))
13591344
return eraseInstFromFunction(SI);
13601345

1361-
if (!EnableInferAlignmentPass) {
1362-
// Attempt to improve the alignment.
1363-
const Align KnownAlign = getOrEnforceKnownAlignment(
1364-
Ptr, DL.getPrefTypeAlign(Val->getType()), DL, &SI, &AC, &DT);
1365-
if (KnownAlign > SI.getAlign())
1366-
SI.setAlignment(KnownAlign);
1367-
}
1368-
13691346
// Try to canonicalize the stored type.
13701347
if (unpackStoreToAggregate(*this, SI))
13711348
return eraseInstFromFunction(SI);

0 commit comments

Comments
 (0)