@@ -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);
@@ -9932,10 +9932,10 @@ SDValue DAGCombiner::visitRotate(SDNode *N) {
9932
9932
// fold (rot* (rot* x, c2), c1)
9933
9933
// -> (rot* x, ((c1 % bitsize) +- (c2 % bitsize) + bitsize) % bitsize)
9934
9934
if (NextOp == ISD::ROTL || NextOp == ISD::ROTR) {
9935
- SDNode * C1 = DAG.isConstantIntBuildVectorOrConstantInt(N1);
9936
- SDNode * C2 = DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1));
9937
- if (C1 && C2 && C1-> getValueType(0 ) == C2-> getValueType(0 )) {
9938
- EVT ShiftVT = C1-> getValueType(0 );
9935
+ bool C1 = DAG.isConstantIntBuildVectorOrConstantInt(N1);
9936
+ bool C2 = DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1));
9937
+ if (C1 && C2 && N1. getValueType() == N0.getOperand(1). getValueType()) {
9938
+ EVT ShiftVT = N1. getValueType();
9939
9939
bool SameSide = (N->getOpcode() == NextOp);
9940
9940
unsigned CombineOp = SameSide ? ISD::ADD : ISD::SUB;
9941
9941
SDValue BitsizeC = DAG.getConstant(Bitsize, dl, ShiftVT);
@@ -16807,8 +16807,8 @@ SDValue DAGCombiner::visitVP_FADD(SDNode *N) {
16807
16807
SDValue DAGCombiner::visitFADD(SDNode *N) {
16808
16808
SDValue N0 = N->getOperand(0);
16809
16809
SDValue N1 = N->getOperand(1);
16810
- SDNode * N0CFP = DAG.isConstantFPBuildVectorOrConstantFP(N0);
16811
- SDNode * N1CFP = DAG.isConstantFPBuildVectorOrConstantFP(N1);
16810
+ bool N0CFP = DAG.isConstantFPBuildVectorOrConstantFP(N0);
16811
+ bool N1CFP = DAG.isConstantFPBuildVectorOrConstantFP(N1);
16812
16812
EVT VT = N->getValueType(0);
16813
16813
SDLoc DL(N);
16814
16814
const TargetOptions &Options = DAG.getTarget().Options;
@@ -16905,10 +16905,8 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16905
16905
// of rounding steps.
16906
16906
if (TLI.isOperationLegalOrCustom(ISD::FMUL, VT) && !N0CFP && !N1CFP) {
16907
16907
if (N0.getOpcode() == ISD::FMUL) {
16908
- SDNode *CFP00 =
16909
- DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16910
- SDNode *CFP01 =
16911
- DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(1));
16908
+ bool CFP00 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16909
+ bool CFP01 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(1));
16912
16910
16913
16911
// (fadd (fmul x, c), x) -> (fmul x, c+1)
16914
16912
if (CFP01 && !CFP00 && N0.getOperand(0) == N1) {
@@ -16928,10 +16926,8 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16928
16926
}
16929
16927
16930
16928
if (N1.getOpcode() == ISD::FMUL) {
16931
- SDNode *CFP10 =
16932
- DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16933
- SDNode *CFP11 =
16934
- DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(1));
16929
+ bool CFP10 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16930
+ bool CFP11 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(1));
16935
16931
16936
16932
// (fadd x, (fmul x, c)) -> (fmul x, c+1)
16937
16933
if (CFP11 && !CFP10 && N1.getOperand(0) == N0) {
@@ -16951,8 +16947,7 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16951
16947
}
16952
16948
16953
16949
if (N0.getOpcode() == ISD::FADD) {
16954
- SDNode *CFP00 =
16955
- DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16950
+ bool CFP00 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0));
16956
16951
// (fadd (fadd x, x), x) -> (fmul x, 3.0)
16957
16952
if (!CFP00 && N0.getOperand(0) == N0.getOperand(1) &&
16958
16953
(N0.getOperand(0) == N1)) {
@@ -16962,8 +16957,7 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
16962
16957
}
16963
16958
16964
16959
if (N1.getOpcode() == ISD::FADD) {
16965
- SDNode *CFP10 =
16966
- DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16960
+ bool CFP10 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0));
16967
16961
// (fadd x, (fadd x, x)) -> (fmul x, 3.0)
16968
16962
if (!CFP10 && N1.getOperand(0) == N1.getOperand(1) &&
16969
16963
N1.getOperand(0) == N0) {
0 commit comments