Skip to content

Commit 588c0c2

Browse files
committed
[RISCV] Specify FilterClassField to filter out unneeded pseudos
`VMCLR` and `VMSET` will be expanded before MC emitting, so we don't need them being in RISCVVPseudosTable.
1 parent 455bf3d commit 588c0c2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,17 @@ class RISCVVPseudo {
527527
Instruction BaseInstr = !cast<Instruction>(PseudoToVInst<NAME>.VInst);
528528
// SEW = 0 is used to denote that the Pseudo is not SEW specific (or unknown).
529529
bits<8> SEW = 0;
530+
bit IsNeeded = !cond(
531+
!ne(!find(NAME, "PseudoVMCLR"), -1): 0,
532+
!ne(!find(NAME, "PseudoVMSET"), -1): 0,
533+
true: 1
534+
);
530535
}
531536

532537
// The actual table.
533538
def RISCVVPseudosTable : GenericTable {
534539
let FilterClass = "RISCVVPseudo";
540+
let FilterClassField = "IsNeeded";
535541
let CppTypeName = "PseudoInfo";
536542
let Fields = [ "Pseudo", "BaseInstr" ];
537543
let PrimaryKey = [ "Pseudo" ];

0 commit comments

Comments
 (0)