Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Utils/SCCPSolver.cpp
Show First 20 Lines • Show All 534 Lines • ▼ Show 20 Lines | void SCCPInstVisitor::markArgInFuncSpecialization(Function *F, Argument *A, | ||||
markConstant(A, C); | markConstant(A, C); | ||||
// For the remaining arguments in the new function, copy the lattice state | // For the remaining arguments in the new function, copy the lattice state | ||||
// over from the old function. | // over from the old function. | ||||
for (auto I = F->arg_begin(), J = A->getParent()->arg_begin(), | for (auto I = F->arg_begin(), J = A->getParent()->arg_begin(), | ||||
E = F->arg_end(); | E = F->arg_end(); | ||||
I != E; ++I, ++J) | I != E; ++I, ++J) | ||||
if (J != A && ValueState.count(I)) { | if (J != A && ValueState.count(I)) { | ||||
ValueState[J] = ValueState[I]; | auto &NewValue = ValueState[J]; | ||||
SjoerdMeijer: This is probably non-obvious enough that a little comment would be useful why we are doing this. | |||||
pushToWorkList(ValueState[J], J); | NewValue = ValueState[I]; | ||||
pushToWorkList(NewValue, J); | |||||
} | } | ||||
} | } | ||||
void SCCPInstVisitor::visitInstruction(Instruction &I) { | void SCCPInstVisitor::visitInstruction(Instruction &I) { | ||||
// All the instructions we don't do any special handling for just | // All the instructions we don't do any special handling for just | ||||
// go to overdefined. | // go to overdefined. | ||||
LLVM_DEBUG(dbgs() << "SCCP: Don't know how to handle: " << I << '\n'); | LLVM_DEBUG(dbgs() << "SCCP: Don't know how to handle: " << I << '\n'); | ||||
markOverdefined(&I); | markOverdefined(&I); | ||||
▲ Show 20 Lines • Show All 1,161 Lines • Show Last 20 Lines |
This is probably non-obvious enough that a little comment would be useful why we are doing this.