You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This helps avoiding diagnostics for instructions that could never be
selected and is required for RISC-V CHERI support.
An example here are the CHERI mode-dependent instructions where we have
loads/stores that are identical other than the register class for the
base register and have predicates that can never both be set. To avoid
nonsensical error messages, we should only use the candidate
instructions with the currently available feature bits.
For RVY (CHERI), loads and stores are mode-dependent, using either a
YLEN register or a XLEN register as the base. Prior to the
standardization process CHERI assembly used c-prefixed register names
for capabilities, so we had the following syntax for RISC-V compatible
mode and CHERI pure-capability mode:
lw x4, 0(c3) # capability mode: use new `CLW` tablegen instruction
lw x4, 0(x3) # integer mode: use existing `LW` tablegen instruction
During the standardization this was changed to keep the same register
name in both modes, so now we have `lw x4, 0(x3)` in both modes but we
have to select between two instructions: one using the normal GPR
register class and one using the YGPR register class.
We now have a choice between two instructions `LW` and `LW_Y` that have
predicates that can never both be true, so we should avoid reporting
missing predicates or wrong operands for the "unreachable" instruction.
This change was taken from Morello LLVM with a few minor comment
clarifications and changes to naming of variables.
Co-authored-by: Silviu Baranga <[email protected]>
0 commit comments