mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Fix PR18572 - llc crash during GenericScheduler::initPolicy().
Generalized the heuristic that looks at the (very rough) size of the register file before enabling regpressure tracking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199766 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2531,10 +2531,16 @@ void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin,
|
||||
// Avoid setting up the register pressure tracker for small regions to save
|
||||
// compile time. As a rough heuristic, only track pressure when the number of
|
||||
// schedulable instructions exceeds half the integer register file.
|
||||
unsigned NIntRegs = Context->RegClassInfo->getNumAllocatableRegs(
|
||||
TM.getTargetLowering()->getRegClassFor(MVT::i32));
|
||||
|
||||
RegionPolicy.ShouldTrackPressure = NumRegionInstrs > (NIntRegs / 2);
|
||||
RegionPolicy.ShouldTrackPressure = true;
|
||||
unsigned LegalIntVT = MVT::i32;
|
||||
for (; LegalIntVT > (unsigned)MVT::i1; --LegalIntVT) {
|
||||
if (TM.getTargetLowering()->isTypeLegal((MVT::SimpleValueType)LegalIntVT)) {
|
||||
unsigned NIntRegs = Context->RegClassInfo->getNumAllocatableRegs(
|
||||
TM.getTargetLowering()->getRegClassFor(
|
||||
(MVT::SimpleValueType)LegalIntVT));
|
||||
RegionPolicy.ShouldTrackPressure = NumRegionInstrs > (NIntRegs / 2);
|
||||
}
|
||||
}
|
||||
|
||||
// For generic targets, we default to bottom-up, because it's simpler and more
|
||||
// compile-time optimizations have been implemented in that direction.
|
||||
|
||||
Reference in New Issue
Block a user