[llvm] [RISCV] Fix size of PseudoMERGE (PR #218171)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 22 17:09:33 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Sam Elliott (lenary)
<details>
<summary>Changes</summary>
This can expand to two 4-byte instructions, so mark it as size 8. Usually it will expand to just one 4-byte instruction.
This was found in #<!-- -->218170.
---
Full diff: https://github.com/llvm/llvm-project/pull/218171.diff
1 Files Affected:
- (modified) llvm/lib/Target/RISCV/RISCVInstrInfoP.td (+1)
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoP.td b/llvm/lib/Target/RISCV/RISCVInstrInfoP.td
index ac893d83cf3ac..a68a589c0f964 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoP.td
@@ -2062,6 +2062,7 @@ let Predicates = [HasStdExtP] in {
// Pseudo version of MERGE without the tied constraint. Will be expanded to
// MERGE, MVM, or MVMN after register allocation.
// dst = (~rd & rs1) | (rd & rs2)
+ let Size = 8 in
def PseudoMERGE : Pseudo<(outs GPR:$dst), (ins GPR:$rd, GPR:$rs1, GPR:$rs2),
[]>;
def : Pat<(XLenVT (or (and GPR:$rd, GPR:$rs2), (and (not GPR:$rd), GPR:$rs1))),
``````````
</details>
https://github.com/llvm/llvm-project/pull/218171
More information about the llvm-commits
mailing list