Index: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp =================================================================== --- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1505,8 +1505,8 @@ static void makeStatepointExplicit(DominatorTree &DT, const CallSite &CS, PartiallyConstructedSafepointRecord &Result) { - auto LiveSet = Result.LiveSet; - auto PointerToBase = Result.PointerToBase; + const auto &LiveSet = Result.LiveSet; + const auto &PointerToBase = Result.PointerToBase; // Convert to vector for efficient cross referencing. SmallVector BaseVec, LiveVec; @@ -1515,7 +1515,7 @@ for (Value *L : LiveSet) { LiveVec.push_back(L); assert(PointerToBase.count(L)); - Value *Base = PointerToBase[L]; + Value *Base = PointerToBase.find(L)->second; BaseVec.push_back(Base); } assert(LiveVec.size() == BaseVec.size());