[llvm] [bolt][RISCV] : Adjust the operand order of AMOADD to maintain consis… (PR #171580)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 00:46:38 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: None (hunenghui)

<details>
<summary>Changes</summary>

The modification of the description of the RISCV atomic instructions missed updates to other projects that use the content of atomic instructions.#<!-- -->162411

---
Full diff: https://github.com/llvm/llvm-project/pull/171580.diff


1 Files Affected:

- (modified) bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp (+2-2) 


``````````diff
diff --git a/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp b/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
index 7c4a8781fd57d..50faa377d5ebe 100644
--- a/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
+++ b/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
@@ -548,8 +548,8 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
                  MCPhysReg RegCnt) const {
     Inst = MCInstBuilder(RISCV::AMOADD_D)
                .addReg(RegAtomic)
-               .addReg(RegTo)
-               .addReg(RegCnt);
+               .addReg(RegCnt)
+               .addReg(RegTo);
   }
 
   InstructionListType createRegCmpJE(MCPhysReg RegNo, MCPhysReg RegTmp,

``````````

</details>


https://github.com/llvm/llvm-project/pull/171580


More information about the llvm-commits mailing list