diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-25 02:38:56 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-25 02:38:56 +0800 |
| commit | c3932f55208e3fe2019d26a0e5af421c0b644872 (patch) | |
| tree | ba4fee68834007bd8cd1ce0f209d8c1deb5dd530 /backend/lib/CodeGen/MachineOperand.cpp | |
| parent | 71988f9818677df0d90b19d4bb770ac8a6116e62 (diff) | |
| download | rcc-project-c3932f55208e3fe2019d26a0e5af421c0b644872.tar.gz rcc-project-c3932f55208e3fe2019d26a0e5af421c0b644872.tar.xz | |
[RISCV] Implement make-compressible pass
Diffstat (limited to 'backend/lib/CodeGen/MachineOperand.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MachineOperand.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/MachineOperand.cpp b/backend/lib/CodeGen/MachineOperand.cpp index f265c3f..3994286 100644 --- a/backend/lib/CodeGen/MachineOperand.cpp +++ b/backend/lib/CodeGen/MachineOperand.cpp @@ -300,6 +300,11 @@ Expected<void> MachineOperand::setRegister(Register Reg) { return makeUnexpected(ErrorCode::InvalidArgument, "setRegister requires a register operand"); } + if (std::get<Register>(Storage) == Reg) + return {}; + + RegFlags.clear(RegisterOperandFlag::Renamable); + MachineRegisterInfo *RegInfo = LinkedRegInfo; if (RegInfo == nullptr && Parent != nullptr) RegInfo = &Parent->function().registerInfo(); |
