def LLVM_vector_reduce_fmax : LLVM_VecReductionF<"fmax">;
def LLVM_vector_reduce_fmin : LLVM_VecReductionF<"fmin">;
+def LLVM_vector_reduce_fmaximum : LLVM_VecReductionF<"fmaximum">;
+def LLVM_vector_reduce_fminimum : LLVM_VecReductionF<"fminimum">;
def LLVM_vector_reduce_fadd : LLVM_VecReductionAccF<"fadd">;
def LLVM_vector_reduce_fmul : LLVM_VecReductionAccF<"fmul">;
%13 = llvm.intr.vector.reduce.fmin(%arg3) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
// CHECK: {{.*}} = llvm.intr.vector.reduce.fmax(%arg3) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
%14 = llvm.intr.vector.reduce.fmax(%arg3) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+// CHECK: {{.*}} = llvm.intr.vector.reduce.fminimum(%arg3) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+ %15 = llvm.intr.vector.reduce.fminimum(%arg3) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+// CHECK: {{.*}} = llvm.intr.vector.reduce.fmaximum(%arg3) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+ %16 = llvm.intr.vector.reduce.fmaximum(%arg3) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
return
}
llvm.call @printNewline() : () -> ()
// CHECK: 1
+ %maximum = llvm.intr.vector.reduce.fmaximum(%v)
+ : (vector<4xf32>) -> f32
+ llvm.call @printF32(%maximum) : (f32) -> ()
+ llvm.call @printNewline() : () -> ()
+ // CHECK: 4
+
+ %minimum = llvm.intr.vector.reduce.fminimum(%v)
+ : (vector<4xf32>) -> f32
+ llvm.call @printF32(%minimum) : (f32) -> ()
+ llvm.call @printNewline() : () -> ()
+ // CHECK: 1
+
%add1 = "llvm.intr.vector.reduce.fadd"(%0, %v)
: (f32, vector<4xf32>) -> f32
llvm.call @printF32(%add1) : (f32) -> ()
declare float @llvm.fmuladd.f32(float, float, float)
declare float @llvm.vector.reduce.fmin.v2f32(<2 x float>)
declare float @llvm.vector.reduce.fmax.v2f32(<2 x float>)
+declare float @llvm.vector.reduce.fminimum.v2f32(<2 x float>)
+declare float @llvm.vector.reduce.fmaximum.v2f32(<2 x float>)
; CHECK-LABEL: @fastmath_intr
define void @fastmath_intr(float %arg1, i32 %arg2, <2 x float> %arg3) {
%5 = call nnan float @llvm.vector.reduce.fmin.v2f32(<2 x float> %arg3)
; CHECK: %{{.*}} = llvm.intr.vector.reduce.fmax({{.*}}) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
%6 = call nnan float @llvm.vector.reduce.fmax.v2f32(<2 x float> %arg3)
+ ; CHECK: %{{.*}} = llvm.intr.vector.reduce.fminimum({{.*}}) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+ %7 = call nnan float @llvm.vector.reduce.fminimum.v2f32(<2 x float> %arg3)
+ ; CHECK: %{{.*}} = llvm.intr.vector.reduce.fmaximum({{.*}}) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+ %8 = call nnan float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> %arg3)
ret void
}
%17 = call reassoc float @llvm.vector.reduce.fmul.v8f32(float %0, <8 x float> %1)
; CHECK: "llvm.intr.vector.reduce.xor"(%{{.*}}) : (vector<8xi32>) -> i32
%18 = call i32 @llvm.vector.reduce.xor.v8i32(<8 x i32> %2)
+ ; CHECK: llvm.intr.vector.reduce.fmaximum(%{{.*}}) : (vector<8xf32>) -> f32
+ %19 = call float @llvm.vector.reduce.fmaximum.v8f32(<8 x float> %1)
+ ; CHECK: llvm.intr.vector.reduce.fminimum(%{{.*}}) : (vector<8xf32>) -> f32
+ %20 = call float @llvm.vector.reduce.fminimum.v8f32(<8 x float> %1)
ret void
}
declare i32 @llvm.vector.reduce.and.v8i32(<8 x i32>)
declare float @llvm.vector.reduce.fmax.v8f32(<8 x float>)
declare float @llvm.vector.reduce.fmin.v8f32(<8 x float>)
+declare float @llvm.vector.reduce.fmaximum.v8f32(<8 x float>)
+declare float @llvm.vector.reduce.fminimum.v8f32(<8 x float>)
declare i32 @llvm.vector.reduce.mul.v8i32(<8 x i32>)
declare i32 @llvm.vector.reduce.or.v8i32(<8 x i32>)
declare i32 @llvm.vector.reduce.smax.v8i32(<8 x i32>)
llvm.intr.vector.reduce.fmax(%arg1) : (vector<8xf32>) -> f32
// CHECK: call float @llvm.vector.reduce.fmin.v8f32
llvm.intr.vector.reduce.fmin(%arg1) : (vector<8xf32>) -> f32
+ // CHECK: call float @llvm.vector.reduce.fmaximum.v8f32
+ llvm.intr.vector.reduce.fmaximum(%arg1) : (vector<8xf32>) -> f32
+ // CHECK: call float @llvm.vector.reduce.fminimum.v8f32
+ llvm.intr.vector.reduce.fminimum(%arg1) : (vector<8xf32>) -> f32
// CHECK: call i32 @llvm.vector.reduce.mul.v8i32
"llvm.intr.vector.reduce.mul"(%arg2) : (vector<8xi32>) -> i32
// CHECK: call i32 @llvm.vector.reduce.or.v8i32
%21 = llvm.intr.vector.reduce.fmax(%arg1) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
%22 = llvm.intr.vector.reduce.fmin(%arg1) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+// CHECK: call nnan float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> {{.*}})
+// CHECK: call nnan float @llvm.vector.reduce.fminimum.v2f32(<2 x float> {{.*}})
+ %23 = llvm.intr.vector.reduce.fmaximum(%arg1) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
+ %24 = llvm.intr.vector.reduce.fminimum(%arg1) {fastmathFlags = #llvm.fastmath<nnan>} : (vector<2xf32>) -> f32
- %23 = llvm.mlir.constant(true) : i1
+ %25 = llvm.mlir.constant(true) : i1
// CHECK: select contract i1
- %24 = llvm.select %23, %arg0, %20 {fastmathFlags = #llvm.fastmath<contract>} : i1, f32
+ %26 = llvm.select %25, %arg0, %20 {fastmathFlags = #llvm.fastmath<contract>} : i1, f32
llvm.return
}