[PATCH] D73470: Fixed invalid LLVM intrinsics in LLVMOPs.td and llvmir-intrinsics.mlir.

Julian Gross via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 06:21:43 PST 2020


dfki-jugr created this revision.
Herald added subscribers: llvm-commits, liufengdb, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: nicolasvasilache.
Herald added a project: LLVM.

The intrinsic operation added multiple type annotations to the llvm intrinsic operations, but only one is needed.
The related tests in llvmir-intrinsics.mlir checked the wrong number and are adjusted as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73470

Files:
  mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
  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
@@ -5,9 +5,9 @@
   %c3 = llvm.mlir.constant(3 : i32) : !llvm.i32
   %c1 = llvm.mlir.constant(1 : i32) : !llvm.i32
   %c0 = llvm.mlir.constant(0 : i32) : !llvm.i32
-  // CHECK: call float @llvm.fmuladd.f32.f32.f32
+  // CHECK: call float @llvm.fmuladd.f32
   "llvm.intr.fmuladd"(%arg0, %arg1, %arg0) : (!llvm.float, !llvm.float, !llvm.float) -> !llvm.float
-  // CHECK: call <8 x float> @llvm.fmuladd.v8f32.v8f32.v8f32
+  // CHECK: call <8 x float> @llvm.fmuladd.v8f32
   "llvm.intr.fmuladd"(%arg2, %arg2, %arg2) : (!llvm<"<8 x float>">, !llvm<"<8 x float>">, !llvm<"<8 x float>">) -> !llvm<"<8 x float>">
   // CHECK: call void @llvm.prefetch.p0i8(i8* %3, i32 0, i32 3, i32 1)
   "llvm.intr.prefetch"(%arg3, %c0, %c3, %c1) : (!llvm<"i8*">, !llvm.i32, !llvm.i32, !llvm.i32) -> ()
@@ -87,8 +87,8 @@
 }
 
 // Check that intrinsics are declared with appropriate types.
-// CHECK: declare float @llvm.fmuladd.f32.f32.f32(float, float, float)
-// CHECK: declare <8 x float> @llvm.fmuladd.v8f32.v8f32.v8f32(<8 x float>, <8 x float>, <8 x float>) #0
+// CHECK: declare float @llvm.fmuladd.f32(float, float, float)
+// CHECK: declare <8 x float> @llvm.fmuladd.v8f32(<8 x float>, <8 x float>, <8 x float>) #0
 // CHECK: declare void @llvm.prefetch.p0i8(i8* nocapture readonly, i32 immarg, i32 immarg, i32)
 // CHECK: declare float @llvm.exp.f32(float)
 // CHECK: declare <8 x float> @llvm.exp.v8f32(<8 x float>) #0
@@ -104,3 +104,4 @@
 // CHECK: declare <8 x float> @llvm.ceil.v8f32(<8 x float>) #0
 // CHECK: declare float @llvm.cos.f32(float)
 // CHECK: declare <8 x float> @llvm.cos.v8f32(<8 x float>) #0
+// CHECK: declare float @llvm.copysign.f32(float, float)
Index: mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
===================================================================
--- mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -660,7 +660,7 @@
     Arguments<(ins LLVM_Type:$a, LLVM_Type:$b)>,
     LLVM_Builder<"$res = builder.CreateCall(llvm::Intrinsic::getDeclaration("
       "builder.GetInsertBlock()->getModule(), llvm::Intrinsic::" # func # ","
-      "{$a->getType(), $b->getType()}), {$a, $b});"> {
+      "{$a->getType()}), {$a, $b});"> {
 }
 
 class LLVM_TernaryIntrinsicOp<string func, list<OpTrait> traits = []> :
@@ -669,7 +669,7 @@
     Arguments<(ins LLVM_Type:$a, LLVM_Type:$b, LLVM_Type:$c)>,
     LLVM_Builder<"$res = builder.CreateCall(llvm::Intrinsic::getDeclaration("
       "builder.GetInsertBlock()->getModule(), llvm::Intrinsic::" # func # ","
-      "{$a->getType(), $b->getType(), $c->getType()}), {$a, $b, $c});"> {
+      "{$a->getType()}), {$a, $b, $c});"> {
 }
 
 def LLVM_ExpOp : LLVM_UnaryIntrinsicOp<"exp">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73470.240552.patch
Type: text/x-patch
Size: 2892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200127/c9fa6ea3/attachment.bin>


More information about the llvm-commits mailing list