diff --git a/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h b/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h index dce7ab3bb5ee7..507087d5575e9 100644 --- a/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h +++ b/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h @@ -87,7 +87,7 @@ class Lattice : public AbstractSparseLattice { using AbstractSparseLattice::AbstractSparseLattice; /// Return the value this lattice is located at. - Value getAnchor() const { return anchor.get(); } + Value getAnchor() const { return cast(anchor); } /// Return the value held by this lattice. This requires that the value is /// initialized. diff --git a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp index 56529acd71bbf..51fa7739e1938 100644 --- a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp +++ b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp @@ -103,9 +103,9 @@ LogicalResult SparseConstantPropagation::visitOperation( lattice->join(ConstantValue(attr, op->getDialect()))); } else { LLVM_DEBUG(llvm::dbgs() - << "Folded to value: " << foldResult.get() << "\n"); + << "Folded to value: " << cast(foldResult) << "\n"); AbstractSparseForwardDataFlowAnalysis::join( - lattice, *getLatticeElement(foldResult.get())); + lattice, *getLatticeElement(cast(foldResult))); } } return success(); diff --git a/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp index a97e43708d9a3..9e9411e5ede12 100644 --- a/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp +++ b/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp @@ -43,7 +43,7 @@ void IntegerValueRangeLattice::onUpdate(DataFlowSolver *solver) const { // If the integer range can be narrowed to a constant, update the constant // value of the SSA value. std::optional constant = getValue().getValue().getConstantValue(); - auto value = anchor.get(); + auto value = cast(anchor); auto *cv = solver->getOrCreateState>(value); if (!constant) return solver->propagateIfChanged( @@ -155,9 +155,8 @@ void IntegerRangeAnalysis::visitNonControlFlowArguments( Type boundType, bool getUpper) { unsigned int width = ConstantIntRanges::getStorageBitwidth(boundType); if (loopBound.has_value()) { - if (loopBound->is()) { - if (auto bound = - dyn_cast_or_null(loopBound->get())) + if (auto attr = dyn_cast(*loopBound)) { + if (auto bound = dyn_cast_or_null(attr)) return bound.getValue(); } else if (auto value = llvm::dyn_cast_if_present(*loopBound)) { const IntegerValueRangeLattice *lattice = diff --git a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp index 67cf8c9c5b81f..0b39d14042493 100644 --- a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp +++ b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp @@ -34,7 +34,7 @@ void AbstractSparseLattice::onUpdate(DataFlowSolver *solver) const { AnalysisState::onUpdate(solver); // Push all users of the value to the queue. - for (Operation *user : anchor.get().getUsers()) + for (Operation *user : cast(anchor).getUsers()) for (DataFlowAnalysis *analysis : useDefSubscribers) solver->enqueue({solver->getProgramPointAfter(user), analysis}); }