[llvm] [AArch64] Allow splitting bitmasks for EOR/ORR. (PR #150394)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 05:04:04 PDT 2025


================
@@ -125,8 +125,14 @@ struct AArch64MIPeepholeOpt : public MachineFunctionPass {
   template <typename T>
   bool visitADDSSUBS(OpcodePair PosOpcs, OpcodePair NegOpcs, MachineInstr &MI);
 
+  // Strategy used to split logical immediate bitmasks.
+  enum class SplitStrategy {
+    Intersect,
+    Disjoint,
+  };
   template <typename T>
-  bool visitAND(unsigned Opc, MachineInstr &MI, unsigned OtherOpc = 0);
+  bool trySplitLogicalImm(unsigned Opc, MachineInstr &MI,
+                          SplitStrategy Strategy, unsigned OtherOpc = 0);
----------------
paulwalker-arm wrote:

Personally I don't mind the refactoring. If the other reviewers think likewise then do you mind pulling the refactoring into its own NFC patch? Just add an assert or something for the `SplitStrategy::Disjoint` case, ready for this PR to populate.

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


More information about the llvm-commits mailing list