[llvm] cc6a864 - [RISCV][VLOPT] Add support for vfrec7.v (#146918)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 4 08:35:09 PDT 2025
Author: Mikhail R. Gadelha
Date: 2025-07-04T12:35:06-03:00
New Revision: cc6a864788ff4b2687f66e4f6ddef7272e82d06d
URL: https://github.com/llvm/llvm-project/commit/cc6a864788ff4b2687f66e4f6ddef7272e82d06d
DIFF: https://github.com/llvm/llvm-project/commit/cc6a864788ff4b2687f66e4f6ddef7272e82d06d.diff
LOG: [RISCV][VLOPT] Add support for vfrec7.v (#146918)
Add support for the vfrec7.v instruction in the RISC-V VLOptimizer.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp b/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
index a406bada6b1e4..2d9f38221d424 100644
--- a/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+++ b/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
@@ -1107,6 +1107,8 @@ static bool isSupportedInstr(const MachineInstr &MI) {
case RISCV::VFSQRT_V:
// Vector Floating-Point Reciprocal Square-Root Estimate Instruction
case RISCV::VFRSQRT7_V:
+ // Vector Floating-Point Reciprocal Estimate Instruction
+ case RISCV::VFREC7_V:
// Vector Floating-Point MIN/MAX Instructions
case RISCV::VFMIN_VF:
case RISCV::VFMIN_VV:
diff --git a/llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll b/llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
index c272297b41c94..0aa0cbceefc76 100644
--- a/llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
@@ -5380,12 +5380,11 @@ define <vscale x 4 x double> @vfrec7(<vscale x 4 x float> %a) {
;
; VLOPT-LABEL: vfrec7:
; VLOPT: # %bb.0:
-; VLOPT-NEXT: vsetivli zero, 7, e32, m2, ta, ma
+; VLOPT-NEXT: vsetivli zero, 6, e32, m2, ta, ma
; VLOPT-NEXT: vmv2r.v v12, v8
; VLOPT-NEXT: fsrmi a0, 0
; VLOPT-NEXT: vfrec7.v v14, v8
; VLOPT-NEXT: fsrm a0
-; VLOPT-NEXT: vsetivli zero, 6, e32, m2, ta, ma
; VLOPT-NEXT: vfwmacc.vv v8, v12, v14
; VLOPT-NEXT: ret
%1 = call <vscale x 4 x float> @llvm.riscv.vfrec7.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> %a, iXLen 0, iXLen 7)
More information about the llvm-commits
mailing list