[llvm] [CodeGen] Add MO_LaneMask type and a new COPY_LANEMASK instruction (PR #151944)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 02:29:04 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/include/llvm/CodeGen/MIR2Vec.h llvm/include/llvm/CodeGen/MachineInstr.h llvm/include/llvm/CodeGen/MachineInstrBuilder.h llvm/include/llvm/CodeGen/MachineOperand.h llvm/include/llvm/MC/LaneBitmask.h llvm/lib/CodeGen/MIRParser/MILexer.cpp llvm/lib/CodeGen/MIRParser/MILexer.h llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/lib/CodeGen/MIRPrinter.cpp llvm/lib/CodeGen/MIRVRegNamerUtils.cpp llvm/lib/CodeGen/MachineOperand.cpp llvm/lib/CodeGen/MachineStableHash.cpp llvm/lib/CodeGen/MachineVerifier.cpp llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp llvm/unittests/CodeGen/MachineOperandTest.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/CodeGen/MachineOperand.h b/llvm/include/llvm/CodeGen/MachineOperand.h
index dd8928813..d85da5a49 100644
--- a/llvm/include/llvm/CodeGen/MachineOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineOperand.h
@@ -69,8 +69,8 @@ public:
     MO_IntrinsicID,       ///< Intrinsic ID for ISel
     MO_Predicate,         ///< Generic predicate for ISel
     MO_ShuffleMask,       ///< Other IR Constant for ISel (shuffle masks)
-    MO_DbgInstrRef,       ///< Integer indices referring to an instruction+operand
-    MO_LaneMask,          ///< Mask to represent active parts of registers
+    MO_DbgInstrRef, ///< Integer indices referring to an instruction+operand
+    MO_LaneMask,    ///< Mask to represent active parts of registers
     MO_Last = MO_LaneMask
   };
 
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index 956a4ea4d..9adcb1b8a 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -2463,7 +2463,8 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) {
     // don't exists in the source register.
     if (SrcMaxLaneMask < LaneMask)
       report("COPY_LANEMASK attempts to read from the lanes that "
-             "don't exist in the source register", MI);
+             "don't exist in the source register",
+             MI);
 
     break;
   }

``````````

</details>


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


More information about the llvm-commits mailing list