Skip to content

[RISCV] Improve error for using x18-x27 in a register list with RVE. #133936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Apr 1, 2025

matchRegisterNameHelper returns MCRegister() for RVE so the first RVE check was dead.

For the second check, I've moved the RVE check from the comma parsing to the identifier parsing so the diagnostic points at the register. Note we're using matchRegisterName instead of matchRegisterNameHelper to avoid allowing ABI names so we don't get the RVE check that lives inside matchRegisterNameHelper.

The errors for RVE in general should probably say something other than "invalid register", but that's a problem throughout the assembler.

matchRegisterNameHelper returns MCRegister() for RVE so the first
RVE check was dead.

For the second check, I've moved the RVE check from the comma parsing
to the identifier parsing so the diagnostic points at the register.
Note we're using matchRegisterName instead of matchRegisterNameHelper
to avoid allowing ABI names so we don't get the RVE check that lives
inside matchRegisterNameHelper.

The errors for RVE in general should probably say something other
than "invalid register", but that's a problem throughout the assembler.
@topperc topperc requested a review from lenary April 1, 2025 16:41
@topperc topperc merged commit bd7585b into llvm:main Apr 1, 2025
12 checks passed
@topperc topperc deleted the pr/rve-reglist branch April 1, 2025 18:14
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request Apr 2, 2025
…lvm#133936)

matchRegisterNameHelper returns MCRegister() for RVE so the first RVE
check was dead.

For the second check, I've moved the RVE check from the comma parsing to
the identifier parsing so the diagnostic points at the register. Note
we're using matchRegisterName instead of matchRegisterNameHelper to
avoid allowing ABI names so we don't get the RVE check that lives inside
matchRegisterNameHelper.

The errors for RVE in general should probably say something other than
"invalid register", but that's a problem throughout the assembler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants