[llvm] [SelectionDAG] Improve isOrEquivalentToAdd (PR #82767)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 06:16:37 PST 2024


================
@@ -4214,7 +4214,7 @@ bool SelectionDAGISel::isOrEquivalentToAdd(const SDNode *N) const {
     // the alignment, then this or is really an add.
     return (Off >= 0) && (((A.value() - 1) & Off) == unsigned(Off));
   }
-  return false;
+  return CurDAG->haveNoCommonBitsSet(N->getOperand(0), N->getOperand(1));
----------------
jayfoad wrote:

Would it work to test `N->getNode().getFlags().hasDisjoint()` instead?

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


More information about the llvm-commits mailing list