summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Dialect/FxpMathOps
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-06-13 17:24:33 -0700
committerMehdi Amini <joker.eph@gmail.com>2019-06-19 23:01:52 -0700
commit6a0555a87545bdd50c783271c08a9e50f871ca8f (patch)
tree47f7564473265437f91f2362cf023cc5060882e4 /mlir/lib/Dialect/FxpMathOps
parent2c9269124a71df8dfb20736694e4a3adca0b0b1e (diff)
downloadbcm5719-llvm-6a0555a87545bdd50c783271c08a9e50f871ca8f.tar.gz
bcm5719-llvm-6a0555a87545bdd50c783271c08a9e50f871ca8f.zip
Refactor SplatElementsAttr to inherit from DenseElementsAttr as opposed to being a separate Attribute type. DenseElementsAttr provides a better internal representation for splat values as well as better API for accessing elements.
PiperOrigin-RevId: 253138287
Diffstat (limited to 'mlir/lib/Dialect/FxpMathOps')
-rw-r--r--mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h b/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h
index 26428cfb409..f0eeba0891a 100644
--- a/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h
+++ b/mlir/lib/Dialect/FxpMathOps/Transforms/UniformKernelUtils.h
@@ -190,7 +190,7 @@ inline Type castElementType(Type t, Type newElementType) {
inline Attribute broadcastScalarConstIntValue(Type t, int64_t value) {
if (auto st = t.dyn_cast<ShapedType>()) {
assert(st.getElementType().isa<IntegerType>());
- return SplatElementsAttr::get(st,
+ return DenseElementsAttr::get(st,
IntegerAttr::get(st.getElementType(), value));
}
@@ -219,7 +219,7 @@ inline Attribute broadcastScalarConstFloatValue(Type t, APFloat value) {
assert(floatElementType &&
"float broadcast element type must be float like");
APFloat apValue = convertFloatToType(floatElementType, value);
- return SplatElementsAttr::get(st,
+ return DenseElementsAttr::get(st,
FloatAttr::get(st.getElementType(), apValue));
} else {
auto floatType = t.dyn_cast<FloatType>();
OpenPOWER on IntegriCloud