[llvm] [GVN] Refactor the LeaderTable structure into a properly encapsulated data structure (PR #88347)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 00:24:52 PDT 2024


================
@@ -2228,12 +2290,11 @@ bool GVNPass::ValueTable::areCallValsEqual(uint32_t Num, uint32_t NewNum,
                                            const BasicBlock *PhiBlock,
                                            GVNPass &Gvn) {
   CallInst *Call = nullptr;
-  LeaderTableEntry *Vals = &Gvn.LeaderTable[Num];
-  while (Vals) {
-    Call = dyn_cast<CallInst>(Vals->Val);
+  auto Leaders = Gvn.LeaderTable.getLeaders(Num);
+  for (auto Entry : Leaders) {
----------------
resistor wrote:

Done

https://github.com/llvm/llvm-project/pull/88347


More information about the llvm-commits mailing list