================
@@ -260,12 +264,20 @@ std::optional<mlir::DenseElementsAttr>
convertToDenseElementsAttr(
unsigned vectorSize = 1;
for (auto dim : dims)
vectorSize *= dim;
- auto values = llvm::SmallVector<StorageTy, 8>(
- vectorSize, getZeroInitFromType<StorageTy>(elementType));
+ StorageTy zero = getZeroInitFromType<StorageTy>(elementType);
+ if constexpr (std::is_same_v<StorageTy, mlir::APInt>) {
----------------
martin-luecke wrote:
Updated the existing `getZeroInitFromType` specializations to construct zeros
from the lowered element type used by the dense attribute. The integer
specialization now derives the width directly from that type, removing the
pre-existing bool-specific branch. Floating-point zero semantics are unchanged.
https://github.com/llvm/llvm-project/pull/236082
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits