[llvm] Base with add like constant offset (PR #88493)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 18:44:49 PDT 2024


================
@@ -5191,15 +5191,8 @@ bool SelectionDAG::isADDLike(SDValue Op) const {
 }
 
 bool SelectionDAG::isBaseWithConstantOffset(SDValue Op) const {
-  if ((Op.getOpcode() != ISD::ADD && Op.getOpcode() != ISD::OR) ||
-      !isa<ConstantSDNode>(Op.getOperand(1)))
-    return false;
-
-  if (Op.getOpcode() == ISD::OR &&
-      !MaskedValueIsZero(Op.getOperand(0), Op.getConstantOperandAPInt(1)))
-    return false;
-
-  return true;
+  return (Op.getOpcode() == ISD::ADD || isADDLike(Op)) &&
----------------
fengfeng09 wrote:

Sure.

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


More information about the llvm-commits mailing list