@@ -1086,10 +1086,9 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
1086
1086
// (load/store (add/sub (add x, y), vscale))
1087
1087
// (load/store (add/sub (add x, y), (lsl vscale, C)))
1088
1088
// (load/store (add/sub (add x, y), (mul vscale, C)))
1089
- if ((N1.getOpcode() == ISD::VSCALE ||
1090
- ((N1.getOpcode() == ISD::SHL || N1.getOpcode() == ISD::MUL) &&
1091
- N1.getOperand(0).getOpcode() == ISD::VSCALE &&
1092
- isa<ConstantSDNode>(N1.getOperand(1)))) &&
1089
+ if (sd_match(N1, m_AnyOf(m_VScale(m_Value()),
1090
+ m_Shl(m_VScale(m_Value()), m_ConstInt()),
1091
+ m_Mul(m_VScale(m_Value()), m_ConstInt()))) &&
1093
1092
N1.getValueType().getFixedSizeInBits() <= 64) {
1094
1093
int64_t ScalableOffset = N1.getOpcode() == ISD::VSCALE
1095
1094
? N1.getConstantOperandVal(0)
@@ -2975,8 +2974,7 @@ SDValue DAGCombiner::visitADD(SDNode *N) {
2975
2974
}
2976
2975
2977
2976
// fold a+vscale(c1)+vscale(c2) -> a+vscale(c1+c2)
2978
- if (N0.getOpcode() == ISD::ADD &&
2979
- N0.getOperand(1).getOpcode() == ISD::VSCALE &&
2977
+ if (sd_match(N0, m_Add(m_Value(), m_VScale(m_Value()))) &&
2980
2978
N1.getOpcode() == ISD::VSCALE) {
2981
2979
const APInt &VS0 = N0.getOperand(1)->getConstantOperandAPInt(0);
2982
2980
const APInt &VS1 = N1->getConstantOperandAPInt(0);
0 commit comments