[mlir] Fix bug in ForwardDataFlowAnalysis solver

Explicitly check for uninitialized to prevent crashes in edge cases where the derived analysis creates a lattice element for a value that hasn't been visited yet.
This commit is contained in:
River Riddle 2021-04-27 14:27:08 -07:00
parent cbce28f07e
commit 82bcd98586
1 changed files with 1 additions and 1 deletions

View File

@ -317,7 +317,7 @@ void ForwardDataFlowSolver::visitOperation(Operation *op) {
for (Value operand : op->getOperands()) {
AbstractLatticeElement *operandLattice =
analysis.lookupLatticeElement(operand);
if (!operandLattice)
if (!operandLattice || operandLattice->isUninitialized())
return;
operandLattices.push_back(operandLattice);
}