@@ -9590,15 +9590,15 @@ bool isValidMtVsrBmi(APInt &BitMask, BuildVectorSDNode &BVN) {
95909590
95919591 unsigned EltWidth = VT.getScalarSizeInBits();
95929592
9593- for (unsigned J = 0; J < NumOps; ++J) {
9594- SDValue OpVal = BVN.getOperand(J);
9595- unsigned BitPos = J * EltWidth;
9593+ unsigned BitPos = 0;
9594+ for (auto OpVal : BVN.op_values()) {
95969595 auto *CN = dyn_cast<ConstantSDNode>(OpVal);
95979596
95989597 if (!CN)
95999598 return false;
96009599
96019600 ConstValue.insertBits(CN->getAPIntValue().zextOrTrunc(EltWidth), BitPos);
9601+ BitPos += EltWidth;
96029602 }
96039603
96049604 for (unsigned J = 0; J < 16; ++J) {
@@ -9630,7 +9630,8 @@ SDValue PPCTargetLowering::LowerBUILD_VECTOR(SDValue Op,
96309630 // The xxlxor instruction sets a vector with all zeros.
96319631 if (isValidMtVsrBmi(BitMask, *BVN) && BitMask != 0 && BitMask != 0xffff) {
96329632 SDValue SDConstant = DAG.getTargetConstant(BitMask, dl, MVT::i32);
9633- MachineSDNode* MSDNode = DAG.getMachineNode(PPC::MTVSRBMI, dl,MVT::v16i8, SDConstant);
9633+ MachineSDNode *MSDNode =
9634+ DAG.getMachineNode(PPC::MTVSRBMI, dl, MVT::v16i8, SDConstant);
96349635 SDValue SDV = SDValue(MSDNode, 0);
96359636 EVT DVT = BVN->getValueType(0);
96369637 EVT SVT = SDV.getValueType();
0 commit comments