@@ -87,15 +87,16 @@ void LiveRegUnits::accumulate(const MachineInstr &MI) {
8787
8888// / Add live-in registers of basic block \p MBB to \p LiveUnits.
8989static void addBlockLiveIns (LiveRegUnits &LiveUnits,
90- const MachineBasicBlock &MBB,
91- MCPhysReg ExceptionPointer = {},
92- MCPhysReg ExceptionSelector = {}) {
93- for (const auto &LI : MBB.liveins ()) {
94- if (MBB.isEHPad () &&
95- (LI.PhysReg == ExceptionPointer || LI.PhysReg == ExceptionSelector))
96- continue ;
90+ const MachineBasicBlock &MBB) {
91+ for (const auto &LI : MBB.liveins ())
92+ LiveUnits.addRegMasked (LI.PhysReg , LI.LaneMask );
93+ }
94+
95+ // / Add live-out registers of basic block \p MBB to \p LiveUnits.
96+ static void addBlockLiveOuts (LiveRegUnits &LiveUnits,
97+ const MachineBasicBlock &MBB) {
98+ for (const auto &LI : MBB.liveouts ())
9799 LiveUnits.addRegMasked (LI.PhysReg , LI.LaneMask );
98- }
99100}
100101
101102// / Adds all callee saved registers to \p LiveUnits.
@@ -142,25 +143,10 @@ void LiveRegUnits::addPristines(const MachineFunction &MF) {
142143 addUnits (Pristine.getBitVector ());
143144}
144145
145- void LiveRegUnits::addLiveOuts (const MachineBasicBlock &MBB,
146- const TargetLowering *TLI) {
146+ void LiveRegUnits::addLiveOuts (const MachineBasicBlock &MBB) {
147147 const MachineFunction &MF = *MBB.getParent ();
148-
149148 addPristines (MF);
150-
151- MCPhysReg ExceptionPointer;
152- MCPhysReg ExceptionSelector;
153-
154- // Remove live-ins from successors that are defined by the runtime.
155- if (TLI && MF.getFunction ().hasPersonalityFn ()) {
156- auto PersonalityFn = MF.getFunction ().getPersonalityFn ();
157- ExceptionPointer = TLI->getExceptionPointerRegister (PersonalityFn);
158- ExceptionSelector = TLI->getExceptionSelectorRegister (PersonalityFn);
159- }
160-
161- // To get the live-outs we simply merge the live-ins of all successors.
162- for (const MachineBasicBlock *Succ : MBB.successors ())
163- addBlockLiveIns (*this , *Succ, ExceptionPointer, ExceptionSelector);
149+ addBlockLiveOuts (*this , MBB);
164150
165151 // For the return block: Add all callee saved registers.
166152 if (MBB.isReturnBlock ()) {
0 commit comments