Skip to content

Commit 6f5eb8b

Browse files
committed
Update comments and implementation.
Signed-off-by: hanhanW <[email protected]>
1 parent c40ab2c commit 6f5eb8b

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

mlir/include/mlir/Dialect/Utils/StaticValueUtils.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424

2525
namespace mlir {
2626

27-
/// Return true if `v` is an IntegerAttr with value `0` of a ConstantIndexOp
28-
/// with attribute with value `0`.
27+
/// Return true if `v` is an IntegerAttr with value `0`.
2928
bool isZeroIndex(OpFoldResult v);
3029

31-
/// Return true if `v` is an IntegerAttr with value `1` of a ConstantIndexOp
32-
/// with attribute with value `1`.
30+
/// Return true if `v` is an IntegerAttr with value `1`.
3331
bool isOneIndex(OpFoldResult v);
3432

3533
/// Represents a range (offset, size, and stride) where each element of the

mlir/lib/Dialect/Utils/StaticValueUtils.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,9 @@
1515

1616
namespace mlir {
1717

18-
bool isZeroIndex(OpFoldResult v) {
19-
if (!v)
20-
return false;
21-
return isConstantIntValue(v, 0);
22-
}
18+
bool isZeroIndex(OpFoldResult v) { return isConstantIntValue(v, 0); }
2319

24-
bool isOneIndex(OpFoldResult v) {
25-
if (!v)
26-
return false;
27-
return isConstantIntValue(v, 1);
28-
}
20+
bool isOneIndex(OpFoldResult v) { return isConstantIntValue(v, 1); }
2921

3022
std::tuple<SmallVector<OpFoldResult>, SmallVector<OpFoldResult>,
3123
SmallVector<OpFoldResult>>

0 commit comments

Comments
 (0)