Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp =================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -8023,8 +8023,7 @@ /// Vector extends are not folded if operations are legal; this is to /// avoid introducing illegal build_vector dag nodes. static SDValue tryToFoldExtendOfConstant(SDNode *N, const TargetLowering &TLI, - SelectionDAG &DAG, bool LegalTypes, - bool LegalOperations) { + SelectionDAG &DAG, bool LegalTypes) { unsigned Opcode = N->getOpcode(); SDValue N0 = N->getOperand(0); EVT VT = N->getValueType(0); @@ -8044,8 +8043,7 @@ // fold (zext (build_vector AllConstants) -> (build_vector AllConstants) // fold (aext (build_vector AllConstants) -> (build_vector AllConstants) EVT SVT = VT.getScalarType(); - if (!(VT.isVector() && - (!LegalTypes || (!LegalOperations && TLI.isTypeLegal(SVT))) && + if (!(VT.isVector() && (!LegalTypes || TLI.isTypeLegal(SVT)) && ISD::isBuildVectorOfConstantSDNodes(N0.getNode()))) return SDValue(); @@ -8479,8 +8477,7 @@ EVT VT = N->getValueType(0); SDLoc DL(N); - if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes, - LegalOperations)) + if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes)) return Res; // fold (sext (sext x)) -> (sext x) @@ -8718,8 +8715,7 @@ SDValue N0 = N->getOperand(0); EVT VT = N->getValueType(0); - if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes, - LegalOperations)) + if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes)) return Res; // fold (zext (zext x)) -> (zext x) @@ -8968,8 +8964,7 @@ SDValue N0 = N->getOperand(0); EVT VT = N->getValueType(0); - if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes, - LegalOperations)) + if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes)) return Res; // fold (aext (aext x)) -> (aext x) @@ -9495,8 +9490,7 @@ if (N0.isUndef()) return DAG.getUNDEF(VT); - if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes, - LegalOperations)) + if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes)) return Res; return SDValue(); @@ -9509,8 +9503,7 @@ if (N0.isUndef()) return DAG.getUNDEF(VT); - if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes, - LegalOperations)) + if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes)) return Res; return SDValue();