diff --git a/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp b/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp index dd005682203b7..f653269713b30 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp @@ -297,12 +297,12 @@ void UnrollState::unrollRecipeByUF(VPRecipeBase &R) { if (auto *Red = dyn_cast(&R)) { auto *Phi = cast(R.getOperand(0)); if (Phi->isOrdered()) { - auto Ins = VPV2Parts.insert({Phi, {}}); + auto &Parts = VPV2Parts[Phi]; if (Part == 1) { - Ins.first->second.clear(); - Ins.first->second.push_back(Red); + Parts.clear(); + Parts.push_back(Red); } - Ins.first->second.push_back(Copy->getVPSingleValue()); + Parts.push_back(Copy->getVPSingleValue()); Phi->setOperand(1, Copy->getVPSingleValue()); } }