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

David Green via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 2 13:01:45 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));
----------------
davemgreen wrote:

Will do - I managed to get the const references working.

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


More information about the llvm-commits mailing list