Skip to content

Commit 43de4e0

Browse files
authored
[RISCV] Rename hasVInstructionsBF16 to hasVInstructionsBF16Minimal. NFC (#101080)
This makes it more consistent with Zvfhmin since it is not a complete bf16 implementation.
1 parent ad80265 commit 43de4e0

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static bool isLegalElementTypeForRVV(Type *EltTy,
329329
if (EltTy->isHalfTy())
330330
return Subtarget.hasVInstructionsF16();
331331
if (EltTy->isBFloatTy())
332-
return Subtarget.hasVInstructionsBF16();
332+
return Subtarget.hasVInstructionsBF16Minimal();
333333
if (EltTy->isFloatTy())
334334
return Subtarget.hasVInstructionsF32();
335335
if (EltTy->isDoubleTy())

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ def HasVInstructionsF16Minimal : Predicate<"Subtarget->hasVInstructionsF16Minima
870870
"'Zvfhmin' (Vector Half-Precision Floating-Point Minimal) or "
871871
"'Zvfh' (Vector Half-Precision Floating-Point)">;
872872

873-
def HasVInstructionsBF16 : Predicate<"Subtarget->hasVInstructionsBF16()">;
873+
def HasVInstructionsBF16Minimal : Predicate<"Subtarget->hasVInstructionsBF16Minimal()">;
874874
def HasVInstructionsF16 : Predicate<"Subtarget->hasVInstructionsF16()">;
875875
def HasVInstructionsF64 : Predicate<"Subtarget->hasVInstructionsF64()">;
876876

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
198198
for (MVT VT : F16VecVTs)
199199
addRegClassForRVV(VT);
200200

201-
if (Subtarget.hasVInstructionsBF16())
201+
if (Subtarget.hasVInstructionsBF16Minimal())
202202
for (MVT VT : BF16VecVTs)
203203
addRegClassForRVV(VT);
204204

@@ -1092,7 +1092,7 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
10921092
}
10931093

10941094
// TODO: Could we merge some code with zvfhmin?
1095-
if (Subtarget.hasVInstructionsBF16()) {
1095+
if (Subtarget.hasVInstructionsBF16Minimal()) {
10961096
for (MVT VT : BF16VecVTs) {
10971097
if (!isTypeLegal(VT))
10981098
continue;
@@ -2638,7 +2638,7 @@ static bool useRVVForFixedLengthVectorVT(MVT VT,
26382638
return false;
26392639
break;
26402640
case MVT::bf16:
2641-
if (!Subtarget.hasVInstructionsBF16())
2641+
if (!Subtarget.hasVInstructionsBF16Minimal())
26422642
return false;
26432643
break;
26442644
case MVT::f32:
@@ -6841,7 +6841,8 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
68416841
Subtarget.hasStdExtZfhminOrZhinxmin() &&
68426842
!Subtarget.hasVInstructionsF16())) ||
68436843
(Op.getValueType().getScalarType() == MVT::bf16 &&
6844-
(Subtarget.hasVInstructionsBF16() && Subtarget.hasStdExtZfbfmin()))) {
6844+
(Subtarget.hasVInstructionsBF16Minimal() &&
6845+
Subtarget.hasStdExtZfbfmin()))) {
68456846
if (Op.getValueType() == MVT::nxv32f16 ||
68466847
Op.getValueType() == MVT::nxv32bf16)
68476848
return SplitVectorOp(Op, DAG);

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ class VPseudo<Instruction instr, LMULInfo m, dag outs, dag ins, int sew = 0> :
751751

752752
class GetVTypePredicates<VTypeInfo vti> {
753753
list<Predicate> Predicates = !cond(!eq(vti.Scalar, f16) : [HasVInstructionsF16],
754-
!eq(vti.Scalar, bf16) : [HasVInstructionsBF16],
754+
!eq(vti.Scalar, bf16) : [HasVInstructionsBF16Minimal],
755755
!eq(vti.Scalar, f32) : [HasVInstructionsAnyF],
756756
!eq(vti.Scalar, f64) : [HasVInstructionsF64],
757757
!eq(vti.SEW, 64) : [HasVInstructionsI64],

llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ foreach fvtiToFWti = AllWidenableFloatVectors in {
14301430
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
14311431
defvar fvti = fvtiToFWti.Vti;
14321432
defvar fwti = fvtiToFWti.Wti;
1433-
let Predicates = [HasVInstructionsBF16] in
1433+
let Predicates = [HasVInstructionsBF16Minimal] in
14341434
def : Pat<(fvti.Vector (fpround (fwti.Vector fwti.RegClass:$rs1))),
14351435
(!cast<Instruction>("PseudoVFNCVTBF16_F_F_W_"#fvti.LMul.MX#"_E"#fvti.SEW)
14361436
(fvti.Vector (IMPLICIT_DEF)),

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,7 +2673,7 @@ foreach fvtiToFWti = AllWidenableFloatVectors in {
26732673
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
26742674
defvar fvti = fvtiToFWti.Vti;
26752675
defvar fwti = fvtiToFWti.Wti;
2676-
let Predicates = [HasVInstructionsBF16] in
2676+
let Predicates = [HasVInstructionsBF16Minimal] in
26772677
def : Pat<(fwti.Vector (any_riscv_fpextend_vl
26782678
(fvti.Vector fvti.RegClass:$rs1),
26792679
(fvti.Mask V0),
@@ -2731,7 +2731,7 @@ foreach fvtiToFWti = AllWidenableFloatVectors in {
27312731
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
27322732
defvar fvti = fvtiToFWti.Vti;
27332733
defvar fwti = fvtiToFWti.Wti;
2734-
let Predicates = [HasVInstructionsBF16] in
2734+
let Predicates = [HasVInstructionsBF16Minimal] in
27352735
def : Pat<(fvti.Vector (any_riscv_fpround_vl
27362736
(fwti.Vector fwti.RegClass:$rs1),
27372737
(fwti.Mask V0), VLOpFrag)),

llvm/lib/Target/RISCV/RISCVSubtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
225225
bool hasVInstructionsI64() const { return HasStdExtZve64x; }
226226
bool hasVInstructionsF16Minimal() const { return HasStdExtZvfhmin; }
227227
bool hasVInstructionsF16() const { return HasStdExtZvfh; }
228-
bool hasVInstructionsBF16() const { return HasStdExtZvfbfmin; }
228+
bool hasVInstructionsBF16Minimal() const { return HasStdExtZvfbfmin; }
229229
bool hasVInstructionsF32() const { return HasStdExtZve32f; }
230230
bool hasVInstructionsF64() const { return HasStdExtZve64d; }
231231
// F16 and F64 both require F32.

0 commit comments

Comments
 (0)