Browse files

asm, llvm, doc: Get rid of remnants from multi-cycle NOPs.

  • Loading branch information...
1 parent 036442b commit 8cd192a992469ccd03403575c3f1efbdb3fe08a7 @jeuneS2 committed Mar 25, 2013
View
2 doc/isa.tex
@@ -62,7 +62,7 @@ \subsection{Bundle Formats}
\noindent
\begin{bytefield}{8}
\bitheader{0,4,8}\\
-\BitBox{4}{\texttt{\scriptsize 0000}} & \BitBox{4}{N} \\
+\BitBox{4}{\texttt{\scriptsize 0000}} & \BitBox{4}{} \\
\end{bytefield}
\noindent
View
82 hw/bootrom/bootrom.s
@@ -42,29 +42,29 @@ _main_start:
;;
#0: stm.s r12, r15, 1
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: ldga _readint -> r0
;;
#0: add r0, r10 -> r10
;;
#0: jop call r10
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: jop call r10
;;
#0: or r0, 0 -> r11
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: or r0, 0 -> r10
;;
@@ -123,7 +123,7 @@ _main_start:
;;
#0: stmb.a r2, r14, 0
;;
- nop 0
+ nop
;;
.BB0_5: ; in Loop: Header=BB0_2 Depth=1
#0: ldm.b r14, -3
@@ -147,11 +147,11 @@ _main_start:
;;
#0: jop call r1
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: ldga _printint -> r0
;;
@@ -161,31 +161,31 @@ _main_start:
;;
#0: or r13, 0 -> r0
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: jop call r10
;;
#0: ldm.b r14, -3
;;
#0: or r31, 0 -> r0
;;
- nop 0
+ nop
;;
#0: jop call r10
;;
#0: or r12, 0 -> r0
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: br .BB0_9
;;
#0: ldi 0 -> r10
;;
- nop 0
+ nop
;;
.BB0_7:
#0: ldiu 0 -> r1
@@ -202,19 +202,19 @@ _main_start:
;;
#0: jop call r1
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: jop call r10
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: or r0, 0 -> r10
;;
@@ -233,11 +233,11 @@ _main_start:
;;
#0: jop call r1
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: ldga _printint -> r0
;;
@@ -247,9 +247,9 @@ _main_start:
;;
#0: or r10, 0 -> r0
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
.BB0_9: ; =>This Inner Loop Header: Depth=1
#0: ldi -120 -> r0
@@ -277,11 +277,11 @@ _main_start:
;;
#0: jop call r0
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
#0: br @ .BB0_8
;;
@@ -331,16 +331,16 @@ _printstr_start:
;;
#0: or r1, 0 -> r0
;;
- nop 0
+ nop
;;
.BB1_3: ; %._crit_edge
#0: jop ret
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
.align 4
_printstr_end:
@@ -389,11 +389,11 @@ _readint_start:
.BB2_3:
#0: jop ret
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
.align 4
_readint_end:
@@ -454,11 +454,11 @@ _printint_start:
.BB3_4:
#0: jop ret
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
.align 4
_printint_end:
View
12 hw/bootrom/sim_bootrom.s
@@ -3,11 +3,11 @@ bootrom:
bootrom_start:
#0: callg 0
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
exit:
#0: ldi -4 -> r0.30
@@ -16,11 +16,11 @@ exit:
;;
#0: or r31, 0 -> r0.30
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
.align 4
bootrom_end:
View
14 tools/asm/crt0.s
@@ -18,7 +18,7 @@ __crt0:
;;
#0: stm.a r15, r0.16, 0
;;
- nop 0
+ nop
;;
__crt0_return:
#0: ldm.s r15, 0
@@ -31,11 +31,11 @@ __crt0_return:
;;
#0: jop ret
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
.align 4
__crt0_end:
@@ -56,11 +56,11 @@ __crt0_exit:
;;
#0: jop ret
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
- nop 0
+ nop
;;
.align 4
__crt0_exit_end:
View
4 tools/asm/parser.y
@@ -184,13 +184,13 @@ Directive : ALIGN NUM NewLine
}
;
-Bundle : NOP Constant NewLine BSep
+Bundle : NOP NewLine BSep
{
pos += 1;
$$.type = 0;
$$.size = 1;
- $$.raw = $2;
+ $$.raw = NULL_EXPR;
}
| Operation BSep
{
View
4 tools/libc/src/libgloss/lemberg/intr.s
@@ -25,7 +25,7 @@ define void @intr_mnml() nounwind naked noinline {
;;
#0: addi 8 -> r15
;;
- nop 0
+ nop
;;
",""()
unreachable
@@ -655,7 +655,7 @@ define void @intr() nounwind naked noinline {
;;
#0: addi 76 -> r15
;;
- nop 0
+ nop
;;
",""()
unreachable
View
13 tools/llvm/lib/Target/Lemberg/LembergDelaySlotFiller.cpp
@@ -342,11 +342,6 @@ void Filler::fillDelaySlot(MachineBasicBlock::iterator &II, MachineBasicBlock &M
}
}
}
- // do not move across multi-cycle nops
- if (J->getOpcode() == Lemberg::NOP
- && J->getOperand(0).getImm() != 0) {
- conflicts = true;
- }
// $rb and $ro must be saved before calls
if (Opcode == Lemberg::CALLga || Opcode == Lemberg::CALL) {
if (J->getOpcode() == Lemberg::MOVExa
@@ -451,8 +446,6 @@ void Filler::fillDelaySlot(MachineBasicBlock::iterator &II, MachineBasicBlock &M
}
MachineInstr *N = next(newII);
if (N->getOpcode() == Lemberg::NOP) {
- assert(N->getOperand(0).getImm() == 0
- && "Cannot share cycle with multicycle NOP");
N->eraseFromParent();
}
@@ -487,7 +480,7 @@ void Filler::fillDelaySlot(MachineBasicBlock::iterator &II, MachineBasicBlock &M
if (movedSlots < maxSlots) {
for (unsigned i = 0; i < maxSlots-movedSlots; i++) {
BuildMI(MBB, insertII, DebugLoc(), TII->get(Lemberg::SEP));
- BuildMI(MBB, insertII, DebugLoc(), TII->get(Lemberg::NOP)).addImm(0);
+ BuildMI(MBB, insertII, DebugLoc(), TII->get(Lemberg::NOP));
FilledSlots++;
}
}
@@ -520,15 +513,13 @@ void Filler::fillDelaySlot(MachineBasicBlock::iterator &II, MachineBasicBlock &M
}
for (unsigned i = minSlots; i < maxSlots; i++) {
BuildMI(MBB, insertII, DebugLoc(), TII->get(Lemberg::SEP));
- BuildMI(MBB, insertII, DebugLoc(), TII->get(Lemberg::NOP)).addImm(0);
+ BuildMI(MBB, insertII, DebugLoc(), TII->get(Lemberg::NOP));
FilledSlots++;
}
}
}
/// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
-/// Currently, we fill delay slots with NOPs. We assume there are three
-/// delay slots per delayed instruction.
bool Filler::
runOnMachineBasicBlock(MachineBasicBlock &MBB)
{
View
2 tools/llvm/lib/Target/Lemberg/LembergInstrInfo.td
@@ -1404,4 +1404,4 @@ let isReturn=1, isTerminator=1, hasDelaySlot=1, isBarrier=1 in
// Pseudo operation to separate bundles
def SEP : Pseudo<(outs), (ins), ";;", []>;
// NOP
-def NOP : Pseudo<(outs), (ins i32imm:$val), " nop\t$val", []>;
+def NOP : Pseudo<(outs), (ins), " nop", []>;
View
98 tools/llvm/lib/Target/Lemberg/LembergNopCompressor.cpp
@@ -1,98 +0,0 @@
-//===-- LembergNopCompressor.cpp - Lemberg pinner --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Pass to compress NOPs to multi-cycle NOPs
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "nop-compression"
-#include "Lemberg.h"
-#include "LembergTargetMachine.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/raw_ostream.h"
-
-using namespace llvm;
-
-STATISTIC(NumNopCompressed, "Number of NOPs eliminated");
-STATISTIC(NumNopEncountered, "Number of NOPs encountered");
-
-namespace {
-
- struct Compressor : public MachineFunctionPass {
- TargetMachine &TM;
- const TargetInstrInfo *TII;
-
- static char ID;
- Compressor(TargetMachine &tm)
- : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) {
- }
-
- virtual const char *getPassName() const {
- return "Lemberg NOP-Compressor";
- }
-
- bool runOnMachineFunction(MachineFunction &F);
- };
- char Compressor::ID = 0;
-} // end of anonymous namespace
-
-// createNopCompressorPass - Returns a pass that compresses NOPs
-FunctionPass *llvm::createLembergNopCompressorPass(LembergTargetMachine &TM,
- CodeGenOpt::Level OptLevel) {
- return new Compressor(TM);
-}
-
-bool Compressor::runOnMachineFunction(MachineFunction &F)
-{
- bool Changed = false;
-
- for (MachineFunction::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
-
- for (MachineBasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) {
-
- MachineInstr *MI = BI;
-
- if (MI->getOpcode() == Lemberg::NOP) {
-
- assert(next(BI)->getOpcode() == Lemberg::SEP && "Expecting separator after NOP");
-
- ++NumNopEncountered;
-
- // Don't go past end of basic block
- if (next(next(BI)) != FI->end()) {
-
- MachineInstr *NI = next(next(BI));
-
- if (NI->getOpcode() == Lemberg::NOP) {
-
- // Add cycles
- MI->getOperand(0).setImm(MI->getOperand(0).getImm()+NI->getOperand(0).getImm()+1);
-
- // Erase separator and next instruction
- next(BI)->eraseFromParent();
- next(BI)->eraseFromParent();
-
- // Look at this instruction again
- --BI;
-
- ++NumNopCompressed;
-
- Changed = true;
- }
- }
- }
- }
- }
-
- return Changed;
-}
View
2 tools/llvm/lib/Target/Lemberg/LembergScheduler.cpp
@@ -238,7 +238,7 @@ void HazardRecognizer::insertSep(MachineBasicBlock *BB) {
void HazardRecognizer::insertNop(MachineBasicBlock *BB) {
- MachineInstr *MI = BuildMI(BB, DebugLoc(), TII->get(Lemberg::NOP)).addImm(0);
+ MachineInstr *MI = BuildMI(BB, DebugLoc(), TII->get(Lemberg::NOP));
SUnit *Nop = Sched->newSUnit(MI);
// Force the noop to pass verification
Nop->isScheduled = true;
View
3 tools/llvm/lib/Target/Lemberg/LembergTargetMachine.cpp
@@ -117,9 +117,6 @@ bool LembergPassConfig::addPreEmitPass() {
PM->add(createLembergPinnerPass(TM, getOptLevel()));
PM->add(createLembergSchedulerPass(TM, getOptLevel()));
PM->add(createLembergDelaySlotFillerPass(TM, getOptLevel()));
- if (getOptLevel() != CodeGenOpt::None) {
- // PM->add(createLembergNopCompressorPass(TM, getOptLevel()));
- }
PM->add(createLembergPostPinnerPass(TM, getOptLevel()));
return true;
}

0 comments on commit 8cd192a

Please sign in to comment.