[mlir] Add value_begin/value_end methods to DenseElementsAttr
Currently DenseElementsAttr only exposes the ability to get the full range of values for a given type T, but there are many situations where we just want the beginning/end iterator. This revision adds proper value_begin/value_end methods for all of the supported T types, and also cleans up a bit of the interface.
Differential Revision: https://reviews.llvm.org/D104173
diff --git a/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp b/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
index c20f4ed..bd1e4ad 100644
--- a/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
+++ b/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
@@ -127,7 +127,7 @@
if ((*localSize.begin()).getSExtValue() != originalInputType.getDimSize(0))
return failure();
- if (llvm::any_of(llvm::drop_begin(localSize.getIntValues(), 1),
+ if (llvm::any_of(llvm::drop_begin(localSize.getValues<APInt>(), 1),
[](const APInt &size) { return !size.isOneValue(); }))
return failure();