This makes it possible for D153234 to use the FPR16 register class
for bf16 instructions.
isel patterns updated to have explicit f16 types due to type inference being disabled now.
Paths
| Differential D155418
[RISCV] Add bf16 as a valid type for the FPR16 register class. ClosedPublic Authored by craig.topper on Jul 16 2023, 10:20 PM.
Details Summary This makes it possible for D153234 to use the FPR16 register class isel patterns updated to have explicit f16 types due to type inference being disabled now.
Diff Detail
Event TimelineComment Actions
Because they use the same classes in tablegen and I had to add a ValueType parameter to them. Comment Actions
I suppose that will be hard to maintain. Can we custom codegen classes for f16/bf16 in tablegen? Comment Actions
Can you explain why it will be hard to maintain? The complexity of supporting Zfinx/Zdinx/Zhinx and all the special patterns for Zfhmin already seems way worse than passing an extra Valuetype to some classes. Comment Actions
I see. It seems that passing Valuetype to some codegen classes is the most effective way to address this issue if you want to use the same register class for different types. What we need to do now is to confirm that reusing FPR16 for bf16 is actually better than adding a new register class. Comment Actions
AArch64 also takes the approach of using a single register class for fp16 and bf16. Maybe there's some discussion around that decision we can find? Comment Actions
LGTM. This revision is now accepted and ready to land.Jul 17 2023, 6:10 AM This revision was landed with ongoing or failed builds.Jul 17 2023, 8:31 AM Closed by commit rGd71329773d9a: [RISCV] Add bf16 as a valid type for the FPR16 register class. (authored by craig.topper). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 541056 llvm/lib/Target/RISCV/RISCVInstrInfoD.td
llvm/lib/Target/RISCV/RISCVInstrInfoF.td
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
llvm/lib/Target/RISCV/RISCVRegisterInfo.td
|