[llvm] [NFC] Refactor looping over recomputeLiveIns into function (PR #88040)

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 13:57:06 PDT 2024


redstar wrote:

My understanding is that the live-ins computation for the basic blocks is independent
of each other. If this is correct, then the loop could be formulated as follows, which avoids
unnecessary calls.

```
static inline void
fullyRecomputeLiveIns(ArrayRef<MachineBasicBlock *> MBBs) {
  for (MachineBasicBlock *MBB : MBBs)
    while (recomputeLiveIns(*MBB))
      /* intentionally empty/* ;
}
```

Also, is the function `recomputeLiveIns` in the current form needed? I see no callers to it, so both functions could be integrated into one.

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


More information about the llvm-commits mailing list