================
@@ -1303,29 +1315,14 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock
*Succ,
SlotIndex PrevIndex = StartIndex.getPrevSlot();
SlotIndex EndIndex = Indexes->getMBBEndIdx(NMBB);
- // Find the registers used from NMBB in PHIs in Succ.
- SmallSet<Register, 8> PHISrcRegs;
- for (MachineBasicBlock::instr_iterator
- I = Succ->instr_begin(), E = Succ->instr_end();
- I != E && I->isPHI(); ++I) {
- for (unsigned ni = 1, ne = I->getNumOperands(); ni != ne; ni += 2) {
- if (I->getOperand(ni+1).getMBB() == NMBB) {
- MachineOperand &MO = I->getOperand(ni);
- Register Reg = MO.getReg();
- if (MO.isUndef())
- continue;
- PHISrcRegs.insert(Reg);
-
- LiveInterval &LI = LIS->getInterval(Reg);
- VNInfo *VNI = LI.getVNInfoAt(PrevIndex);
- assert(VNI &&
- "PHI sources should be live out of their predecessors.");
- LI.addSegment(LiveInterval::Segment(StartIndex, EndIndex, VNI));
- for (auto &SR : LI.subranges()) {
- if (VNInfo *SRVNI = SR.getVNInfoAt(PrevIndex))
- SR.addSegment(LiveInterval::Segment(StartIndex, EndIndex,
SRVNI));
- }
- }
+ for (Register Reg : PHISrcRegs) {
----------------
nikic wrote:
Does the order the registers are processed here matter, or will addSegment()
produce the same result regardless of order?
https://github.com/llvm/llvm-project/pull/230500
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits