[all-commits] [llvm/llvm-project] bd8578: [LoongArch] Prevent R0/R1 allocation for rj operan...
hev via All-commits
all-commits at lists.llvm.org
Thu May 22 03:49:49 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bd8578c3574d77bc1231f047bced4a0053a1b000
https://github.com/llvm/llvm-project/commit/bd8578c3574d77bc1231f047bced4a0053a1b000
Author: hev <wangrui at loongson.cn>
Date: 2025-05-22 (Thu, 22 May 2025)
Changed paths:
M llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp
M llvm/lib/Target/LoongArch/Disassembler/LoongArchDisassembler.cpp
M llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
M llvm/lib/Target/LoongArch/LoongArchLVZInstrInfo.td
M llvm/lib/Target/LoongArch/LoongArchRegisterInfo.td
A llvm/test/CodeGen/LoongArch/csrxchg-intrinsic.ll
Log Message:
-----------
[LoongArch] Prevent R0/R1 allocation for rj operand of [G]CSRXCHG (#140862)
The `[G]CSRXCHG` instruction must not use R0 or R1 as the `rj` operand,
as encoding `rj` as 0 or 1 will be interpreted as `[G]CSRRD` OR
`[G]CSRWR`, respectively, rather than `[G]CSRXCHG`.
This patch introduces a new register class `GPRNoR0R1` and updates the
`[G]CSRXCHG` instruction definition to use it for the `rj` operand,
ensuring the register allocator avoids assigning R0 or R1.
Fixes #140842
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list