[Mlir-commits] [mlir] [MLIR][Linalg] More Linalg named ops (PR #90236)
Renato Golin
llvmlistbot at llvm.org
Fri Apr 26 15:06:04 PDT 2024
================
@@ -115,12 +115,16 @@ class Builder {
ArrayAttr getArrayAttr(ArrayRef<Attribute> value);
// Returns a 0-valued attribute of the given `type`. This function only
- // supports boolean, integer, and 16-/32-/64-bit float types, and vector or
+ // supports integer, and 16-/32-/64-bit float types, and vector or
// ranked tensor of them. Returns null attribute otherwise.
TypedAttr getZeroAttr(Type type);
// Returns a 1-valued attribute of the given `type`.
// Type constraints are the same as `getZeroAttr`.
TypedAttr getOneAttr(Type type);
+ // Returns a numeric attribute of the given `type`.
+ // Type constraints are the same as `getZeroAttr`.
+ // Non float types are converted before returning the attribute.
+ TypedAttr getNumberAttr(double value, Type type);
----------------
rengolin wrote:
Yes, though I'm not expecting this to be used for very large integers where this would be a problem.
We could try to restrict it to a range for integers and emit some remarks.
https://github.com/llvm/llvm-project/pull/90236
More information about the Mlir-commits
mailing list