[Mlir-commits] [mlir] 3ea4ccd - [mlir] expand the legal floating-point types in the LLVM IR dialect type check
Eric Schweitz
llvmlistbot at llvm.org
Wed Oct 14 06:56:43 PDT 2020
Author: Eric Schweitz
Date: 2020-10-14T06:56:26-07:00
New Revision: 3ea4ccd857c3ab83aff9dcceeb82c33681658a32
URL: https://github.com/llvm/llvm-project/commit/3ea4ccd857c3ab83aff9dcceeb82c33681658a32
DIFF: https://github.com/llvm/llvm-project/commit/3ea4ccd857c3ab83aff9dcceeb82c33681658a32.diff
LOG: [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
Added:
Modified:
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
index aa7cd460030d..5530c5dd0f99 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
@@ -80,7 +80,9 @@ def LLVM_AnyFloat : Type<
CPred<"$_self.isa<::mlir::LLVM::LLVMBFloatType, "
"::mlir::LLVM::LLVMHalfType, "
"::mlir::LLVM::LLVMFloatType, "
- "::mlir::LLVM::LLVMDoubleType>()">,
+ "::mlir::LLVM::LLVMDoubleType, "
+ "::mlir::LLVM::LLVMFP128Type, "
+ "::mlir::LLVM::LLVMX86FP80Type>()">,
"floating point LLVM type">;
// Type constraint accepting any LLVM pointer type.
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h b/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
index 811f27935208..f92bdf9e3041 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
@@ -41,6 +41,8 @@ class LLVMBFloatType;
class LLVMHalfType;
class LLVMFloatType;
class LLVMDoubleType;
+class LLVMFP128Type;
+class LLVMX86FP80Type;
class LLVMIntegerType;
//===----------------------------------------------------------------------===//
@@ -89,9 +91,12 @@ class LLVMType : public Type {
bool isHalfTy() { return isa<LLVMHalfType>(); }
bool isFloatTy() { return isa<LLVMFloatType>(); }
bool isDoubleTy() { return isa<LLVMDoubleType>(); }
+ bool isFP128Ty() { return isa<LLVMFP128Type>(); }
+ bool isX86_FP80Ty() { return isa<LLVMX86FP80Type>(); }
bool isFloatingPointTy() {
return isa<LLVMHalfType>() || isa<LLVMBFloatType>() ||
- isa<LLVMFloatType>() || isa<LLVMDoubleType>();
+ isa<LLVMFloatType>() || isa<LLVMDoubleType>() ||
+ isa<LLVMFP128Type>() || isa<LLVMX86FP80Type>();
}
/// Array type utilities.
More information about the Mlir-commits
mailing list