Skip to content

Commit 9a939ef

Browse files
Address a comment.
1 parent 303f43e commit 9a939ef

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,8 @@ void IntegerRangeAnalysis::visitNonControlFlowArguments(
155155
Type boundType, bool getUpper) {
156156
unsigned int width = ConstantIntRanges::getStorageBitwidth(boundType);
157157
if (loopBound.has_value()) {
158-
if (isa<Attribute>(*loopBound)) {
159-
if (auto bound =
160-
dyn_cast_or_null<IntegerAttr>(cast<Attribute>(*loopBound)))
158+
if (auto attr = dyn_cast<Attribute>(*loopBound)) {
159+
if (auto bound = dyn_cast_or_null<IntegerAttr>(attr))
161160
return bound.getValue();
162161
} else if (auto value = llvm::dyn_cast_if_present<Value>(*loopBound)) {
163162
const IntegerValueRangeLattice *lattice =

0 commit comments

Comments
 (0)