diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 38b7984d13606..0593c671826e2 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -3296,12 +3296,12 @@ static void computeLiveInValues(DominatorTree &DT, Function &F, assert(!Data.LiveSet[&BB].count(Kill) && "live set contains kill"); #endif - Data.LiveOut[&BB] = SetVector(); - computeLiveOutSeed(&BB, Data.LiveOut[&BB], GC); - Data.LiveIn[&BB] = Data.LiveSet[&BB]; - Data.LiveIn[&BB].set_union(Data.LiveOut[&BB]); - Data.LiveIn[&BB].set_subtract(Data.KillSet[&BB]); - if (!Data.LiveIn[&BB].empty()) + auto &Out = Data.LiveOut[&BB] = SetVector(); + computeLiveOutSeed(&BB, Out, GC); + auto &In = Data.LiveIn[&BB] = Data.LiveSet[&BB]; + In.set_union(Out); + In.set_subtract(Data.KillSet[&BB]); + if (!In.empty()) Worklist.insert_range(predecessors(&BB)); }