[PATCH] D101525: RegAlloc: do not consider liveins to EH-pad successors as liveout.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 6 11:03:33 PDT 2021
efriedma added inline comments.
================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1455
+ LI.PhysReg == TLI->getExceptionSelectorRegister(PersonalityFn)))
+ continue;
setPhysRegState(LI.PhysReg, regPreAssigned);
----------------
t.p.northover wrote:
> efriedma wrote:
> > Calling getExceptionPointerRegister() directly from fast regalloc seems hacky. We don't want to copy-paste this code everywhere that cares about physical register live-outs.
> I could add a `MachineBasicBlock::liveouts` that does the iteration. Simplest would probably be to return a `SmallSet` because of the potential issue with duplicates, but that doesn't quite fit with the liveins iterator-based interface. Otherwise it's probably an iterator adapter containing that `SmallSet`.
Probably most places that would use this can handle duplicates, so it would be fine to just implement an iterator over the raw list including duplicates.
I spent a bit of time trying to come up with some way to represent this that's a bit cleaner, but I didn't really have any good ideas. Maybe we could partition the "liveins" list in MachineBasicBlock to distinguish between registers that are live-out from a predecessor, and ones that are set by the unwinder? The advantages would just be that we don't have to query TLI, and MIR dumps would be a bit easier to understand.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101525/new/
https://reviews.llvm.org/D101525
More information about the llvm-commits
mailing list