Skip to content

Commit 2435ea6

Browse files
[RISCV][VLOPT] Add support for vfclass.v (#148246)
This PR adds support for the vfclass.v instruction in the RISC-V VLOptimizer.
1 parent a606f44 commit 2435ea6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,8 @@ static bool isSupportedInstr(const MachineInstr &MI) {
11391139
case RISCV::VMFLE_VV:
11401140
case RISCV::VMFGT_VF:
11411141
case RISCV::VMFGE_VF:
1142+
// Vector Floating-Point Classify Instruction
1143+
case RISCV::VFCLASS_V:
11421144
// Vector Floating-Point Merge Instruction
11431145
case RISCV::VFMERGE_VFM:
11441146
// Vector Floating-Point Move Instruction

llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5448,9 +5448,8 @@ define <vscale x 4 x i32> @vfclass_v(<vscale x 4 x float> %a, <vscale x 4 x i32>
54485448
;
54495449
; VLOPT-LABEL: vfclass_v:
54505450
; VLOPT: # %bb.0:
5451-
; VLOPT-NEXT: vsetvli a1, zero, e32, m2, ta, ma
5452-
; VLOPT-NEXT: vfclass.v v8, v8
54535451
; VLOPT-NEXT: vsetvli zero, a0, e32, m2, ta, ma
5452+
; VLOPT-NEXT: vfclass.v v8, v8
54545453
; VLOPT-NEXT: vadd.vv v8, v8, v10
54555454
; VLOPT-NEXT: ret
54565455
%1 = call <vscale x 4 x i32> @llvm.riscv.vfclass.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x float> %a, iXLen -1)

0 commit comments

Comments
 (0)