Skip to content

Commit

Permalink
[NFC][RISCV] Replace global def containing only one field with defvar
Browse files Browse the repository at this point in the history
This simplifies some code.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D150935
  • Loading branch information
pcwang-thead committed May 22, 2023
1 parent 2849e11 commit 5ba10ad
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/RISCV/RISCVRegisterInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,7 @@ defvar vbool32_t = nxv2i1;
defvar vbool64_t = nxv1i1;

// There is no need to define register classes for fractional LMUL.
def LMULList {
list<int> m = [1, 2, 4, 8];
}
defvar LMULList = [1, 2, 4, 8];

//===----------------------------------------------------------------------===//
// Utility classes for segment load/store.
Expand Down Expand Up @@ -576,7 +574,7 @@ def VM : VReg<VMaskVTs,
(add (sequence "V%u", 8, 31),
(sequence "V%u", 0, 7)), 1>;

foreach m = LMULList.m in {
foreach m = LMULList in {
foreach nf = NFList<m>.L in {
def "VRN" # nf # "M" # m # "NoV0": VReg<[untyped],
(add !cast<RegisterTuples>("VN" # nf # "M" # m # "NoV0")),
Expand Down

0 comments on commit 5ba10ad

Please sign in to comment.