@@ -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