[llvm] [ARM] Fix MRC cp10 and cp11 warning (PR #126407)

Stefan Agner via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 01:02:14 PST 2025


================
@@ -77,8 +77,8 @@ static bool getMCRDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI,
 static bool getMRCDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI,
                                   std::string &Info) {
   if (STI.hasFeature(llvm::ARM::HasV7Ops) &&
-      ((MI.getOperand(0).isImm() && MI.getOperand(0).getImm() == 10) ||
-       (MI.getOperand(0).isImm() && MI.getOperand(0).getImm() == 11))) {
+      ((MI.getOperand(1).isImm() && MI.getOperand(1).getImm() == 10) ||
+       (MI.getOperand(1).isImm() && MI.getOperand(1).getImm() == 11))) {
----------------
agners wrote:

Are you sure this is right?
```
        mcr p10, #2, r5, c1, c1, #4
        mcrr p11, #8, r5, r4, c1
```

This relates to p10/p11 here, which is the first operand (0). The check above uses operand 0 too.




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


More information about the llvm-commits mailing list