Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,8 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
mlir::TypedAttr getZeroInitAttr(mlir::Type ty) {
if (mlir::isa<cir::IntType>(ty))
return cir::IntAttr::get(ty, 0);
if (auto fltType = mlir::dyn_cast<cir::SingleType>(ty))
return cir::FPAttr::getZero(fltType);
if (auto fltType = mlir::dyn_cast<cir::DoubleType>(ty))
return cir::FPAttr::getZero(fltType);
if (auto fltType = mlir::dyn_cast<cir::FP16Type>(ty))
return cir::FPAttr::getZero(fltType);
if (auto fltType = mlir::dyn_cast<cir::BF16Type>(ty))
return cir::FPAttr::getZero(fltType);
if (cir::isAnyFloatingPointType(ty))
return cir::FPAttr::getZero(ty);
if (auto complexType = mlir::dyn_cast<cir::ComplexType>(ty))
return getZeroAttr(complexType);
if (auto arrTy = mlir::dyn_cast<cir::ArrayType>(ty))
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CIR/Dialect/IR/CIRTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ LongDoubleType::verify(function_ref<InFlightDiagnostic()> emitError,

bool cir::isAnyFloatingPointType(mlir::Type t) {
return isa<cir::SingleType, cir::DoubleType, cir::LongDoubleType,
cir::FP80Type>(t);
cir::FP80Type, cir::BF16Type, cir::FP16Type, cir::FP128Type>(t);
}

bool cir::isScalarType(mlir::Type ty) {
Expand Down
Loading