[PATCH] D80248: Added pow intrinsic to LLVMIR dialect
George Mitenkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 22 11:15:28 PDT 2020
georgemitenkov updated this revision to Diff 265772.
georgemitenkov added a comment.
Added conversion test for pow LLVM intrinsic
Added missing commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80248/new/
https://reviews.llvm.org/D80248
Files:
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/test/Dialect/LLVMIR/roundtrip.mlir
mlir/test/Target/llvmir-intrinsics.mlir
Index: mlir/test/Target/llvmir-intrinsics.mlir
===================================================================
--- mlir/test/Target/llvmir-intrinsics.mlir
+++ mlir/test/Target/llvmir-intrinsics.mlir
@@ -108,6 +108,15 @@
llvm.return
}
+// CHECK-LABEL: @pow_test
+llvm.func @pow_test(%arg0: !llvm.float, %arg1: !llvm.float, %arg2: !llvm<"<8 x float>">, %arg3: !llvm<"<8 x float>">) {
+ // CHECK: call float @llvm.pow.f32
+ "llvm.intr.pow"(%arg0, %arg1) : (!llvm.float, !llvm.float) -> !llvm.float
+ // CHECK: call <8 x float> @llvm.pow.v8f32
+ "llvm.intr.pow"(%arg2, %arg3) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>">
+ llvm.return
+}
+
// CHECK-LABEL: @vector_reductions
llvm.func @vector_reductions(%arg0: !llvm.float, %arg1: !llvm<"<8 x float>">, %arg2: !llvm<"<8 x i32>">) {
// CHECK: call i32 @llvm.experimental.vector.reduce.add.v8i32
Index: mlir/test/Dialect/LLVMIR/roundtrip.mlir
===================================================================
--- mlir/test/Dialect/LLVMIR/roundtrip.mlir
+++ mlir/test/Dialect/LLVMIR/roundtrip.mlir
@@ -100,6 +100,9 @@
// CHECK: "llvm.intr.sin"(%arg1) : (!llvm.float) -> !llvm.float
%30 = "llvm.intr.sin"(%arg1) : (!llvm.float) -> !llvm.float
+// CHECK: "llvm.intr.pow"(%arg1, %arg1) : (!llvm.float, !llvm.float) -> !llvm.float
+ %31 = "llvm.intr.pow"(%arg1, %arg1) : (!llvm.float, !llvm.float) -> !llvm.float
+
// CHECK: llvm.return
llvm.return
}
Index: mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
===================================================================
--- mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -790,6 +790,7 @@
LLVM_Type:$hint, LLVM_Type:$cache)>;
def LLVM_SinOp : LLVM_UnaryIntrinsicOp<"sin">;
def LLVM_SqrtOp : LLVM_UnaryIntrinsicOp<"sqrt">;
+def LLVM_PowOp : LLVM_BinarySameArgsIntrinsicOp<"pow">;
//
// Vector Reductions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80248.265772.patch
Type: text/x-patch
Size: 1939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200522/01862992/attachment.bin>
More information about the llvm-commits
mailing list