Skip to content

Commit 3ea4ccd

Browse files
committed
[mlir] expand the legal floating-point types in the LLVM IR dialect type check
This patch adds a couple missing LLVM IR dialect floating point types to the legality check. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D89350
1 parent d38277d commit 3ea4ccd

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def LLVM_AnyFloat : Type<
8080
CPred<"$_self.isa<::mlir::LLVM::LLVMBFloatType, "
8181
"::mlir::LLVM::LLVMHalfType, "
8282
"::mlir::LLVM::LLVMFloatType, "
83-
"::mlir::LLVM::LLVMDoubleType>()">,
83+
"::mlir::LLVM::LLVMDoubleType, "
84+
"::mlir::LLVM::LLVMFP128Type, "
85+
"::mlir::LLVM::LLVMX86FP80Type>()">,
8486
"floating point LLVM type">;
8587

8688
// Type constraint accepting any LLVM pointer type.

mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class LLVMBFloatType;
4141
class LLVMHalfType;
4242
class LLVMFloatType;
4343
class LLVMDoubleType;
44+
class LLVMFP128Type;
45+
class LLVMX86FP80Type;
4446
class LLVMIntegerType;
4547

4648
//===----------------------------------------------------------------------===//
@@ -89,9 +91,12 @@ class LLVMType : public Type {
8991
bool isHalfTy() { return isa<LLVMHalfType>(); }
9092
bool isFloatTy() { return isa<LLVMFloatType>(); }
9193
bool isDoubleTy() { return isa<LLVMDoubleType>(); }
94+
bool isFP128Ty() { return isa<LLVMFP128Type>(); }
95+
bool isX86_FP80Ty() { return isa<LLVMX86FP80Type>(); }
9296
bool isFloatingPointTy() {
9397
return isa<LLVMHalfType>() || isa<LLVMBFloatType>() ||
94-
isa<LLVMFloatType>() || isa<LLVMDoubleType>();
98+
isa<LLVMFloatType>() || isa<LLVMDoubleType>() ||
99+
isa<LLVMFP128Type>() || isa<LLVMX86FP80Type>();
95100
}
96101

97102
/// Array type utilities.

0 commit comments

Comments
 (0)