Skip to content

Commit 1810c60

Browse files
committed
comment ComplexType case in getConstantAttr
1 parent bf8fdf1 commit 1810c60

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

enzyme/Enzyme/MLIR/Implementations/CoreDialectsAutoDiffImplementations.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ mlir::TypedAttr mlir::enzyme::getConstantAttr(mlir::Type type,
5050
} else if (auto T = cast<FloatType>(type)) {
5151
APFloat apvalue(T.getFloatSemantics(), value);
5252
return FloatAttr::get(T, apvalue);
53-
} else if (auto T = cast<ComplexType>(type)) {
54-
auto F = cast<FloatType>(T.getElementType());
55-
return mlir::ArrayAttr::get({
56-
FloatAttr::get(F, APFloat(F.getFloatSemantics(), value)),
57-
FloatAttr::get(F, APFloat(F.getFloatSemantics(), "0"));
58-
});
53+
// NOTE `complex::ConstantOp` doesn't accept `TypedAttr`, only `ArrayAttr`
54+
// } else if (auto T = cast<ComplexType>(type)) {
55+
// auto F = cast<FloatType>(T.getElementType());
56+
// return mlir::ArrayAttr::get({
57+
// FloatAttr::get(F, APFloat(F.getFloatSemantics(), value)),
58+
// FloatAttr::get(F, APFloat(F.getFloatSemantics(), "0"));
59+
// });
5960
} else {
6061
llvm::errs() << " unsupported type: " << type << "\n";
6162
}

0 commit comments

Comments
 (0)