diff options
| author | 2017-01-24 08:32:59 +0000 | |
|---|---|---|
| committer | 2017-01-24 08:32:59 +0000 | |
| commit | 53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch) | |
| tree | 7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/lib/CodeGen/DFAPacketizer.cpp | |
| parent | In preparation of compiling our kernels with -ffreestanding, explicitly map (diff) | |
| download | wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip | |
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/lib/CodeGen/DFAPacketizer.cpp')
| -rw-r--r-- | gnu/llvm/lib/CodeGen/DFAPacketizer.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gnu/llvm/lib/CodeGen/DFAPacketizer.cpp b/gnu/llvm/lib/CodeGen/DFAPacketizer.cpp index 2386af9e687..7b1b2d64fcc 100644 --- a/gnu/llvm/lib/CodeGen/DFAPacketizer.cpp +++ b/gnu/llvm/lib/CodeGen/DFAPacketizer.cpp @@ -31,9 +31,14 @@ #include "llvm/CodeGen/ScheduleDAGInstrs.h" #include "llvm/MC/MCInstrItineraries.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +static cl::opt<unsigned> InstrLimit("dfa-instr-limit", cl::Hidden, + cl::init(0), cl::desc("If present, stops packetizing after N instructions")); +static unsigned InstrCount = 0; + // -------------------------------------------------------------------- // Definitions shared between DFAPacketizer.cpp and DFAPacketizerEmitter.cpp @@ -218,6 +223,13 @@ VLIWPacketizerList::~VLIWPacketizerList() { // End the current packet, bundle packet instructions and reset DFA state. void VLIWPacketizerList::endPacket(MachineBasicBlock *MBB, MachineBasicBlock::iterator MI) { + DEBUG({ + if (!CurrentPacketMIs.empty()) { + dbgs() << "Finalizing packet:\n"; + for (MachineInstr *MI : CurrentPacketMIs) + dbgs() << " * " << *MI; + } + }); if (CurrentPacketMIs.size() > 1) { MachineInstr &MIFirst = *CurrentPacketMIs.front(); finalizeBundle(*MBB, MIFirst.getIterator(), MI.getInstrIterator()); @@ -249,8 +261,17 @@ void VLIWPacketizerList::PacketizeMIs(MachineBasicBlock *MBB, for (SUnit &SU : VLIWScheduler->SUnits) MIToSUnit[SU.getInstr()] = &SU; + bool LimitPresent = InstrLimit.getPosition(); + // The main packetizer loop. for (; BeginItr != EndItr; ++BeginItr) { + if (LimitPresent) { + if (InstrCount >= InstrLimit) { + EndItr = BeginItr; + break; + } + InstrCount++; + } MachineInstr &MI = *BeginItr; initPacketizerState(); |
