[Mlir-commits] [mlir] [mlir][tosa] Support more float types in resource transpose folding (PR #213226)
Luke Hutton
llvmlistbot at llvm.org
Fri Jul 31 09:27:22 PDT 2026
================
@@ -231,6 +254,19 @@ DenseElementsAttr transpose(ElementsAttr attr, ShapedType inputType,
if (auto data = tryGetDenseResourceValues<float>(attr);
data && elementTy.isF32())
return transposeType(*data, inputType, outputType, permValues);
+
+ if (auto data = tryGetDenseResourceValues<uint8_t>(attr);
+ data && isa<Float4E2M1FNType, Float8E4M3FNType, Float8E5M2Type,
+ Float8E8M0FNUType>(elementTy))
+ return transposeRawType(*data, inputType, outputType, permValues);
----------------
lhutton1 wrote:
This appears to assume supplied data is unpacked for sub-byte types, I'm not sure if that's always the case for dense resource attrs?
Slightly tangental: perhaps it's safer to go through APFloat, similar to https://github.com/llvm/llvm-project/pull/213226/changes#diff-e3e29fb7d252978e2d0330ba35e34893bce21bf009f4ab1227700152db7f8b88R227?
https://github.com/llvm/llvm-project/pull/213226
More information about the Mlir-commits
mailing list