[Mlir-commits] [mlir] 35c9085 - [mlir][llvmir] Support FastmathFlags for LLVM intrinsic operations.
Slava Zakharin
llvmlistbot at llvm.org
Wed Nov 2 12:45:44 PDT 2022
Author: Slava Zakharin
Date: 2022-11-02T12:41:47-07:00
New Revision: 35c9085121816abc2108cb6f1754b39bfdc3085f
URL: https://github.com/llvm/llvm-project/commit/35c9085121816abc2108cb6f1754b39bfdc3085f
DIFF: https://github.com/llvm/llvm-project/commit/35c9085121816abc2108cb6f1754b39bfdc3085f.diff
LOG: [mlir][llvmir] Support FastmathFlags for LLVM intrinsic operations.
This is required for D126305 code to propagate fastmath attributes
for Arith operations that are converted to LLVM IR intrinsics
operations.
LLVM IR intrinsic operations are using custom assembly format now
to avoid printing {fastmathFlags = #llvm.fastmath<none>}, which
is too verbose.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136225
Added:
Modified:
flang/test/Intrinsics/math-codegen.fir
flang/test/Lower/Intrinsics/anint.f90
flang/test/Lower/math-lowering.f90
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
mlir/lib/Dialect/LLVMIR/CMakeLists.txt
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir
mlir/test/Conversion/ComplexToLLVM/convert-to-llvm.mlir
mlir/test/Conversion/ComplexToLLVM/full-conversion.mlir
mlir/test/Conversion/ComplexToStandard/full-conversion.mlir
mlir/test/Conversion/FuncToLLVM/func-to-llvm.mlir
mlir/test/Conversion/MathToLLVM/math-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/gl-ops-to-llvm.mlir
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
mlir/test/Dialect/LLVMIR/optimize-for-nvvm.mlir
mlir/test/Dialect/LLVMIR/roundtrip.mlir
mlir/test/Dialect/OpenMP/ops.mlir
mlir/test/Target/LLVMIR/Import/intrinsic.ll
mlir/test/Target/LLVMIR/llvmir.mlir
Removed:
mlir/lib/Dialect/LLVMIR/IR/LLVMIntrinsicOps.cpp
################################################################################
diff --git a/flang/test/Intrinsics/math-codegen.fir b/flang/test/Intrinsics/math-codegen.fir
index 2c658d4c1b4d6..0af896adf3226 100644
--- a/flang/test/Intrinsics/math-codegen.fir
+++ b/flang/test/Intrinsics/math-codegen.fir
@@ -4,13 +4,13 @@
//--- abs_fast.fir
// RUN: fir-opt %t/abs_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/abs_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.fabs"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.fabs"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f64) -> f64
// CHECK: @_QPtest_real16
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.fabs"({{%[A-Za-z0-9._]+}}) : (f128) -> f128
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f128) -> f128
// CHECK: @_QPtest_complex4
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypotf({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
@@ -76,13 +76,13 @@ func.func private @hypot(f64, f64) -> f64
//--- abs_relaxed.fir
// RUN: fir-opt %t/abs_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/abs_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.fabs"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.fabs"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f64) -> f64
// CHECK: @_QPtest_real16
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.fabs"({{%[A-Za-z0-9._]+}}) : (f128) -> f128
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f128) -> f128
// CHECK: @_QPtest_complex4
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypotf({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
@@ -304,15 +304,15 @@ func.func private @llvm.trunc.f64(f64) -> f64
//--- anint_fast.fir
// RUN: fir-opt %t/anint_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/anint_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
%1 = fir.load %arg0 : !fir.ref<f32>
- %2 = "llvm.intr.round"(%1) : (f32) -> f32
+ %2 = llvm.intr.round(%1) : (f32) -> f32
fir.store %2 to %0 : !fir.ref<f32>
%3 = fir.load %0 : !fir.ref<f32>
return %3 : f32
@@ -320,7 +320,7 @@ func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
%1 = fir.load %arg0 : !fir.ref<f64>
- %2 = "llvm.intr.round"(%1) : (f64) -> f64
+ %2 = llvm.intr.round(%1) : (f64) -> f64
fir.store %2 to %0 : !fir.ref<f64>
%3 = fir.load %0 : !fir.ref<f64>
return %3 : f64
@@ -329,15 +329,15 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- anint_relaxed.fir
// RUN: fir-opt %t/anint_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/anint_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
%1 = fir.load %arg0 : !fir.ref<f32>
- %2 = "llvm.intr.round"(%1) : (f32) -> f32
+ %2 = llvm.intr.round(%1) : (f32) -> f32
fir.store %2 to %0 : !fir.ref<f32>
%3 = fir.load %0 : !fir.ref<f32>
return %3 : f32
@@ -345,7 +345,7 @@ func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
%1 = fir.load %arg0 : !fir.ref<f64>
- %2 = "llvm.intr.round"(%1) : (f64) -> f64
+ %2 = llvm.intr.round(%1) : (f64) -> f64
fir.store %2 to %0 : !fir.ref<f64>
%3 = fir.load %0 : !fir.ref<f64>
return %3 : f64
@@ -541,10 +541,10 @@ func.func private @atan2(f64, f64) -> f64
//--- ceiling_fast.fir
// RUN: fir-opt %t/ceiling_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/ceiling_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.ceil"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.ceil"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -570,10 +570,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- ceiling_relaxed.fir
// RUN: fir-opt %t/ceiling_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/ceiling_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.ceil"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.ceil"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -630,10 +630,10 @@ func.func private @ceil(f64) -> f64
//--- cos_fast.fir
// RUN: fir-opt %t/cos_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cos_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.cos"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.cos"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -655,10 +655,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- cos_relaxed.fir
// RUN: fir-opt %t/cos_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cos_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.cos"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.cos"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -865,10 +865,10 @@ func.func private @erf(f64) -> f64
//--- exp_fast.fir
// RUN: fir-opt %t/exp_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exp_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.exp"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.exp"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -890,10 +890,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- exp_relaxed.fir
// RUN: fir-opt %t/exp_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exp_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.exp"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.exp"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -942,10 +942,10 @@ func.func private @exp(f64) -> f64
//--- floor_fast.fir
// RUN: fir-opt %t/floor_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/floor_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.floor"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.floor"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -971,10 +971,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- floor_relaxed.fir
// RUN: fir-opt %t/floor_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/floor_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.floor"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.floor"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1031,10 +1031,10 @@ func.func private @floor(f64) -> f64
//--- log_fast.fir
// RUN: fir-opt %t/log_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1056,10 +1056,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- log_relaxed.fir
// RUN: fir-opt %t/log_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1108,10 +1108,10 @@ func.func private @log(f64) -> f64
//--- log10_fast.fir
// RUN: fir-opt %t/log10_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log10_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log10"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log10"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1133,10 +1133,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- log10_relaxed.fir
// RUN: fir-opt %t/log10_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log10_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log10"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.log10"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1310,13 +1310,13 @@ func.func private @llvm.lround.i64.f64(f64) -> i64
// CHECK: @_QPtest_real4
// CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f32, i32) -> f32
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.pow"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, i32) -> f32
// CHECK: @_QPtest_real8
// CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f64, i32) -> f64
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.pow"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, i32) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f32 {
@@ -1363,13 +1363,13 @@ func.func private @llvm.powi.f64.i32(f64, i32) -> f64
// CHECK: @_QPtest_real4
// CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f32, i32) -> f32
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.pow"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, i32) -> f32
// CHECK: @_QPtest_real8
// CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f64, i32) -> f64
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.pow"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, i32) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f32 {
@@ -1482,16 +1482,16 @@ func.func @_QPtest_int4(%arg0: !fir.ref<i32> {fir.bindc_name = "x"}, %arg1: !fir
//--- sign_fast.fir
// RUN: fir-opt %t/sign_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sign_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
// CHECK: @_QPtest_real10
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f80, f80) -> f80
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f80, f80) -> f80
// CHECK: @_QPtest_real16
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f128, f128) -> f128
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f128, f128) -> f128
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1533,16 +1533,16 @@ func.func @_QPtest_real16(%arg0: !fir.ref<f128> {fir.bindc_name = "x"}, %arg1: !
//--- sign_relaxed.fir
// RUN: fir-opt %t/sign_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sign_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
// CHECK: @_QPtest_real10
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f80, f80) -> f80
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f80, f80) -> f80
// CHECK: @_QPtest_real16
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.copysign"({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f128, f128) -> f128
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f128, f128) -> f128
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1639,10 +1639,10 @@ func.func private @llvm.copysign.f128(f128, f128) -> f128
//--- sin_fast.fir
// RUN: fir-opt %t/sin_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sin_fast.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.sin"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.sin"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -1664,10 +1664,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
//--- sin_relaxed.fir
// RUN: fir-opt %t/sin_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sin_relaxed.fir
// CHECK: @_QPtest_real4
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.sin"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f32) -> f32
// CHECK: @_QPtest_real8
-// CHECK: {{%[A-Za-z0-9._]+}} = "llvm.intr.sin"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
diff --git a/flang/test/Lower/Intrinsics/anint.f90 b/flang/test/Lower/Intrinsics/anint.f90
index 03b376e2605c7..fe479a07681ee 100644
--- a/flang/test/Lower/Intrinsics/anint.f90
+++ b/flang/test/Lower/Intrinsics/anint.f90
@@ -4,7 +4,7 @@
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f32> {fir.bindc_name = "a"},
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f32> {fir.bindc_name = "b"}) {
! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f32>
-! CHECK: %[[VAL_3:.*]] = "llvm.intr.round"(%[[VAL_2]]) : (f32) -> f32
+! CHECK: %[[VAL_3:.*]] = llvm.intr.round(%[[VAL_2]]) : (f32) -> f32
! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f32>
! CHECK: return
! CHECK: }
@@ -18,7 +18,7 @@ subroutine anint_test(a, b)
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f64> {fir.bindc_name = "a"},
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f64> {fir.bindc_name = "b"}) {
! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f64>
-! CHECK: %[[VAL_3:.*]] = "llvm.intr.round"(%[[VAL_2]]) : (f64) -> f64
+! CHECK: %[[VAL_3:.*]] = llvm.intr.round(%[[VAL_2]]) : (f64) -> f64
! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f64>
! CHECK: return
! CHECK: }
@@ -32,7 +32,7 @@ subroutine anint_test_real8(a, b)
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f80> {fir.bindc_name = "a"},
! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f80> {fir.bindc_name = "b"}) {
! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f80>
-! CHECK: %[[VAL_3:.*]] = "llvm.intr.round"(%[[VAL_2]]) : (f80) -> f80
+! CHECK: %[[VAL_3:.*]] = llvm.intr.round(%[[VAL_2]]) : (f80) -> f80
! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f80>
! CHECK: return
! CHECK: }
diff --git a/flang/test/Lower/math-lowering.f90 b/flang/test/Lower/math-lowering.f90
index 7d9bf7c0c2a86..82dfaf4fc7301 100644
--- a/flang/test/Lower/math-lowering.f90
+++ b/flang/test/Lower/math-lowering.f90
@@ -109,8 +109,8 @@ function test_real4(x)
end function
! ALL-LABEL: @_QPtest_real4
-! FAST: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
-! RELAXED: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+! FAST: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f32
+! RELAXED: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f32
! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @llvm.round.f32({{%[A-Za-z0-9._]+}}) : (f32) -> f32
function test_real8(x)
@@ -119,8 +119,8 @@ function test_real8(x)
end function
! ALL-LABEL: @_QPtest_real8
-! FAST: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
-! RELAXED: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+! FAST: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f64
+! RELAXED: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f64
! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @llvm.round.f64({{%[A-Za-z0-9._]+}}) : (f64) -> f64
function test_real10(x)
@@ -129,8 +129,8 @@ function test_real10(x)
end function
! ALL-LABEL: @_QPtest_real10
-! FAST: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f80) -> f80
-! RELAXED: {{%[A-Za-z0-9._]+}} = "llvm.intr.round"({{%[A-Za-z0-9._]+}}) : (f80) -> f80
+! FAST: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f80) -> f80
+! RELAXED: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f80) -> f80
! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @llvm.round.f80({{%[A-Za-z0-9._]+}}) : (f80) -> f80
! TODO: wait until fp128 is supported well in llvm.round
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
index ca902f9d848cf..b2257a163932c 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
@@ -2,6 +2,7 @@
#define LLVM_INTRINSIC_OPS
include "mlir/IR/OpBase.td"
+include "mlir/Dialect/LLVMIR/LLVMAttrDefs.td"
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
include "mlir/Dialect/LLVMIR/LLVMAttrDefs.td"
include "mlir/Interfaces/InferTypeOpInterface.td"
@@ -12,38 +13,59 @@ include "mlir/Interfaces/InferTypeOpInterface.td"
// "intr." to avoid potential name clashes.
class LLVM_UnaryIntrOpBase<string func, Type element,
- list<Trait> traits = []> :
+ list<Trait> traits = [],
+ dag addAttrs = (ins)> :
LLVM_OneResultIntrOp<func, [], [0],
!listconcat([Pure, SameOperandsAndResultType], traits)> {
- let arguments = (ins LLVM_ScalarOrVectorOf<element>:$in);
+ dag args = (ins LLVM_ScalarOrVectorOf<element>:$in);
+ let arguments = !con(args, addAttrs);
+ let assemblyFormat = "`(` operands `)` custom<LLVMOpAttrs>(attr-dict) `:` "
+ "functional-type(operands, results)";
}
class LLVM_UnaryIntrOpI<string func, list<Trait> traits = []> :
LLVM_UnaryIntrOpBase<func, AnySignlessInteger, traits>;
class LLVM_UnaryIntrOpF<string func, list<Trait> traits = []> :
- LLVM_UnaryIntrOpBase<func, LLVM_AnyFloat, traits>;
+ LLVM_UnaryIntrOpBase<func, LLVM_AnyFloat,
+ !listconcat([DeclareOpInterfaceMethods<FastmathFlagsInterface>],
+ traits),
+ (ins DefaultValuedAttr<LLVM_FastmathFlagsAttr,
+ "{}">:$fastmathFlags)>;
class LLVM_BinarySameArgsIntrOpBase<string func, Type element,
- list<Trait> traits = []> :
+ list<Trait> traits = [],
+ dag addAttrs = (ins)> :
LLVM_OneResultIntrOp<func, [], [0],
!listconcat([Pure, SameOperandsAndResultType], traits)> {
- let arguments = (ins LLVM_ScalarOrVectorOf<element>:$a,
- LLVM_ScalarOrVectorOf<element>:$b);
+ dag args = (ins LLVM_ScalarOrVectorOf<element>:$a,
+ LLVM_ScalarOrVectorOf<element>:$b);
+ let arguments = !con(args, addAttrs);
+ let assemblyFormat = "`(` operands `)` custom<LLVMOpAttrs>(attr-dict) `:` "
+ "functional-type(operands, results)";
}
class LLVM_BinarySameArgsIntrOpI<string func, list<Trait> traits = []> :
LLVM_BinarySameArgsIntrOpBase<func, AnySignlessInteger, traits>;
class LLVM_BinarySameArgsIntrOpF<string func, list<Trait> traits = []> :
- LLVM_BinarySameArgsIntrOpBase<func, LLVM_AnyFloat, traits>;
+ LLVM_BinarySameArgsIntrOpBase<func, LLVM_AnyFloat,
+ !listconcat([DeclareOpInterfaceMethods<FastmathFlagsInterface>],
+ traits),
+ (ins DefaultValuedAttr<LLVM_FastmathFlagsAttr,
+ "{}">:$fastmathFlags)>;
class LLVM_TernarySameArgsIntrOpF<string func, list<Trait> traits = []> :
LLVM_OneResultIntrOp<func, [], [0],
- !listconcat([Pure, SameOperandsAndResultType], traits)> {
+ !listconcat([DeclareOpInterfaceMethods<FastmathFlagsInterface>,
+ Pure, SameOperandsAndResultType], traits)> {
let arguments = (ins LLVM_ScalarOrVectorOf<AnyFloat>:$a,
LLVM_ScalarOrVectorOf<AnyFloat>:$b,
- LLVM_ScalarOrVectorOf<AnyFloat>:$c);
+ LLVM_ScalarOrVectorOf<AnyFloat>:$c,
+ DefaultValuedAttr<LLVM_FastmathFlagsAttr,
+ "{}">:$fastmathFlags);
+ let assemblyFormat = "`(` operands `)` custom<LLVMOpAttrs>(attr-dict) `:` "
+ "functional-type(operands, results)";
}
class LLVM_CountZerosIntrOp<string func, list<Trait> traits = []> :
@@ -83,9 +105,14 @@ def LLVM_RoundOp : LLVM_UnaryIntrOpF<"round">;
def LLVM_FTruncOp : LLVM_UnaryIntrOpF<"trunc">;
def LLVM_SqrtOp : LLVM_UnaryIntrOpF<"sqrt">;
def LLVM_PowOp : LLVM_BinarySameArgsIntrOpF<"pow">;
-def LLVM_PowIOp : LLVM_OneResultIntrOp<"powi"> {
- let arguments = (ins LLVM_ScalarOrVectorOf<LLVM_AnyFloat>:$val,
- AnySignlessInteger:$power);
+def LLVM_PowIOp : LLVM_OneResultIntrOp<"powi", [], [0,1],
+ [DeclareOpInterfaceMethods<FastmathFlagsInterface>, Pure]> {
+ let arguments =
+ (ins LLVM_ScalarOrVectorOf<LLVM_AnyFloat>:$val,
+ AnySignlessInteger:$power,
+ DefaultValuedAttr<LLVM_FastmathFlagsAttr, "{}">:$fastmathFlags);
+ let assemblyFormat = "`(` operands `)` custom<LLVMOpAttrs>(attr-dict) `:` "
+ "functional-type(operands, results)";
}
def LLVM_BitReverseOp : LLVM_UnaryIntrOpI<"bitreverse">;
def LLVM_CountLeadingZerosOp : LLVM_CountZerosIntrOp<"ctlz">;
diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
index b3f13edb07eee..9515b2c9990af 100644
--- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
+++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
@@ -4,7 +4,6 @@ add_mlir_dialect_library(MLIRLLVMDialect
IR/FunctionCallUtils.cpp
IR/LLVMAttrs.cpp
IR/LLVMDialect.cpp
- IR/LLVMIntrinsicOps.cpp
IR/LLVMTypes.cpp
IR/LLVMTypeSyntax.cpp
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
index 375ec6ff0e78a..c2b09619a5f52 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
@@ -2612,6 +2612,9 @@ void LLVMDialect::initialize() {
#define GET_OP_CLASSES
#include "mlir/Dialect/LLVMIR/LLVMOps.cpp.inc"
+#define GET_OP_CLASSES
+#include "mlir/Dialect/LLVMIR/LLVMIntrinsicOps.cpp.inc"
+
LogicalResult LLVMDialect::verifyDataLayoutString(
StringRef descr, llvm::function_ref<void(const Twine &)> reportError) {
llvm::Expected<llvm::DataLayout> maybeDataLayout =
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMIntrinsicOps.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMIntrinsicOps.cpp
deleted file mode 100644
index a5d85a7cf4ccb..0000000000000
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMIntrinsicOps.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
-
-using namespace mlir;
-using namespace mlir::LLVM;
-
-#define GET_OP_CLASSES
-#include "mlir/Dialect/LLVMIR/LLVMIntrinsicOps.cpp.inc"
diff --git a/mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir b/mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir
index 81f402195fb4f..f2ef7081e2c6f 100644
--- a/mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir
+++ b/mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir
@@ -429,22 +429,22 @@ func.func @select(%arg0 : i1, %arg1 : i32, %arg2 : i32) -> i32 {
// CHECK-LABEL: @minmaxi
func.func @minmaxi(%arg0 : i32, %arg1 : i32) -> i32 {
- // CHECK: = "llvm.intr.smin"(%arg0, %arg1) : (i32, i32) -> i32
+ // CHECK: = llvm.intr.smin(%arg0, %arg1) : (i32, i32) -> i32
%0 = arith.minsi %arg0, %arg1 : i32
- // CHECK: = "llvm.intr.smax"(%arg0, %arg1) : (i32, i32) -> i32
+ // CHECK: = llvm.intr.smax(%arg0, %arg1) : (i32, i32) -> i32
%1 = arith.maxsi %arg0, %arg1 : i32
- // CHECK: = "llvm.intr.umin"(%arg0, %arg1) : (i32, i32) -> i32
+ // CHECK: = llvm.intr.umin(%arg0, %arg1) : (i32, i32) -> i32
%2 = arith.minui %arg0, %arg1 : i32
- // CHECK: = "llvm.intr.umax"(%arg0, %arg1) : (i32, i32) -> i32
+ // CHECK: = llvm.intr.umax(%arg0, %arg1) : (i32, i32) -> i32
%3 = arith.maxui %arg0, %arg1 : i32
return %0 : i32
}
// CHECK-LABEL: @minmaxf
func.func @minmaxf(%arg0 : f32, %arg1 : f32) -> f32 {
- // CHECK: = "llvm.intr.minnum"(%arg0, %arg1) : (f32, f32) -> f32
+ // CHECK: = llvm.intr.minnum(%arg0, %arg1) : (f32, f32) -> f32
%0 = arith.minf %arg0, %arg1 : f32
- // CHECK: = "llvm.intr.maxnum"(%arg0, %arg1) : (f32, f32) -> f32
+ // CHECK: = llvm.intr.maxnum(%arg0, %arg1) : (f32, f32) -> f32
%1 = arith.maxf %arg0, %arg1 : f32
return %0 : f32
}
diff --git a/mlir/test/Conversion/ComplexToLLVM/convert-to-llvm.mlir b/mlir/test/Conversion/ComplexToLLVM/convert-to-llvm.mlir
index 32409ca242c28..be46c22155a6c 100644
--- a/mlir/test/Conversion/ComplexToLLVM/convert-to-llvm.mlir
+++ b/mlir/test/Conversion/ComplexToLLVM/convert-to-llvm.mlir
@@ -147,6 +147,6 @@ func.func @complex_abs(%arg: complex<f32>) -> f32 {
// CHECK-DAG: %[[REAL_SQ:.*]] = llvm.fmul %[[REAL]], %[[REAL]] : f32
// CHECK-DAG: %[[IMAG_SQ:.*]] = llvm.fmul %[[IMAG]], %[[IMAG]] : f32
// CHECK: %[[SQ_NORM:.*]] = llvm.fadd %[[REAL_SQ]], %[[IMAG_SQ]] : f32
-// CHECK: %[[NORM:.*]] = "llvm.intr.sqrt"(%[[SQ_NORM]]) : (f32) -> f32
+// CHECK: %[[NORM:.*]] = llvm.intr.sqrt(%[[SQ_NORM]]) : (f32) -> f32
// CHECK: return %[[NORM]] : f32
diff --git a/mlir/test/Conversion/ComplexToLLVM/full-conversion.mlir b/mlir/test/Conversion/ComplexToLLVM/full-conversion.mlir
index d8bf45d752669..b7756b3be543f 100644
--- a/mlir/test/Conversion/ComplexToLLVM/full-conversion.mlir
+++ b/mlir/test/Conversion/ComplexToLLVM/full-conversion.mlir
@@ -66,6 +66,6 @@ func.func @complex_abs(%arg: complex<f32>) -> f32 {
// CHECK-DAG: %[[REAL_SQ:.*]] = llvm.fmul %[[REAL]], %[[REAL]] : f32
// CHECK-DAG: %[[IMAG_SQ:.*]] = llvm.fmul %[[IMAG]], %[[IMAG]] : f32
// CHECK: %[[SQ_NORM:.*]] = llvm.fadd %[[REAL_SQ]], %[[IMAG_SQ]] : f32
-// CHECK: %[[NORM:.*]] = "llvm.intr.sqrt"(%[[SQ_NORM]]) : (f32) -> f32
+// CHECK: %[[NORM:.*]] = llvm.intr.sqrt(%[[SQ_NORM]]) : (f32) -> f32
// CHECK: llvm.return %[[NORM]] : f32
diff --git a/mlir/test/Conversion/ComplexToStandard/full-conversion.mlir b/mlir/test/Conversion/ComplexToStandard/full-conversion.mlir
index 5ff58240358e7..f6d023b92aab9 100644
--- a/mlir/test/Conversion/ComplexToStandard/full-conversion.mlir
+++ b/mlir/test/Conversion/ComplexToStandard/full-conversion.mlir
@@ -11,7 +11,7 @@ func.func @complex_abs(%arg: complex<f32>) -> f32 {
// CHECK-DAG: %[[REAL_SQ:.*]] = llvm.fmul %[[REAL]], %[[REAL]] : f32
// CHECK-DAG: %[[IMAG_SQ:.*]] = llvm.fmul %[[IMAG]], %[[IMAG]] : f32
// CHECK: %[[SQ_NORM:.*]] = llvm.fadd %[[REAL_SQ]], %[[IMAG_SQ]] : f32
-// CHECK: %[[NORM:.*]] = "llvm.intr.sqrt"(%[[SQ_NORM]]) : (f32) -> f32
+// CHECK: %[[NORM:.*]] = llvm.intr.sqrt(%[[SQ_NORM]]) : (f32) -> f32
// CHECK: llvm.return %[[NORM]] : f32
// CHECK-LABEL: llvm.func @complex_eq
diff --git a/mlir/test/Conversion/FuncToLLVM/func-to-llvm.mlir b/mlir/test/Conversion/FuncToLLVM/func-to-llvm.mlir
index 7f4396b7b6d79..481067cf8d915 100644
--- a/mlir/test/Conversion/FuncToLLVM/func-to-llvm.mlir
+++ b/mlir/test/Conversion/FuncToLLVM/func-to-llvm.mlir
@@ -452,7 +452,7 @@ func.func @dfs_block_order(%arg0: i32) -> (i32) {
// CHECK-LABEL: func @ceilf(
// CHECK-SAME: f32
func.func @ceilf(%arg0 : f32) {
- // CHECK: "llvm.intr.ceil"(%arg0) : (f32) -> f32
+ // CHECK: llvm.intr.ceil(%arg0) : (f32) -> f32
%0 = math.ceil %arg0 : f32
func.return
}
@@ -462,7 +462,7 @@ func.func @ceilf(%arg0 : f32) {
// CHECK-LABEL: func @floorf(
// CHECK-SAME: f32
func.func @floorf(%arg0 : f32) {
- // CHECK: "llvm.intr.floor"(%arg0) : (f32) -> f32
+ // CHECK: llvm.intr.floor(%arg0) : (f32) -> f32
%0 = math.floor %arg0 : f32
func.return
}
@@ -503,9 +503,9 @@ func.func private @zero_result_func()
// CHECK-SAME: %[[ARG0:.*]]: f32
// CHECK-SAME: %[[ARG1:.*]]: vector<4xf32>
func.func @fmaf(%arg0: f32, %arg1: vector<4xf32>) {
- // CHECK: %[[S:.*]] = "llvm.intr.fma"(%[[ARG0]], %[[ARG0]], %[[ARG0]]) : (f32, f32, f32) -> f32
+ // CHECK: %[[S:.*]] = llvm.intr.fma(%[[ARG0]], %[[ARG0]], %[[ARG0]]) : (f32, f32, f32) -> f32
%0 = math.fma %arg0, %arg0, %arg0 : f32
- // CHECK: %[[V:.*]] = "llvm.intr.fma"(%[[ARG1]], %[[ARG1]], %[[ARG1]]) : (vector<4xf32>, vector<4xf32>, vector<4xf32>) -> vector<4xf32>
+ // CHECK: %[[V:.*]] = llvm.intr.fma(%[[ARG1]], %[[ARG1]], %[[ARG1]]) : (vector<4xf32>, vector<4xf32>, vector<4xf32>) -> vector<4xf32>
%1 = math.fma %arg1, %arg1, %arg1 : vector<4xf32>
func.return
}
diff --git a/mlir/test/Conversion/MathToLLVM/math-to-llvm.mlir b/mlir/test/Conversion/MathToLLVM/math-to-llvm.mlir
index 415ba1d9f001c..7f4b9634de3ba 100644
--- a/mlir/test/Conversion/MathToLLVM/math-to-llvm.mlir
+++ b/mlir/test/Conversion/MathToLLVM/math-to-llvm.mlir
@@ -2,13 +2,13 @@
// CHECK-LABEL: @ops
func.func @ops(%arg0: f32, %arg1: f32, %arg2: i32, %arg3: i32, %arg4: f64) {
- // CHECK: = "llvm.intr.exp"(%{{.*}}) : (f32) -> f32
+ // CHECK: = llvm.intr.exp(%{{.*}}) : (f32) -> f32
%0 = math.exp %arg0 : f32
- // CHECK: = "llvm.intr.exp2"(%{{.*}}) : (f32) -> f32
+ // CHECK: = llvm.intr.exp2(%{{.*}}) : (f32) -> f32
%1 = math.exp2 %arg0 : f32
- // CHECK: = "llvm.intr.sqrt"(%{{.*}}) : (f32) -> f32
+ // CHECK: = llvm.intr.sqrt(%{{.*}}) : (f32) -> f32
%2 = math.sqrt %arg0 : f32
- // CHECK: = "llvm.intr.sqrt"(%{{.*}}) : (f64) -> f64
+ // CHECK: = llvm.intr.sqrt(%{{.*}}) : (f64) -> f64
%3 = math.sqrt %arg4 : f64
func.return
}
@@ -29,7 +29,7 @@ func.func @absi(%arg0: i32) -> i32 {
func.func @log1p(%arg0 : f32) {
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : f32
// CHECK: %[[ADD:.*]] = llvm.fadd %[[ONE]], %arg0 : f32
- // CHECK: %[[LOG:.*]] = "llvm.intr.log"(%[[ADD]]) : (f32) -> f32
+ // CHECK: %[[LOG:.*]] = llvm.intr.log(%[[ADD]]) : (f32) -> f32
%0 = math.log1p %arg0 : f32
func.return
}
@@ -41,7 +41,7 @@ func.func @log1p_2dvector(%arg0 : vector<4x3xf32>) {
// CHECK: %[[EXTRACT:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.array<4 x vector<3xf32>>
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(dense<1.000000e+00> : vector<3xf32>) : vector<3xf32>
// CHECK: %[[ADD:.*]] = llvm.fadd %[[ONE]], %[[EXTRACT]] : vector<3xf32>
- // CHECK: %[[LOG:.*]] = "llvm.intr.log"(%[[ADD]]) : (vector<3xf32>) -> vector<3xf32>
+ // CHECK: %[[LOG:.*]] = llvm.intr.log(%[[ADD]]) : (vector<3xf32>) -> vector<3xf32>
// CHECK: %[[INSERT:.*]] = llvm.insertvalue %[[LOG]], %{{.*}}[0] : !llvm.array<4 x vector<3xf32>>
%0 = math.log1p %arg0 : vector<4x3xf32>
func.return
@@ -53,7 +53,7 @@ func.func @log1p_2dvector(%arg0 : vector<4x3xf32>) {
// CHECK-SAME: f32
func.func @expm1(%arg0 : f32) {
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : f32
- // CHECK: %[[EXP:.*]] = "llvm.intr.exp"(%arg0) : (f32) -> f32
+ // CHECK: %[[EXP:.*]] = llvm.intr.exp(%arg0) : (f32) -> f32
// CHECK: %[[SUB:.*]] = llvm.fsub %[[EXP]], %[[ONE]] : f32
%0 = math.expm1 %arg0 : f32
func.return
@@ -65,7 +65,7 @@ func.func @expm1(%arg0 : f32) {
// CHECK-SAME: f32
func.func @rsqrt(%arg0 : f32) {
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : f32
- // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%arg0) : (f32) -> f32
+ // CHECK: %[[SQRT:.*]] = llvm.intr.sqrt(%arg0) : (f32) -> f32
// CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : f32
%0 = math.rsqrt %arg0 : f32
func.return
@@ -76,7 +76,7 @@ func.func @rsqrt(%arg0 : f32) {
// CHECK-LABEL: func @sine(
// CHECK-SAME: f32
func.func @sine(%arg0 : f32) {
- // CHECK: "llvm.intr.sin"(%arg0) : (f32) -> f32
+ // CHECK: llvm.intr.sin(%arg0) : (f32) -> f32
%0 = math.sin %arg0 : f32
func.return
}
@@ -119,7 +119,7 @@ func.func @cttz_vec(%arg0 : vector<4xi32>) {
// CHECK-LABEL: func @ctpop(
// CHECK-SAME: i32
func.func @ctpop(%arg0 : i32) {
- // CHECK: "llvm.intr.ctpop"(%arg0) : (i32) -> i32
+ // CHECK: llvm.intr.ctpop(%arg0) : (i32) -> i32
%0 = math.ctpop %arg0 : i32
func.return
}
@@ -129,7 +129,7 @@ func.func @ctpop(%arg0 : i32) {
// CHECK-LABEL: func @ctpop_vector(
// CHECK-SAME: vector<3xi32>
func.func @ctpop_vector(%arg0 : vector<3xi32>) {
- // CHECK: "llvm.intr.ctpop"(%arg0) : (vector<3xi32>) -> vector<3xi32>
+ // CHECK: llvm.intr.ctpop(%arg0) : (vector<3xi32>) -> vector<3xi32>
%0 = math.ctpop %arg0 : vector<3xi32>
func.return
}
@@ -140,7 +140,7 @@ func.func @ctpop_vector(%arg0 : vector<3xi32>) {
// CHECK-SAME: f64
func.func @rsqrt_double(%arg0 : f64) {
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f64) : f64
- // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%arg0) : (f64) -> f64
+ // CHECK: %[[SQRT:.*]] = llvm.intr.sqrt(%arg0) : (f64) -> f64
// CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : f64
%0 = math.rsqrt %arg0 : f64
func.return
@@ -152,7 +152,7 @@ func.func @rsqrt_double(%arg0 : f64) {
// CHECK-SAME: vector<4xf32>
func.func @rsqrt_vector(%arg0 : vector<4xf32>) {
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(dense<1.000000e+00> : vector<4xf32>) : vector<4xf32>
- // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%arg0) : (vector<4xf32>) -> vector<4xf32>
+ // CHECK: %[[SQRT:.*]] = llvm.intr.sqrt(%arg0) : (vector<4xf32>) -> vector<4xf32>
// CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : vector<4xf32>
%0 = math.rsqrt %arg0 : vector<4xf32>
func.return
@@ -164,7 +164,7 @@ func.func @rsqrt_vector(%arg0 : vector<4xf32>) {
func.func @rsqrt_multidim_vector(%arg0 : vector<4x3xf32>) {
// CHECK: %[[EXTRACT:.*]] = llvm.extractvalue %{{.*}}[0] : !llvm.array<4 x vector<3xf32>>
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(dense<1.000000e+00> : vector<3xf32>) : vector<3xf32>
- // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%[[EXTRACT]]) : (vector<3xf32>) -> vector<3xf32>
+ // CHECK: %[[SQRT:.*]] = llvm.intr.sqrt(%[[EXTRACT]]) : (vector<3xf32>) -> vector<3xf32>
// CHECK: %[[DIV:.*]] = llvm.fdiv %[[ONE]], %[[SQRT]] : vector<3xf32>
// CHECK: %[[INSERT:.*]] = llvm.insertvalue %[[DIV]], %{{.*}}[0] : !llvm.array<4 x vector<3xf32>>
%0 = math.rsqrt %arg0 : vector<4x3xf32>
@@ -176,7 +176,7 @@ func.func @rsqrt_multidim_vector(%arg0 : vector<4x3xf32>) {
// CHECK-LABEL: func @powf(
// CHECK-SAME: f64
func.func @powf(%arg0 : f64) {
- // CHECK: %[[POWF:.*]] = "llvm.intr.pow"(%arg0, %arg0) : (f64, f64) -> f64
+ // CHECK: %[[POWF:.*]] = llvm.intr.pow(%arg0, %arg0) : (f64, f64) -> f64
%0 = math.powf %arg0, %arg0 : f64
func.return
}
@@ -186,7 +186,7 @@ func.func @powf(%arg0 : f64) {
// CHECK-LABEL: func @round(
// CHECK-SAME: f32
func.func @round(%arg0 : f32) {
- // CHECK: "llvm.intr.round"(%arg0) : (f32) -> f32
+ // CHECK: llvm.intr.round(%arg0) : (f32) -> f32
%0 = math.round %arg0 : f32
func.return
}
@@ -196,7 +196,7 @@ func.func @round(%arg0 : f32) {
// CHECK-LABEL: func @roundeven(
// CHECK-SAME: f32
func.func @roundeven(%arg0 : f32) {
- // CHECK: "llvm.intr.roundeven"(%arg0) : (f32) -> f32
+ // CHECK: llvm.intr.roundeven(%arg0) : (f32) -> f32
%0 = math.roundeven %arg0 : f32
func.return
}
@@ -206,7 +206,7 @@ func.func @roundeven(%arg0 : f32) {
// CHECK-LABEL: func @trunc(
// CHECK-SAME: f32
func.func @trunc(%arg0 : f32) {
- // CHECK: "llvm.intr.trunc"(%arg0) : (f32) -> f32
+ // CHECK: llvm.intr.trunc(%arg0) : (f32) -> f32
%0 = math.trunc %arg0 : f32
func.return
}
diff --git a/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
index 7c25cf579f0dc..a0afe0dafcaa2 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
@@ -6,14 +6,14 @@
// CHECK-LABEL: @bitcount_scalar
spirv.func @bitcount_scalar(%arg0: i16) "None" {
- // CHECK: "llvm.intr.ctpop"(%{{.*}}) : (i16) -> i16
+ // CHECK: llvm.intr.ctpop(%{{.*}}) : (i16) -> i16
%0 = spirv.BitCount %arg0: i16
spirv.Return
}
// CHECK-LABEL: @bitcount_vector
spirv.func @bitcount_vector(%arg0: vector<3xi32>) "None" {
- // CHECK: "llvm.intr.ctpop"(%{{.*}}) : (vector<3xi32>) -> vector<3xi32>
+ // CHECK: llvm.intr.ctpop(%{{.*}}) : (vector<3xi32>) -> vector<3xi32>
%0 = spirv.BitCount %arg0: vector<3xi32>
spirv.Return
}
@@ -24,14 +24,14 @@ spirv.func @bitcount_vector(%arg0: vector<3xi32>) "None" {
// CHECK-LABEL: @bitreverse_scalar
spirv.func @bitreverse_scalar(%arg0: i64) "None" {
- // CHECK: "llvm.intr.bitreverse"(%{{.*}}) : (i64) -> i64
+ // CHECK: llvm.intr.bitreverse(%{{.*}}) : (i64) -> i64
%0 = spirv.BitReverse %arg0: i64
spirv.Return
}
// CHECK-LABEL: @bitreverse_vector
spirv.func @bitreverse_vector(%arg0: vector<4xi32>) "None" {
- // CHECK: "llvm.intr.bitreverse"(%{{.*}}) : (vector<4xi32>) -> vector<4xi32>
+ // CHECK: llvm.intr.bitreverse(%{{.*}}) : (vector<4xi32>) -> vector<4xi32>
%0 = spirv.BitReverse %arg0: vector<4xi32>
spirv.Return
}
diff --git a/mlir/test/Conversion/SPIRVToLLVM/gl-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/gl-ops-to-llvm.mlir
index dffa7dd0f392b..e1936e2fd8abe 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/gl-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/gl-ops-to-llvm.mlir
@@ -6,9 +6,9 @@
// CHECK-LABEL: @ceil
spirv.func @ceil(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.ceil"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.ceil(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.Ceil %arg0 : f32
- // CHECK: "llvm.intr.ceil"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.ceil(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.Ceil %arg1 : vector<3xf16>
spirv.Return
}
@@ -19,9 +19,9 @@ spirv.func @ceil(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @cos
spirv.func @cos(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.cos"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.cos(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.Cos %arg0 : f32
- // CHECK: "llvm.intr.cos"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.cos(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.Cos %arg1 : vector<3xf16>
spirv.Return
}
@@ -32,9 +32,9 @@ spirv.func @cos(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @exp
spirv.func @exp(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.exp"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.exp(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.Exp %arg0 : f32
- // CHECK: "llvm.intr.exp"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.exp(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.Exp %arg1 : vector<3xf16>
spirv.Return
}
@@ -45,9 +45,9 @@ spirv.func @exp(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @fabs
spirv.func @fabs(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.fabs"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.fabs(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.FAbs %arg0 : f32
- // CHECK: "llvm.intr.fabs"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.fabs(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.FAbs %arg1 : vector<3xf16>
spirv.Return
}
@@ -58,9 +58,9 @@ spirv.func @fabs(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @floor
spirv.func @floor(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.floor"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.floor(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.Floor %arg0 : f32
- // CHECK: "llvm.intr.floor"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.floor(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.Floor %arg1 : vector<3xf16>
spirv.Return
}
@@ -71,9 +71,9 @@ spirv.func @floor(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @fmax
spirv.func @fmax(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ // CHECK: llvm.intr.maxnum(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%0 = spirv.GL.FMax %arg0, %arg0 : f32
- // CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (vector<3xf16>, vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.maxnum(%{{.*}}, %{{.*}}) : (vector<3xf16>, vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.FMax %arg1, %arg1 : vector<3xf16>
spirv.Return
}
@@ -84,9 +84,9 @@ spirv.func @fmax(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @fmin
spirv.func @fmin(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ // CHECK: llvm.intr.minnum(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%0 = spirv.GL.FMin %arg0, %arg0 : f32
- // CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (vector<3xf16>, vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.minnum(%{{.*}}, %{{.*}}) : (vector<3xf16>, vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.FMin %arg1, %arg1 : vector<3xf16>
spirv.Return
}
@@ -97,9 +97,9 @@ spirv.func @fmin(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @log
spirv.func @log(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.log"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.log(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.Log %arg0 : f32
- // CHECK: "llvm.intr.log"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.log(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.Log %arg1 : vector<3xf16>
spirv.Return
}
@@ -110,9 +110,9 @@ spirv.func @log(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @sin
spirv.func @sin(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.sin"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.sin(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.Sin %arg0 : f32
- // CHECK: "llvm.intr.sin"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.sin(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.Sin %arg1 : vector<3xf16>
spirv.Return
}
@@ -123,9 +123,9 @@ spirv.func @sin(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @smax
spirv.func @smax(%arg0: i16, %arg1: vector<3xi32>) "None" {
- // CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (i16, i16) -> i16
+ // CHECK: llvm.intr.smax(%{{.*}}, %{{.*}}) : (i16, i16) -> i16
%0 = spirv.GL.SMax %arg0, %arg0 : i16
- // CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (vector<3xi32>, vector<3xi32>) -> vector<3xi32>
+ // CHECK: llvm.intr.smax(%{{.*}}, %{{.*}}) : (vector<3xi32>, vector<3xi32>) -> vector<3xi32>
%1 = spirv.GL.SMax %arg1, %arg1 : vector<3xi32>
spirv.Return
}
@@ -136,9 +136,9 @@ spirv.func @smax(%arg0: i16, %arg1: vector<3xi32>) "None" {
// CHECK-LABEL: @smin
spirv.func @smin(%arg0: i16, %arg1: vector<3xi32>) "None" {
- // CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (i16, i16) -> i16
+ // CHECK: llvm.intr.smin(%{{.*}}, %{{.*}}) : (i16, i16) -> i16
%0 = spirv.GL.SMin %arg0, %arg0 : i16
- // CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (vector<3xi32>, vector<3xi32>) -> vector<3xi32>
+ // CHECK: llvm.intr.smin(%{{.*}}, %{{.*}}) : (vector<3xi32>, vector<3xi32>) -> vector<3xi32>
%1 = spirv.GL.SMin %arg1, %arg1 : vector<3xi32>
spirv.Return
}
@@ -149,9 +149,9 @@ spirv.func @smin(%arg0: i16, %arg1: vector<3xi32>) "None" {
// CHECK-LABEL: @sqrt
spirv.func @sqrt(%arg0: f32, %arg1: vector<3xf16>) "None" {
- // CHECK: "llvm.intr.sqrt"(%{{.*}}) : (f32) -> f32
+ // CHECK: llvm.intr.sqrt(%{{.*}}) : (f32) -> f32
%0 = spirv.GL.Sqrt %arg0 : f32
- // CHECK: "llvm.intr.sqrt"(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
+ // CHECK: llvm.intr.sqrt(%{{.*}}) : (vector<3xf16>) -> vector<3xf16>
%1 = spirv.GL.Sqrt %arg1 : vector<3xf16>
spirv.Return
}
@@ -162,8 +162,8 @@ spirv.func @sqrt(%arg0: f32, %arg1: vector<3xf16>) "None" {
// CHECK-LABEL: @tan
spirv.func @tan(%arg0: f32) "None" {
- // CHECK: %[[SIN:.*]] = "llvm.intr.sin"(%{{.*}}) : (f32) -> f32
- // CHECK: %[[COS:.*]] = "llvm.intr.cos"(%{{.*}}) : (f32) -> f32
+ // CHECK: %[[SIN:.*]] = llvm.intr.sin(%{{.*}}) : (f32) -> f32
+ // CHECK: %[[COS:.*]] = llvm.intr.cos(%{{.*}}) : (f32) -> f32
// CHECK: llvm.fdiv %[[SIN]], %[[COS]] : f32
%0 = spirv.GL.Tan %arg0 : f32
spirv.Return
@@ -177,7 +177,7 @@ spirv.func @tan(%arg0: f32) "None" {
spirv.func @tanh(%arg0: f32) "None" {
// CHECK: %[[TWO:.*]] = llvm.mlir.constant(2.000000e+00 : f32) : f32
// CHECK: %[[X2:.*]] = llvm.fmul %[[TWO]], %{{.*}} : f32
- // CHECK: %[[EXP:.*]] = "llvm.intr.exp"(%[[X2]]) : (f32) -> f32
+ // CHECK: %[[EXP:.*]] = llvm.intr.exp(%[[X2]]) : (f32) -> f32
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : f32
// CHECK: %[[T0:.*]] = llvm.fsub %[[EXP]], %[[ONE]] : f32
// CHECK: %[[T1:.*]] = llvm.fadd %[[EXP]], %[[ONE]] : f32
@@ -193,7 +193,7 @@ spirv.func @tanh(%arg0: f32) "None" {
// CHECK-LABEL: @inverse_sqrt
spirv.func @inverse_sqrt(%arg0: f32) "None" {
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1.000000e+00 : f32) : f32
- // CHECK: %[[SQRT:.*]] = "llvm.intr.sqrt"(%{{.*}}) : (f32) -> f32
+ // CHECK: %[[SQRT:.*]] = llvm.intr.sqrt(%{{.*}}) : (f32) -> f32
// CHECK: llvm.fdiv %[[ONE]], %[[SQRT]] : f32
%0 = spirv.GL.InverseSqrt %arg0 : f32
spirv.Return
diff --git a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
index ed4d398780e16..0a4732aecf0fc 100644
--- a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
+++ b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
@@ -404,14 +404,14 @@ func.func @outerproduct_add(%arg0: vector<2xf32>, %arg1: vector<3xf32>, %arg2: v
// CHECK: %[[T6Insert:.*]] = llvm.insertelement %[[T5]]
// CHECK: %[[T6:.*]] = llvm.shufflevector %[[T6Insert]]
// CHECK: %[[T8:.*]] = llvm.extractvalue %[[T7]][0] : !llvm.array<2 x vector<3xf32>>
-// CHECK: %[[T9:.*]] = "llvm.intr.fmuladd"(%[[T6]], %[[B]], %[[T8]]) : (vector<3xf32>, vector<3xf32>, vector<3xf32>) -> vector<3xf32>
+// CHECK: %[[T9:.*]] = llvm.intr.fmuladd(%[[T6]], %[[B]], %[[T8]]) : (vector<3xf32>, vector<3xf32>, vector<3xf32>) -> vector<3xf32>
// CHECK: %[[T11:.*]] = llvm.insertvalue %[[T9]], %[[T10]][0] : !llvm.array<2 x vector<3xf32>>
// CHECK: %[[T12:.*]] = llvm.mlir.constant(1 : i64) : i64
// CHECK: %[[T13:.*]] = llvm.extractelement %[[A]]{{\[}}%[[T12]] : i64] : vector<2xf32>
// CHECK: %[[T14Insert:.*]] = llvm.insertelement %[[T13]]
// CHECK: %[[T14:.*]] = llvm.shufflevector %[[T14Insert]]
// CHECK: %[[T16:.*]] = llvm.extractvalue %[[T7]][1] : !llvm.array<2 x vector<3xf32>>
-// CHECK: %[[T17:.*]] = "llvm.intr.fmuladd"(%[[T14]], %[[B]], %[[T16]]) : (vector<3xf32>, vector<3xf32>, vector<3xf32>) -> vector<3xf32>
+// CHECK: %[[T17:.*]] = llvm.intr.fmuladd(%[[T14]], %[[B]], %[[T16]]) : (vector<3xf32>, vector<3xf32>, vector<3xf32>) -> vector<3xf32>
// CHECK: %[[T18:.*]] = llvm.insertvalue %[[T17]], %[[T11]][1] : !llvm.array<2 x vector<3xf32>>
// CHECK: %[[T19:.*]] = builtin.unrealized_conversion_cast %[[T18]] : !llvm.array<2 x vector<3xf32>> to vector<2x3xf32>
// CHECK: return %[[T19]] : vector<2x3xf32>
@@ -1103,29 +1103,29 @@ func.func @vector_fma(%a: vector<8xf32>, %b: vector<2x4xf32>, %c: vector<1x1x1xf
// CHECK-SAME: %[[B:.*]]: vector<2x4xf32>
// CHECK-SAME: %[[C:.*]]: vector<1x1x1xf32>
// CHECK: %[[BL:.*]] = builtin.unrealized_conversion_cast %[[B]] : vector<2x4xf32> to !llvm.array<2 x vector<4xf32>>
- // CHECK: "llvm.intr.fmuladd"
+ // CHECK: llvm.intr.fmuladd
// CHECK-SAME: (vector<8xf32>, vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%0 = vector.fma %a, %a, %a : vector<8xf32>
// CHECK: %[[b00:.*]] = llvm.extractvalue %[[BL]][0] : !llvm.array<2 x vector<4xf32>>
// CHECK: %[[b01:.*]] = llvm.extractvalue %[[BL]][0] : !llvm.array<2 x vector<4xf32>>
// CHECK: %[[b02:.*]] = llvm.extractvalue %[[BL]][0] : !llvm.array<2 x vector<4xf32>>
- // CHECK: %[[B0:.*]] = "llvm.intr.fmuladd"(%[[b00]], %[[b01]], %[[b02]]) :
+ // CHECK: %[[B0:.*]] = llvm.intr.fmuladd(%[[b00]], %[[b01]], %[[b02]]) :
// CHECK-SAME: (vector<4xf32>, vector<4xf32>, vector<4xf32>) -> vector<4xf32>
// CHECK: llvm.insertvalue %[[B0]], {{.*}}[0] : !llvm.array<2 x vector<4xf32>>
// CHECK: %[[b10:.*]] = llvm.extractvalue %[[BL]][1] : !llvm.array<2 x vector<4xf32>>
// CHECK: %[[b11:.*]] = llvm.extractvalue %[[BL]][1] : !llvm.array<2 x vector<4xf32>>
// CHECK: %[[b12:.*]] = llvm.extractvalue %[[BL]][1] : !llvm.array<2 x vector<4xf32>>
- // CHECK: %[[B1:.*]] = "llvm.intr.fmuladd"(%[[b10]], %[[b11]], %[[b12]]) :
+ // CHECK: %[[B1:.*]] = llvm.intr.fmuladd(%[[b10]], %[[b11]], %[[b12]]) :
// CHECK-SAME: (vector<4xf32>, vector<4xf32>, vector<4xf32>) -> vector<4xf32>
// CHECK: llvm.insertvalue %[[B1]], {{.*}}[1] : !llvm.array<2 x vector<4xf32>>
%1 = vector.fma %b, %b, %b : vector<2x4xf32>
- // CHECK: %[[C0:.*]] = "llvm.intr.fmuladd"
+ // CHECK: %[[C0:.*]] = llvm.intr.fmuladd
// CHECK-SAME: (vector<1xf32>, vector<1xf32>, vector<1xf32>) -> vector<1xf32>
%2 = vector.fma %c, %c, %c : vector<1x1x1xf32>
- // CHECK: %[[D0:.*]] = "llvm.intr.fmuladd"
+ // CHECK: %[[D0:.*]] = llvm.intr.fmuladd
// CHECK-SAME: (vector<1xf32>, vector<1xf32>, vector<1xf32>) -> vector<1xf32>
%3 = vector.fma %d, %d, %d : vector<f32>
diff --git a/mlir/test/Dialect/LLVMIR/optimize-for-nvvm.mlir b/mlir/test/Dialect/LLVMIR/optimize-for-nvvm.mlir
index e1cfd0c44f89b..b98d2e08b7548 100644
--- a/mlir/test/Dialect/LLVMIR/optimize-for-nvvm.mlir
+++ b/mlir/test/Dialect/LLVMIR/optimize-for-nvvm.mlir
@@ -9,8 +9,8 @@ llvm.func @fdiv_fp16(%arg0 : f16, %arg1 : f16) -> f16 {
// CHECK-DAG: %[[rcp:.*]] = nvvm.rcp.approx.ftz.f %[[rhs]] : f32
// CHECK-DAG: %[[approx:.*]] = llvm.fmul %[[lhs]], %[[rcp]] : f32
// CHECK-DAG: %[[neg:.*]] = llvm.fneg %[[rhs]] : f32
- // CHECK-DAG: %[[err:.*]] = "llvm.intr.fma"(%[[approx]], %[[neg]], %[[lhs]]) : (f32, f32, f32) -> f32
- // CHECK-DAG: %[[refined:.*]] = "llvm.intr.fma"(%[[err]], %[[rcp]], %[[approx]]) : (f32, f32, f32) -> f32
+ // CHECK-DAG: %[[err:.*]] = llvm.intr.fma(%[[approx]], %[[neg]], %[[lhs]]) : (f32, f32, f32) -> f32
+ // CHECK-DAG: %[[refined:.*]] = llvm.intr.fma(%[[err]], %[[rcp]], %[[approx]]) : (f32, f32, f32) -> f32
// CHECK-DAG: %[[cast:.*]] = llvm.bitcast %[[approx]] : f32 to i32
// CHECK-DAG: %[[exp:.*]] = llvm.and %[[cast]], %[[mask]] : i32
// CHECK-DAG: %[[is_zero:.*]] = llvm.icmp "eq" %[[exp]], %[[c0]] : i32
diff --git a/mlir/test/Dialect/LLVMIR/roundtrip.mlir b/mlir/test/Dialect/LLVMIR/roundtrip.mlir
index 34ce89504c530..884a53dd40cd1 100644
--- a/mlir/test/Dialect/LLVMIR/roundtrip.mlir
+++ b/mlir/test/Dialect/LLVMIR/roundtrip.mlir
@@ -146,23 +146,23 @@ func.func @ops(%arg0: i32, %arg1: f32,
// CHECK: %{{.*}} = llvm.fneg %[[FLOAT]] : f32
%29 = llvm.fneg %arg1 : f32
-// CHECK: "llvm.intr.sin"(%[[FLOAT]]) : (f32) -> f32
- %30 = "llvm.intr.sin"(%arg1) : (f32) -> f32
+// CHECK: llvm.intr.sin(%[[FLOAT]]) : (f32) -> f32
+ %30 = llvm.intr.sin(%arg1) : (f32) -> f32
-// CHECK: "llvm.intr.pow"(%[[FLOAT]], %[[FLOAT]]) : (f32, f32) -> f32
- %31 = "llvm.intr.pow"(%arg1, %arg1) : (f32, f32) -> f32
+// CHECK: llvm.intr.pow(%[[FLOAT]], %[[FLOAT]]) : (f32, f32) -> f32
+ %31 = llvm.intr.pow(%arg1, %arg1) : (f32, f32) -> f32
-// CHECK: "llvm.intr.powi"(%[[FLOAT]], %[[I32]]) : (f32, i32) -> f32
- %a31 = "llvm.intr.powi"(%arg1, %arg0) : (f32, i32) -> f32
+// CHECK: llvm.intr.powi(%[[FLOAT]], %[[I32]]) : (f32, i32) -> f32
+ %a31 = llvm.intr.powi(%arg1, %arg0) : (f32, i32) -> f32
-// CHECK: "llvm.intr.bitreverse"(%{{.*}}) : (i32) -> i32
- %32 = "llvm.intr.bitreverse"(%arg0) : (i32) -> i32
+// CHECK: llvm.intr.bitreverse(%{{.*}}) : (i32) -> i32
+ %32 = llvm.intr.bitreverse(%arg0) : (i32) -> i32
-// CHECK: "llvm.intr.ctpop"(%{{.*}}) : (i32) -> i32
- %33 = "llvm.intr.ctpop"(%arg0) : (i32) -> i32
+// CHECK: llvm.intr.ctpop(%{{.*}}) : (i32) -> i32
+ %33 = llvm.intr.ctpop(%arg0) : (i32) -> i32
-// CHECK: "llvm.intr.round"(%[[FLOAT]]) : (f32) -> f32
- %34 = "llvm.intr.round"(%arg1) : (f32) -> f32
+// CHECK: llvm.intr.round(%[[FLOAT]]) : (f32) -> f32
+ %34 = llvm.intr.round(%arg1) : (f32) -> f32
// CHECK: "llvm.intr.memcpy"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr<i8>, !llvm.ptr<i8>, i32, i1) -> ()
"llvm.intr.memcpy"(%arg2, %arg3, %arg0, %arg4) : (!llvm.ptr<i8>, !llvm.ptr<i8>, i32, i1) -> ()
@@ -483,6 +483,11 @@ func.func @fastmathFlags(%arg0: f32, %arg1: f32, %arg2: i32, %arg3: vector<2 x f
// CHECK: {{.*}} = llvm.fneg %arg0 : f32
%10 = llvm.fneg %arg0 {fastmathFlags = #llvm.fastmath<none>} : f32
+
+// CHECK: {{.*}} = llvm.intr.sin(%arg0) {fastmathFlags = #llvm.fastmath<fast>} : (f32) -> f32
+ %11 = llvm.intr.sin(%arg0) {fastmathFlags = #llvm.fastmath<fast>} : (f32) -> f32
+// CHECK: {{.*}} = llvm.intr.sin(%arg0) {fastmathFlags = #llvm.fastmath<afn>} : (f32) -> f32
+ %12 = llvm.intr.sin(%arg0) {fastmathFlags = #llvm.fastmath<afn>} : (f32) -> f32
return
}
diff --git a/mlir/test/Dialect/OpenMP/ops.mlir b/mlir/test/Dialect/OpenMP/ops.mlir
index fad78b2b0ca96..ba276047a742c 100644
--- a/mlir/test/Dialect/OpenMP/ops.mlir
+++ b/mlir/test/Dialect/OpenMP/ops.mlir
@@ -796,12 +796,12 @@ func.func @omp_atomic_update(%x : memref<i32>, %expr : i32, %xBool : memref<i1>,
}
// CHECK: omp.atomic.update %[[X]] : memref<i32>
// CHECK-NEXT: (%[[XVAL:.*]]: i32):
- // CHECK-NEXT: %[[NEWVAL:.*]] = "llvm.intr.smax"(%[[XVAL]], %[[EXPR]]) : (i32, i32) -> i32
+ // CHECK-NEXT: %[[NEWVAL:.*]] = llvm.intr.smax(%[[XVAL]], %[[EXPR]]) : (i32, i32) -> i32
// CHECK-NEXT: omp.yield(%[[NEWVAL]] : i32)
// CHECK-NEXT: }
omp.atomic.update %x : memref<i32> {
^bb0(%xval: i32):
- %newval = "llvm.intr.smax"(%xval, %expr) : (i32, i32) -> i32
+ %newval = llvm.intr.smax(%xval, %expr) : (i32, i32) -> i32
omp.yield(%newval : i32)
}
diff --git a/mlir/test/Target/LLVMIR/Import/intrinsic.ll b/mlir/test/Target/LLVMIR/Import/intrinsic.ll
index d8fca91860053..b8ea328eec6df 100644
--- a/mlir/test/Target/LLVMIR/Import/intrinsic.ll
+++ b/mlir/test/Target/LLVMIR/Import/intrinsic.ll
@@ -6,13 +6,13 @@ define void @intrinsics() {
; CHECK-LABEL: llvm.func @fmuladd_test
define void @fmuladd_test(float %0, float %1, <8 x float> %2, i8* %3) {
- ; CHECK: "llvm.intr.fmuladd"(%{{.*}}, %{{.*}}, %{{.*}}) : (f32, f32, f32) -> f32
+ ; CHECK: llvm.intr.fmuladd(%{{.*}}, %{{.*}}, %{{.*}}) : (f32, f32, f32) -> f32
%5 = call float @llvm.fmuladd.f32(float %0, float %1, float %0)
- ; CHECK: "llvm.intr.fmuladd"(%{{.*}}, %{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.fmuladd(%{{.*}}, %{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%6 = call <8 x float> @llvm.fmuladd.v8f32(<8 x float> %2, <8 x float> %2, <8 x float> %2)
- ; CHECK: "llvm.intr.fma"(%{{.*}}, %{{.*}}, %{{.*}}) : (f32, f32, f32) -> f32
+ ; CHECK: llvm.intr.fma(%{{.*}}, %{{.*}}, %{{.*}}) : (f32, f32, f32) -> f32
%7 = call float @llvm.fma.f32(float %0, float %1, float %0)
- ; CHECK: "llvm.intr.fma"(%{{.*}}, %{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.fma(%{{.*}}, %{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%8 = call <8 x float> @llvm.fma.v8f32(<8 x float> %2, <8 x float> %2, <8 x float> %2)
; CHECK: "llvm.intr.prefetch"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!llvm.ptr<i8>, i32, i32, i32) -> ()
call void @llvm.prefetch.p0i8(i8* %3, i32 0, i32 3, i32 1)
@@ -21,111 +21,111 @@ define void @fmuladd_test(float %0, float %1, <8 x float> %2, i8* %3) {
; CHECK-LABEL: llvm.func @exp_test
define void @exp_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.exp"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.exp(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.exp.f32(float %0)
- ; CHECK: "llvm.intr.exp"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.exp(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.exp.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @exp2_test
define void @exp2_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.exp2"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.exp2(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.exp2.f32(float %0)
- ; CHECK: "llvm.intr.exp2"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.exp2(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.exp2.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @log_test
define void @log_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.log"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.log(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.log.f32(float %0)
- ; CHECK: "llvm.intr.log"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.log(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.log.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @log10_test
define void @log10_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.log10"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.log10(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.log10.f32(float %0)
- ; CHECK: "llvm.intr.log10"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.log10(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.log10.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @log2_test
define void @log2_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.log2"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.log2(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.log2.f32(float %0)
- ; CHECK: "llvm.intr.log2"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.log2(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.log2.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @fabs_test
define void @fabs_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.fabs"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.fabs(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.fabs.f32(float %0)
- ; CHECK: "llvm.intr.fabs"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.fabs(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.fabs.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @sqrt_test
define void @sqrt_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.sqrt"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.sqrt(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.sqrt.f32(float %0)
- ; CHECK: "llvm.intr.sqrt"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.sqrt(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @ceil_test
define void @ceil_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.ceil"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.ceil(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.ceil.f32(float %0)
- ; CHECK: "llvm.intr.ceil"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.ceil(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.ceil.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @floor_test
define void @floor_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.floor"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.floor(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.floor.f32(float %0)
- ; CHECK: "llvm.intr.floor"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.floor(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.floor.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @cos_test
define void @cos_test(float %0, <8 x float> %1) {
- ; CHECK: "llvm.intr.cos"(%{{.*}}) : (f32) -> f32
+ ; CHECK: llvm.intr.cos(%{{.*}}) : (f32) -> f32
%3 = call float @llvm.cos.f32(float %0)
- ; CHECK: "llvm.intr.cos"(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.cos(%{{.*}}) : (vector<8xf32>) -> vector<8xf32>
%4 = call <8 x float> @llvm.cos.v8f32(<8 x float> %1)
ret void
}
; CHECK-LABEL: llvm.func @copysign_test
define void @copysign_test(float %0, float %1, <8 x float> %2, <8 x float> %3) {
- ; CHECK: "llvm.intr.copysign"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ ; CHECK: llvm.intr.copysign(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%5 = call float @llvm.copysign.f32(float %0, float %1)
- ; CHECK: "llvm.intr.copysign"(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.copysign(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%6 = call <8 x float> @llvm.copysign.v8f32(<8 x float> %2, <8 x float> %3)
ret void
}
; CHECK-LABEL: llvm.func @pow_test
define void @pow_test(float %0, float %1, <8 x float> %2, <8 x float> %3) {
- ; CHECK: "llvm.intr.pow"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ ; CHECK: llvm.intr.pow(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%5 = call float @llvm.pow.f32(float %0, float %1)
- ; CHECK: "llvm.intr.pow"(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.pow(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%6 = call <8 x float> @llvm.pow.v8f32(<8 x float> %2, <8 x float> %3)
ret void
}
; CHECK-LABEL: llvm.func @bitreverse_test
define void @bitreverse_test(i32 %0, <8 x i32> %1) {
- ; CHECK: "llvm.intr.bitreverse"(%{{.*}}) : (i32) -> i32
+ ; CHECK: llvm.intr.bitreverse(%{{.*}}) : (i32) -> i32
%3 = call i32 @llvm.bitreverse.i32(i32 %0)
- ; CHECK: "llvm.intr.bitreverse"(%{{.*}}) : (vector<8xi32>) -> vector<8xi32>
+ ; CHECK: llvm.intr.bitreverse(%{{.*}}) : (vector<8xi32>) -> vector<8xi32>
%4 = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %1)
ret void
}
@@ -152,81 +152,81 @@ define void @cttz_test(i32 %0, <8 x i32> %1) {
; CHECK-LABEL: llvm.func @ctpop_test
define void @ctpop_test(i32 %0, <8 x i32> %1) {
- ; CHECK: "llvm.intr.ctpop"(%{{.*}}) : (i32) -> i32
+ ; CHECK: llvm.intr.ctpop(%{{.*}}) : (i32) -> i32
%3 = call i32 @llvm.ctpop.i32(i32 %0)
- ; CHECK: "llvm.intr.ctpop"(%{{.*}}) : (vector<8xi32>) -> vector<8xi32>
+ ; CHECK: llvm.intr.ctpop(%{{.*}}) : (vector<8xi32>) -> vector<8xi32>
%4 = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %1)
ret void
}
; CHECK-LABEL: llvm.func @maximum_test
define void @maximum_test(float %0, float %1, <8 x float> %2, <8 x float> %3) {
- ; CHECK: "llvm.intr.maximum"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ ; CHECK: llvm.intr.maximum(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%5 = call float @llvm.maximum.f32(float %0, float %1)
- ; CHECK: "llvm.intr.maximum"(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.maximum(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%6 = call <8 x float> @llvm.maximum.v8f32(<8 x float> %2, <8 x float> %3)
ret void
}
; CHECK-LABEL: llvm.func @minimum_test
define void @minimum_test(float %0, float %1, <8 x float> %2, <8 x float> %3) {
- ; CHECK: "llvm.intr.minimum"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ ; CHECK: llvm.intr.minimum(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%5 = call float @llvm.minimum.f32(float %0, float %1)
- ; CHECK: "llvm.intr.minimum"(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.minimum(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%6 = call <8 x float> @llvm.minimum.v8f32(<8 x float> %2, <8 x float> %3)
ret void
}
; CHECK-LABEL: llvm.func @maxnum_test
define void @maxnum_test(float %0, float %1, <8 x float> %2, <8 x float> %3) {
- ; CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ ; CHECK: llvm.intr.maxnum(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%5 = call float @llvm.maxnum.f32(float %0, float %1)
- ; CHECK: "llvm.intr.maxnum"(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.maxnum(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%6 = call <8 x float> @llvm.maxnum.v8f32(<8 x float> %2, <8 x float> %3)
ret void
}
; CHECK-LABEL: llvm.func @minnum_test
define void @minnum_test(float %0, float %1, <8 x float> %2, <8 x float> %3) {
- ; CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
+ ; CHECK: llvm.intr.minnum(%{{.*}}, %{{.*}}) : (f32, f32) -> f32
%5 = call float @llvm.minnum.f32(float %0, float %1)
- ; CHECK: "llvm.intr.minnum"(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
+ ; CHECK: llvm.intr.minnum(%{{.*}}, %{{.*}}) : (vector<8xf32>, vector<8xf32>) -> vector<8xf32>
%6 = call <8 x float> @llvm.minnum.v8f32(<8 x float> %2, <8 x float> %3)
ret void
}
; CHECK-LABEL: llvm.func @smax_test
define void @smax_test(i32 %0, i32 %1, <8 x i32> %2, <8 x i32> %3) {
- ; CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
+ ; CHECK: llvm.intr.smax(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
%5 = call i32 @llvm.smax.i32(i32 %0, i32 %1)
- ; CHECK: "llvm.intr.smax"(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
+ ; CHECK: llvm.intr.smax(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
%6 = call <8 x i32> @llvm.smax.v8i32(<8 x i32> %2, <8 x i32> %3)
ret void
}
; CHECK-LABEL: llvm.func @smin_test
define void @smin_test(i32 %0, i32 %1, <8 x i32> %2, <8 x i32> %3) {
- ; CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
+ ; CHECK: llvm.intr.smin(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
%5 = call i32 @llvm.smin.i32(i32 %0, i32 %1)
- ; CHECK: "llvm.intr.smin"(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
+ ; CHECK: llvm.intr.smin(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
%6 = call <8 x i32> @llvm.smin.v8i32(<8 x i32> %2, <8 x i32> %3)
ret void
}
; CHECK-LABEL: llvm.func @umax_test
define void @umax_test(i32 %0, i32 %1, <8 x i32> %2, <8 x i32> %3) {
- ; CHECK: "llvm.intr.umax"(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
+ ; CHECK: llvm.intr.umax(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
%5 = call i32 @llvm.umax.i32(i32 %0, i32 %1)
- ; CHECK: "llvm.intr.umax"(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
+ ; CHECK: llvm.intr.umax(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
%6 = call <8 x i32> @llvm.umax.v8i32(<8 x i32> %2, <8 x i32> %3)
ret void
}
; CHECK-LABEL: llvm.func @umin_test
define void @umin_test(i32 %0, i32 %1, <8 x i32> %2, <8 x i32> %3) {
- ; CHECK: "llvm.intr.umin"(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
+ ; CHECK: llvm.intr.umin(%{{.*}}, %{{.*}}) : (i32, i32) -> i32
%5 = call i32 @llvm.umin.i32(i32 %0, i32 %1)
- ; CHECK: "llvm.intr.umin"(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
+ ; CHECK: llvm.intr.umin(%{{.*}}, %{{.*}}) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32>
%6 = call <8 x i32> @llvm.umin.v8i32(<8 x i32> %2, <8 x i32> %3)
ret void
}
diff --git a/mlir/test/Target/LLVMIR/llvmir.mlir b/mlir/test/Target/LLVMIR/llvmir.mlir
index bc9c287fa9a81..54eb0f5e04c2c 100644
--- a/mlir/test/Target/LLVMIR/llvmir.mlir
+++ b/mlir/test/Target/LLVMIR/llvmir.mlir
@@ -1680,6 +1680,17 @@ llvm.func @fastmathFlags(%arg0: f32) {
%14 = llvm.call @fastmathFlagsFunc(%arg0) {fastmathFlags = #llvm.fastmath<afn>} : (f32) -> (f32)
%15 = llvm.call @fastmathFlagsFunc(%arg0) {fastmathFlags = #llvm.fastmath<reassoc>} : (f32) -> (f32)
%16 = llvm.call @fastmathFlagsFunc(%arg0) {fastmathFlags = #llvm.fastmath<fast>} : (f32) -> (f32)
+
+// CHECK: call fast float @llvm.copysign.f32(float {{.*}}, float {{.*}})
+ %17 = "llvm.intr.copysign"(%arg0, %arg0) {fastmathFlags = #llvm.fastmath<fast>} : (f32, f32) -> f32
+// CHECK: call afn float @llvm.copysign.f32(float {{.*}}, float {{.*}})
+ %18 = "llvm.intr.copysign"(%arg0, %arg0) {fastmathFlags = #llvm.fastmath<afn>} : (f32, f32) -> f32
+
+// CHECK: call fast float @llvm.powi.f32.i32(float {{.*}}, i32 {{.*}})
+ %exp = llvm.mlir.constant(1 : i32) : i32
+ %19 = "llvm.intr.powi"(%arg0, %exp) {fastmathFlags = #llvm.fastmath<fast>} : (f32, i32) -> f32
+// CHECK: call afn float @llvm.powi.f32.i32(float {{.*}}, i32 {{.*}})
+ %20 = "llvm.intr.powi"(%arg0, %exp) {fastmathFlags = #llvm.fastmath<afn>} : (f32, i32) -> f32
llvm.return
}
More information about the Mlir-commits
mailing list