From 2cfb243bcd6aeab77dc80455bc8f2061128bd11b Mon Sep 17 00:00:00 2001 From: David Green Date: Mon, 9 May 2022 14:13:03 +0100 Subject: [PATCH] [DAG] Use isAnyConstantBuildVector. NFC As suggested from 02f8519502447de, this uses the isAnyConstantBuildVector method in lieu of separate isBuildVectorOfConstantSDNodes calls. It should otherwise be an NFC. --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index d76e77a7fe13..5102c1b3c37a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -13686,8 +13686,7 @@ SDValue DAGCombiner::visitBITCAST(SDNode *N) { if (Op.getOpcode() == ISD::BITCAST && Op.getOperand(0).getValueType() == VT) return SDValue(Op.getOperand(0)); - if (Op.isUndef() || ISD::isBuildVectorOfConstantSDNodes(Op.getNode()) || - ISD::isBuildVectorOfConstantFPSDNodes(Op.getNode())) + if (Op.isUndef() || isAnyConstantBuildVector(Op)) return DAG.getBitcast(VT, Op); return SDValue(); }; @@ -22043,11 +22042,8 @@ static SDValue combineShuffleOfBitcast(ShuffleVectorSDNode *SVN, (!Op1.isUndef() && (Op1.getOpcode() != ISD::BITCAST || Op1.getOperand(0).getValueType() != InVT))) return SDValue(); - if ((ISD::isBuildVectorOfConstantSDNodes(Op0.getOperand(0).getNode()) || - ISD::isBuildVectorOfConstantFPSDNodes(Op0.getOperand(0).getNode())) && - (Op1.isUndef() || - ISD::isBuildVectorOfConstantSDNodes(Op1.getOperand(0).getNode()) || - ISD::isBuildVectorOfConstantFPSDNodes(Op1.getOperand(0).getNode()))) + if (isAnyConstantBuildVector(Op0.getOperand(0)) && + (Op1.isUndef() || isAnyConstantBuildVector(Op1.getOperand(0)))) return SDValue(); int VTLanes = VT.getVectorNumElements();