Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>(); }
Value getAnchor() const { return cast<Value>(anchor); }

/// Return the value held by this lattice. This requires that the value is
/// initialized.
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ LogicalResult SparseConstantPropagation::visitOperation(
lattice->join(ConstantValue(attr, op->getDialect())));
} else {
LLVM_DEBUG(llvm::dbgs()
<< "Folded to value: " << foldResult.get<Value>() << "\n");
<< "Folded to value: " << cast<Value>(foldResult) << "\n");
AbstractSparseForwardDataFlowAnalysis::join(
lattice, *getLatticeElement(foldResult.get<Value>()));
lattice, *getLatticeElement(cast<Value>(foldResult)));
}
}
return success();
Expand Down
6 changes: 3 additions & 3 deletions mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<APInt> constant = getValue().getValue().getConstantValue();
auto value = anchor.get<Value>();
auto value = cast<Value>(anchor);
auto *cv = solver->getOrCreateState<Lattice<ConstantValue>>(value);
if (!constant)
return solver->propagateIfChanged(
Expand Down Expand Up @@ -155,9 +155,9 @@ void IntegerRangeAnalysis::visitNonControlFlowArguments(
Type boundType, bool getUpper) {
unsigned int width = ConstantIntRanges::getStorageBitwidth(boundType);
if (loopBound.has_value()) {
if (loopBound->is<Attribute>()) {
if (isa<Attribute>(*loopBound)) {
if (auto bound =
dyn_cast_or_null<IntegerAttr>(loopBound->get<Attribute>()))
dyn_cast_or_null<IntegerAttr>(cast<Attribute>(*loopBound)))
return bound.getValue();
} else if (auto value = llvm::dyn_cast_if_present<Value>(*loopBound)) {
const IntegerValueRangeLattice *lattice =
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Value>().getUsers())
for (Operation *user : cast<Value>(anchor).getUsers())
for (DataFlowAnalysis *analysis : useDefSubscribers)
solver->enqueue({solver->getProgramPointAfter(user), analysis});
}
Expand Down
Loading