[llvm] [AArch64][GlobalISel] Add disjoint handling for add_and_or_is_add. (PR #123594)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 02:38:56 PST 2025


================
@@ -1025,9 +1025,9 @@ def add_and_or_is_add : PatFrags<(ops node:$lhs, node:$rhs),
    return CurDAG->isADDLike(SDValue(N,0));
 }]> {
   let GISelPredicateCode = [{
-     // Only handle G_ADD for now. FIXME. build capability to compute whether
-     // operands of G_OR have common bits set or not.
-     return MI.getOpcode() == TargetOpcode::G_ADD;
+     return MI.getOpcode() == TargetOpcode::G_ADD ||
+            (MI.getOpcode() == TargetOpcode::G_OR &&
+             MI.getFlag(MachineInstr::MIFlag::Disjoint));
----------------
RKSimon wrote:

Worth adding a MIPatternMatch::m_GAddLike ?

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


More information about the llvm-commits mailing list