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

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 11:00:33 PDT 2025


================
@@ -190,19 +191,48 @@ static bool splitBitmaskImm(T Imm, unsigned RegSize, T &Imm1Enc, T &Imm2Enc) {
   return true;
 }
 
+template <typename T>
+static bool splitDisjointBitmaskImm(T Imm, unsigned RegSize, T &Imm1Enc,
+                                    T &Imm2Enc) {
+  // Try to split a bitmask of the form 0b00000000011000000000011110000000 into
+  // two disjoint masks such as 0b00000000011000000000000000000000 and
+  // 0b00000000000000000000011110000000 where the inclusive/exclusive OR of the
+  // new masks match the original mask.
+  unsigned LowestBitSet = llvm::countr_zero(Imm);
----------------
rj-jesus wrote:

Should be done now (alongside the other changes).

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


More information about the llvm-commits mailing list