@@ -24291,8 +24291,8 @@ static SDValue combineConcatVectorOfScalars(SDNode *N, SelectionDAG &DAG) {
2429124291 EVT SVT = EVT::getIntegerVT(*DAG.getContext(), OpVT.getSizeInBits());
2429224292
2429324293 // Keep track of what we encounter.
24294- bool AnyInteger = false ;
24295- bool AnyFP = false;
24294+ EVT AnyFPVT ;
24295+
2429624296 for (const SDValue &Op : N->ops()) {
2429724297 if (ISD::BITCAST == Op.getOpcode() &&
2429824298 !Op.getOperand(0).getValueType().isVector())
@@ -24306,27 +24306,23 @@ static SDValue combineConcatVectorOfScalars(SDNode *N, SelectionDAG &DAG) {
2430624306 // If it's neither, bail out, it could be something weird like x86mmx.
2430724307 EVT LastOpVT = Ops.back().getValueType();
2430824308 if (LastOpVT.isFloatingPoint())
24309- AnyFP = true;
24310- else if (LastOpVT.isInteger())
24311- AnyInteger = true;
24312- else
24309+ AnyFPVT = LastOpVT;
24310+ else if (!LastOpVT.isInteger())
2431324311 return SDValue();
2431424312 }
2431524313
2431624314 // If any of the operands is a floating point scalar bitcast to a vector,
2431724315 // use floating point types throughout, and bitcast everything.
2431824316 // Replace UNDEFs by another scalar UNDEF node, of the final desired type.
24319- if (AnyFP) {
24320- SVT = EVT::getFloatingPointVT(OpVT.getSizeInBits());
24321- if (AnyInteger) {
24322- for (SDValue &Op : Ops) {
24323- if (Op.getValueType() == SVT)
24324- continue;
24325- if (Op.isUndef())
24326- Op = DAG.getNode(ISD::UNDEF, DL, SVT);
24327- else
24328- Op = DAG.getBitcast(SVT, Op);
24329- }
24317+ if (AnyFPVT != EVT()) {
24318+ SVT = AnyFPVT;
24319+ for (SDValue &Op : Ops) {
24320+ if (Op.getValueType() == SVT)
24321+ continue;
24322+ if (Op.isUndef())
24323+ Op = DAG.getNode(ISD::UNDEF, DL, SVT);
24324+ else
24325+ Op = DAG.getBitcast(SVT, Op);
2433024326 }
2433124327 }
2433224328
0 commit comments