[llvm] [AArch64] Lower disjoint_or+not to eon. (PR #147279)

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 05:49:35 PDT 2025


================
@@ -30,3 +30,24 @@ entry:
   %shl2 = shl i64 %xor, %xor1
   ret i64 %shl2
 }
+
+; Check that eon is generated if the xor is a disjoint or.
+define i64 @disjoint_or(i64 %a, i64 %b) {
+; CHECK-LABEL: disjoint_or:
+; CHECK: eon
+; CHECK: ret
+  %or = or disjoint i64 %a, %b
----------------
rj-jesus wrote:

As it stands it should only apply to scalar operands. AFAIU there's no native EON equivalent for vector types (SVE does have a version of EON, but it's an alias of EOR (immediate)). For more complex bit select patterns, like NBSL and such, we should be emitting the corresponding dedicated instruction with SVE2 (#138689 and #146906).

Having said that, I think we could emulate a vector EON with BSL2N (https://godbolt.org/z/G3f31ac11), which I'm happy to add some patterns for (probably in a separate PR?) - what do you think?

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


More information about the llvm-commits mailing list