[llvm] [RISCV] Use bits<1> for AltFmt in RISCVVPseudo. (PR #182581)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 20 11:46:38 PST 2026
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/182581
This makes the searchable table emitter use uint8_t instead of bool in the KeyType struct. This is needed to allow us to use a bitfield in the PseudoInfo struct and avoid a compare between a bool and uint16_t. We already use this same bits<1> trick in other searchable tables.
>From 9dfa650fd7fdfe0afc59bc6874c16615760a2134 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Fri, 20 Feb 2026 11:44:03 -0800
Subject: [PATCH] [RISCV] Use bits<1> for AltFmt in RISCVVPseudo.
This makes the searchable table emitter use uint8_t instead of
bool in the KeyType struct. This is needed to allow us to use a
bitfield in the PseudoInfo struct and avoid a compare between a
bool and uint16_t. We already use this same bits<1> trick in other
searchable tables.
---
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
index c4f666fc3affe..8ac431bf810b6 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
@@ -564,7 +564,7 @@ class RISCVVPseudo<dag outs, dag ins, list<dag> pattern = [],
Instruction BaseInstr = !cast<Instruction>(PseudoToVInst<NAME>.VInst);
// SEW = 0 is used to denote that the Pseudo is not SEW specific (or unknown).
bits<8> SEW = 0;
- bit IsAltFmt = !eq(AltFmtType.Value, IS_ALTFMT.Value);
+ bits<1> IsAltFmt = !eq(AltFmtType.Value, IS_ALTFMT.Value);
bit IncludeInInversePseudoTable = 1;
let UseNamedOperandTable = true;
More information about the llvm-commits
mailing list