@@ -1205,13 +1205,13 @@ SDValue DAGCombiner::reassociateOpsCommutative(unsigned Opc, const SDLoc &DL,
1205
1205
SDValue N00 = N0.getOperand(0);
1206
1206
SDValue N01 = N0.getOperand(1);
1207
1207
1208
- if (DAG.isConstantIntBuildVectorOrConstantInt(peekThroughBitcasts( N01) )) {
1208
+ if (DAG.isConstantIntBuildVectorOrConstantInt(N01)) {
1209
1209
SDNodeFlags NewFlags;
1210
1210
if (N0.getOpcode() == ISD::ADD && N0->getFlags().hasNoUnsignedWrap() &&
1211
1211
Flags.hasNoUnsignedWrap())
1212
1212
NewFlags.setNoUnsignedWrap(true);
1213
1213
1214
- if (DAG.isConstantIntBuildVectorOrConstantInt(peekThroughBitcasts(N1) )) {
1214
+ if (DAG.isConstantIntBuildVectorOrConstantInt(N1 )) {
1215
1215
// Reassociate: (op (op x, c1), c2) -> (op x, (op c1, c2))
1216
1216
if (SDValue OpNode = DAG.FoldConstantArithmetic(Opc, DL, VT, {N01, N1}))
1217
1217
return DAG.getNode(Opc, DL, VT, N00, OpNode, NewFlags);
@@ -9931,10 +9931,10 @@ SDValue DAGCombiner::visitRotate(SDNode *N) {
9931
9931
// fold (rot* (rot* x, c2), c1)
9932
9932
// -> (rot* x, ((c1 % bitsize) +- (c2 % bitsize) + bitsize) % bitsize)
9933
9933
if (NextOp == ISD::ROTL || NextOp == ISD::ROTR) {
9934
- SDNode * C1 = DAG.isConstantIntBuildVectorOrConstantInt(N1);
9935
- SDNode * C2 = DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1));
9936
- if (C1 && C2 && C1-> getValueType(0 ) == C2-> getValueType(0 )) {
9937
- EVT ShiftVT = C1-> getValueType(0 );
9934
+ bool C1 = DAG.isConstantIntBuildVectorOrConstantInt(N1);
9935
+ bool C2 = DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1));
9936
+ if (C1 && C2 && N1. getValueType() == N0.getOperand(1). getValueType()) {
9937
+ EVT ShiftVT = N1. getValueType();
9938
9938
bool SameSide = (N->getOpcode() == NextOp);
9939
9939
unsigned CombineOp = SameSide ? ISD::ADD : ISD::SUB;
9940
9940
SDValue BitsizeC = DAG.getConstant(Bitsize, dl, ShiftVT);
@@ -16805,8 +16805,8 @@ SDValue DAGCombiner::visitVP_FADD(SDNode *N) {
16805
16805
SDValue DAGCombiner::visitFADD(SDNode *N) {
16806
16806
SDValue N0 = N->getOperand(0);
16807
16807
SDValue N1 = N->getOperand(1);
16808
- SDNode * N0CFP = DAG.isConstantFPBuildVectorOrConstantFP(N0);
16809
- SDNode * N1CFP = DAG.isConstantFPBuildVectorOrConstantFP(N1);
16808
+ bool N0CFP = DAG.isConstantFPBuildVectorOrConstantFP(N0);
16809
+ bool N1CFP = DAG.isConstantFPBuildVectorOrConstantFP(N1);
16810
16810
EVT VT = N->getValueType(0);
16811
16811
SDLoc DL(N);
16812
16812
const TargetOptions &Options = DAG.getTarget().Options;
@@ -16903,10 +16903,8 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16903
16903
// of rounding steps.
16904
16904
if (TLI.isOperationLegalOrCustom(ISD::FMUL, VT) && !N0CFP && !N1CFP) {
16905
16905
if (N0.getOpcode() == ISD::FMUL) {
16906
- SDNode *CFP00 =
16907
- DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16908
- SDNode *CFP01 =
16909
- DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(1));
16906
+ bool CFP00 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16907
+ bool CFP01 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(1));
16910
16908
16911
16909
// (fadd (fmul x, c), x) -> (fmul x, c+1)
16912
16910
if (CFP01 && !CFP00 && N0.getOperand(0) == N1) {
@@ -16926,10 +16924,8 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16926
16924
}
16927
16925
16928
16926
if (N1.getOpcode() == ISD::FMUL) {
16929
- SDNode *CFP10 =
16930
- DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16931
- SDNode *CFP11 =
16932
- DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(1));
16927
+ bool CFP10 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16928
+ bool CFP11 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(1));
16933
16929
16934
16930
// (fadd x, (fmul x, c)) -> (fmul x, c+1)
16935
16931
if (CFP11 && !CFP10 && N1.getOperand(0) == N0) {
@@ -16949,8 +16945,7 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16949
16945
}
16950
16946
16951
16947
if (N0.getOpcode() == ISD::FADD) {
16952
- SDNode *CFP00 =
16953
- DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16948
+ bool CFP00 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16954
16949
// (fadd (fadd x, x), x) -> (fmul x, 3.0)
16955
16950
if (!CFP00 && N0.getOperand(0) == N0.getOperand(1) &&
16956
16951
(N0.getOperand(0) == N1)) {
@@ -16960,8 +16955,7 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16960
16955
}
16961
16956
16962
16957
if (N1.getOpcode() == ISD::FADD) {
16963
- SDNode *CFP10 =
16964
- DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16958
+ bool CFP10 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16965
16959
// (fadd x, (fadd x, x)) -> (fmul x, 3.0)
16966
16960
if (!CFP10 && N1.getOperand(0) == N1.getOperand(1) &&
16967
16961
N1.getOperand(0) == N0) {
0 commit comments