Skip to content

Commit 31ba25e

Browse files
authored
[RISCV] Remove unnecessary patterns for tail agnostic FP intrinsics with rounding mode. (#94498)
These are patterns that explicitly check for undef. Similar patterns do not exist without rounding mode. The vsetvli insertion pass should be able to detect that the passthru is undef. The test changes seem to be a deficiency in identifying passthru being undef in the vsetvli inserter for -O0.
1 parent 59e9160 commit 31ba25e

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4153,27 +4153,6 @@ class VPatBinaryNoMaskTU<string intrinsic_name,
41534153
(op2_type op2_kind:$rs2),
41544154
GPR:$vl, sew, TU_MU)>;
41554155

4156-
class VPatBinaryNoMaskRoundingMode<string intrinsic_name,
4157-
string inst,
4158-
ValueType result_type,
4159-
ValueType op1_type,
4160-
ValueType op2_type,
4161-
int sew,
4162-
VReg op1_reg_class,
4163-
DAGOperand op2_kind> :
4164-
Pat<(result_type (!cast<Intrinsic>(intrinsic_name)
4165-
(result_type (undef)),
4166-
(op1_type op1_reg_class:$rs1),
4167-
(op2_type op2_kind:$rs2),
4168-
(XLenVT timm:$round),
4169-
VLOpFrag)),
4170-
(!cast<Instruction>(inst)
4171-
(result_type (IMPLICIT_DEF)),
4172-
(op1_type op1_reg_class:$rs1),
4173-
(op2_type op2_kind:$rs2),
4174-
(XLenVT timm:$round),
4175-
GPR:$vl, sew, TA_MA)>;
4176-
41774156
class VPatBinaryNoMaskTURoundingMode<string intrinsic_name,
41784157
string inst,
41794158
ValueType result_type,
@@ -4827,8 +4806,6 @@ multiclass VPatBinaryRoundingMode<string intrinsic,
48274806
VReg result_reg_class,
48284807
VReg op1_reg_class,
48294808
DAGOperand op2_kind> {
4830-
def : VPatBinaryNoMaskRoundingMode<intrinsic, inst, result_type, op1_type, op2_type,
4831-
sew, op1_reg_class, op2_kind>;
48324809
def : VPatBinaryNoMaskTURoundingMode<intrinsic, inst, result_type, op1_type, op2_type,
48334810
sew, result_reg_class, op1_reg_class, op2_kind>;
48344811
def : VPatBinaryMaskTARoundingMode<intrinsic, inst, result_type, op1_type, op2_type,

llvm/test/CodeGen/RISCV/rvv/rv32-spill-vector-csr.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ define <vscale x 1 x double> @foo(<vscale x 1 x double> %a, <vscale x 1 x double
2222
; SPILL-O0-NEXT: addi a1, a1, 16
2323
; SPILL-O0-NEXT: vs1r.v v9, (a1) # Unknown-size Folded Spill
2424
; SPILL-O0-NEXT: # implicit-def: $v8
25-
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, ta, ma
25+
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, tu, ma
2626
; SPILL-O0-NEXT: vfadd.vv v8, v9, v10
2727
; SPILL-O0-NEXT: addi a0, sp, 16
2828
; SPILL-O0-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
@@ -38,7 +38,7 @@ define <vscale x 1 x double> @foo(<vscale x 1 x double> %a, <vscale x 1 x double
3838
; SPILL-O0-NEXT: # kill: def $x11 killed $x10
3939
; SPILL-O0-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
4040
; SPILL-O0-NEXT: # implicit-def: $v8
41-
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, ta, ma
41+
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, tu, ma
4242
; SPILL-O0-NEXT: vfadd.vv v8, v9, v10
4343
; SPILL-O0-NEXT: csrr a0, vlenb
4444
; SPILL-O0-NEXT: slli a0, a0, 1

llvm/test/CodeGen/RISCV/rvv/rv64-spill-vector-csr.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ define <vscale x 1 x double> @foo(<vscale x 1 x double> %a, <vscale x 1 x double
2525
; SPILL-O0-NEXT: addi a1, a1, 32
2626
; SPILL-O0-NEXT: vs1r.v v9, (a1) # Unknown-size Folded Spill
2727
; SPILL-O0-NEXT: # implicit-def: $v8
28-
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, ta, ma
28+
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, tu, ma
2929
; SPILL-O0-NEXT: vfadd.vv v8, v9, v10
3030
; SPILL-O0-NEXT: addi a0, sp, 32
3131
; SPILL-O0-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
@@ -41,7 +41,7 @@ define <vscale x 1 x double> @foo(<vscale x 1 x double> %a, <vscale x 1 x double
4141
; SPILL-O0-NEXT: # kill: def $x11 killed $x10
4242
; SPILL-O0-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
4343
; SPILL-O0-NEXT: # implicit-def: $v8
44-
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, ta, ma
44+
; SPILL-O0-NEXT: vsetvli zero, a0, e64, m1, tu, ma
4545
; SPILL-O0-NEXT: vfadd.vv v8, v9, v10
4646
; SPILL-O0-NEXT: csrr a0, vlenb
4747
; SPILL-O0-NEXT: slli a0, a0, 1

0 commit comments

Comments
 (0)