Skip to content

Commit a08f2c1

Browse files
committed
Ignore all irrelevant transformations
1 parent f3f5dc9 commit a08f2c1

File tree

1 file changed

+2
-59
lines changed

1 file changed

+2
-59
lines changed

llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp

+2-59
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,8 @@ static Constant *getConstantAt(Value *V, Instruction *At, LazyValueInfo *LVI) {
11031103

11041104
static bool runImpl(Function &F, LazyValueInfo *LVI, DominatorTree *DT,
11051105
const SimplifyQuery &SQ) {
1106+
if (F.getName() != "_RINvMs3_NtNtNtCs8zlSoIwVZ9h_15rustc_mir_build4thir7pattern15deconstruct_patNtB6_16SplitVarLenSlice5splitINtNtNtNtCse4hYLEadXti_4core4iter8adapters3map3MapINtNtB1J_10filter_map9FilterMapIB1F_IB1F_INtNtNtB1N_5slice4iter4IterNtNtB8_10usefulness8PatStackENCNvMs2_B3A_NtB3A_6Matrix5heads0ENvMs7_B6_NtB6_16DeconstructedPat4ctorENCINvMs4_B6_NtB6_11Constructor5splitB2X_Es_0ENCB5c_s0_0EEBc_")
1107+
return false;
11061108
bool FnChanged = false;
11071109
// Visiting in a pre-order depth-first traversal causes us to simplify early
11081110
// blocks before querying later blocks (which require us to analyze early
@@ -1113,71 +1115,12 @@ static bool runImpl(Function &F, LazyValueInfo *LVI, DominatorTree *DT,
11131115
bool BBChanged = false;
11141116
for (Instruction &II : llvm::make_early_inc_range(*BB)) {
11151117
switch (II.getOpcode()) {
1116-
case Instruction::Select:
1117-
BBChanged |= processSelect(cast<SelectInst>(&II), LVI);
1118-
break;
1119-
case Instruction::PHI:
1120-
BBChanged |= processPHI(cast<PHINode>(&II), LVI, DT, SQ);
1121-
break;
1122-
case Instruction::ICmp:
1123-
case Instruction::FCmp:
1124-
BBChanged |= processCmp(cast<CmpInst>(&II), LVI);
1125-
break;
1126-
case Instruction::Load:
1127-
case Instruction::Store:
1128-
BBChanged |= processMemAccess(&II, LVI);
1129-
break;
1130-
case Instruction::Call:
1131-
case Instruction::Invoke:
1132-
BBChanged |= processCallSite(cast<CallBase>(II), LVI);
1133-
break;
1134-
case Instruction::SRem:
1135-
case Instruction::SDiv:
1136-
BBChanged |= processSDivOrSRem(cast<BinaryOperator>(&II), LVI);
1137-
break;
1138-
case Instruction::UDiv:
1139-
case Instruction::URem:
1140-
BBChanged |= processUDivOrURem(cast<BinaryOperator>(&II), LVI);
1141-
break;
1142-
case Instruction::AShr:
1143-
BBChanged |= processAShr(cast<BinaryOperator>(&II), LVI);
1144-
break;
1145-
case Instruction::SExt:
1146-
BBChanged |= processSExt(cast<SExtInst>(&II), LVI);
1147-
break;
1148-
case Instruction::Add:
1149-
case Instruction::Sub:
1150-
case Instruction::Mul:
1151-
case Instruction::Shl:
1152-
BBChanged |= processBinOp(cast<BinaryOperator>(&II), LVI);
1153-
break;
11541118
case Instruction::And:
11551119
BBChanged |= processAnd(cast<BinaryOperator>(&II), LVI);
11561120
break;
11571121
}
11581122
}
11591123

1160-
Instruction *Term = BB->getTerminator();
1161-
switch (Term->getOpcode()) {
1162-
case Instruction::Switch:
1163-
BBChanged |= processSwitch(cast<SwitchInst>(Term), LVI, DT);
1164-
break;
1165-
case Instruction::Ret: {
1166-
auto *RI = cast<ReturnInst>(Term);
1167-
// Try to determine the return value if we can. This is mainly here to
1168-
// simplify the writing of unit tests, but also helps to enable IPO by
1169-
// constant folding the return values of callees.
1170-
auto *RetVal = RI->getReturnValue();
1171-
if (!RetVal) break; // handle "ret void"
1172-
if (isa<Constant>(RetVal)) break; // nothing to do
1173-
if (auto *C = getConstantAt(RetVal, RI, LVI)) {
1174-
++NumReturns;
1175-
RI->replaceUsesOfWith(RetVal, C);
1176-
BBChanged = true;
1177-
}
1178-
}
1179-
}
1180-
11811124
FnChanged |= BBChanged;
11821125
}
11831126

0 commit comments

Comments
 (0)