[PATCH] D79455: [mlir][StandardToLLVM] Add support for lowering FPToSIOp to LLVM.
Han-Chung Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 11 01:34:30 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3f07cab3124d: [mlir][StandardToLLVM] Add support for lowering FPToSIOp to LLVM. (authored by hanchung).
Changed prior to commit:
https://reviews.llvm.org/D79455?vs=262259&id=263116#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79455/new/
https://reviews.llvm.org/D79455
Files:
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
Index: mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
===================================================================
--- mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
+++ mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
@@ -618,6 +618,20 @@
return
}
+// Checking conversion of floating point to integer types.
+// CHECK-LABEL: @fptosi
+func @fptosi(%arg0 : f32, %arg1 : f64) {
+// CHECK-NEXT: = llvm.fptosi {{.*}} : !llvm.float to !llvm.i32
+ %0 = fptosi %arg0: f32 to i32
+// CHECK-NEXT: = llvm.fptosi {{.*}} : !llvm.float to !llvm.i64
+ %1 = fptosi %arg0: f32 to i64
+// CHECK-NEXT: = llvm.fptosi {{.*}} : !llvm.double to !llvm.i32
+ %2 = fptosi %arg1: f64 to i32
+// CHECK-NEXT: = llvm.fptosi {{.*}} : !llvm.double to !llvm.i64
+ %3 = fptosi %arg1: f64 to i64
+ return
+}
+
// Checking conversion of integer types to floating point.
// CHECK-LABEL: @fptrunc
func @fptrunc(%arg0 : f32, %arg1 : f64) {
Index: mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
===================================================================
--- mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
+++ mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
@@ -2304,6 +2304,11 @@
using Super::Super;
};
+struct FPToSILowering
+ : public OneToOneConvertToLLVMPattern<FPToSIOp, LLVM::FPToSIOp> {
+ using Super::Super;
+};
+
struct FPTruncLowering
: public OneToOneConvertToLLVMPattern<FPTruncOp, LLVM::FPTruncOp> {
using Super::Super;
@@ -2975,6 +2980,7 @@
Log10OpLowering,
Log2OpLowering,
FPExtLowering,
+ FPToSILowering,
FPTruncLowering,
ImOpLowering,
IndexCastOpLowering,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79455.263116.patch
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200511/8aa56e29/attachment.bin>
More information about the llvm-commits
mailing list