File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed
include/mlir/Analysis/DataFlow Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ class Lattice : public AbstractSparseLattice {
87
87
using AbstractSparseLattice::AbstractSparseLattice;
88
88
89
89
// / Return the value this lattice is located at.
90
- Value getAnchor () const { return anchor. get <Value>(); }
90
+ Value getAnchor () const { return cast <Value>(anchor ); }
91
91
92
92
// / Return the value held by this lattice. This requires that the value is
93
93
// / initialized.
Original file line number Diff line number Diff line change @@ -103,9 +103,9 @@ LogicalResult SparseConstantPropagation::visitOperation(
103
103
lattice->join (ConstantValue (attr, op->getDialect ())));
104
104
} else {
105
105
LLVM_DEBUG (llvm::dbgs ()
106
- << " Folded to value: " << foldResult. get <Value>() << " \n " );
106
+ << " Folded to value: " << cast <Value>(foldResult ) << " \n " );
107
107
AbstractSparseForwardDataFlowAnalysis::join (
108
- lattice, *getLatticeElement (foldResult. get <Value>()));
108
+ lattice, *getLatticeElement (cast <Value>(foldResult )));
109
109
}
110
110
}
111
111
return success ();
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ void IntegerValueRangeLattice::onUpdate(DataFlowSolver *solver) const {
43
43
// If the integer range can be narrowed to a constant, update the constant
44
44
// value of the SSA value.
45
45
std::optional<APInt> constant = getValue ().getValue ().getConstantValue ();
46
- auto value = anchor. get <Value>();
46
+ auto value = cast <Value>(anchor );
47
47
auto *cv = solver->getOrCreateState <Lattice<ConstantValue>>(value);
48
48
if (!constant)
49
49
return solver->propagateIfChanged (
@@ -155,9 +155,8 @@ void IntegerRangeAnalysis::visitNonControlFlowArguments(
155
155
Type boundType, bool getUpper) {
156
156
unsigned int width = ConstantIntRanges::getStorageBitwidth (boundType);
157
157
if (loopBound.has_value ()) {
158
- if (loopBound->is <Attribute>()) {
159
- if (auto bound =
160
- dyn_cast_or_null<IntegerAttr>(loopBound->get <Attribute>()))
158
+ if (auto attr = dyn_cast<Attribute>(*loopBound)) {
159
+ if (auto bound = dyn_cast_or_null<IntegerAttr>(attr))
161
160
return bound.getValue ();
162
161
} else if (auto value = llvm::dyn_cast_if_present<Value>(*loopBound)) {
163
162
const IntegerValueRangeLattice *lattice =
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ void AbstractSparseLattice::onUpdate(DataFlowSolver *solver) const {
34
34
AnalysisState::onUpdate (solver);
35
35
36
36
// Push all users of the value to the queue.
37
- for (Operation *user : anchor. get <Value>().getUsers ())
37
+ for (Operation *user : cast <Value>(anchor ).getUsers ())
38
38
for (DataFlowAnalysis *analysis : useDefSubscribers)
39
39
solver->enqueue ({solver->getProgramPointAfter (user), analysis});
40
40
}
You can’t perform that action at this time.
0 commit comments