Skip to content

Commit 9f0b58c

Browse files
committed
[NFC] Remove shouldCoalesce from aie base since we want to keep aie2 results stable
1 parent 8571452 commit 9f0b58c

File tree

3 files changed

+133
-181
lines changed

3 files changed

+133
-181
lines changed

llvm/lib/Target/AIE/AIEBaseRegisterInfo.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,11 @@
1919
#include "llvm/CodeGen/LiveIntervals.h"
2020

2121
using namespace llvm;
22-
extern cl::opt<bool> EnableCoalescingForWideCopy;
2322

2423
bool AIEBaseRegisterInfo::shouldCoalesce(
2524
MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg,
2625
const TargetRegisterClass *DstRC, unsigned DstSubReg,
2726
const TargetRegisterClass *NewRC, LiveIntervals &LIS) const {
28-
MachineBasicBlock *MBB = MI->getParent();
29-
if (EnableCoalescingForWideCopy || AIELoopUtils::isSingleMBBLoop(MBB)) {
30-
return TargetRegisterInfo::shouldCoalesce(MI, SrcRC, SubReg, DstRC,
31-
DstSubReg, NewRC, LIS);
32-
}
33-
const unsigned SrcSize = getRegSizeInBits(*SrcRC);
34-
const unsigned DstSize = getRegSizeInBits(*DstRC);
35-
MachineFunction *MF = MI->getMF();
36-
const AIEBaseInstrInfo *TII =
37-
static_cast<const AIEBaseInstrInfo *>(MF->getSubtarget().getInstrInfo());
38-
const unsigned BasicVectorSize = TII->getBasicVecRegSize();
39-
// Should not coalesce if copying from bigger source.
40-
if (SrcSize < DstSize &&
41-
(SrcSize >= BasicVectorSize || DstSize >= BasicVectorSize)) {
42-
LiveInterval &LI = LIS.getInterval(MI->getOperand(1).getReg());
43-
const MachineInstr *FirstMI =
44-
LI.empty() ? nullptr : LIS.getInstructionFromIndex(LI.beginIndex());
45-
const MachineInstr *LastMI =
46-
LI.empty() ? nullptr : LIS.getInstructionFromIndex(LI.endIndex());
47-
// Coalescing inside the same basic block found beneficial. So, check that
48-
// the LiveInterval is not just local to MBB.
49-
if (!FirstMI || FirstMI->getParent() != MBB || !LastMI ||
50-
LastMI->getParent() != MBB)
51-
return false;
52-
}
53-
5427
return TargetRegisterInfo::shouldCoalesce(MI, SrcRC, SubReg, DstRC, DstSubReg,
5528
NewRC, LIS);
5629
}

0 commit comments

Comments
 (0)