@@ -37,13 +37,6 @@ static cl::opt<unsigned> MaxCopiedFromConstantUsers(
37
37
cl::desc(" Maximum users to visit in copy from constant transform" ),
38
38
cl::Hidden);
39
39
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
-
47
40
// / isOnlyCopiedFromConstantMemory - Recursively walk the uses of a (derived)
48
41
// / pointer to an alloca. Ignore any reads of the pointer, return false if we
49
42
// / see any stores or other unknown uses. If we see pointer arithmetic, keep
@@ -1010,14 +1003,6 @@ Instruction *InstCombinerImpl::visitLoadInst(LoadInst &LI) {
1010
1003
if (Instruction *Res = combineLoadToOperationType (*this , LI))
1011
1004
return Res;
1012
1005
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
-
1021
1006
// Replace GEP indices if possible.
1022
1007
if (Instruction *NewGEPI = replaceGEPIdxWithZero (*this , Op, LI))
1023
1008
return replaceOperand (LI, 0 , NewGEPI);
@@ -1358,14 +1343,6 @@ Instruction *InstCombinerImpl::visitStoreInst(StoreInst &SI) {
1358
1343
if (combineStoreToValueType (*this , SI))
1359
1344
return eraseInstFromFunction (SI);
1360
1345
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
-
1369
1346
// Try to canonicalize the stored type.
1370
1347
if (unpackStoreToAggregate (*this , SI))
1371
1348
return eraseInstFromFunction (SI);
0 commit comments