scispace - formally typeset
Open AccessProceedings ArticleDOI

Code generation and reorganization in the presence of pipeline constraints

Reads0
Chats0
TLDR
The basic problem of reorganization of machine level instructions at compile-time is shown to be NP-complete and a heuristic algorithm is proposed and its properties and effectiveness are explored.
Abstract:Ā 
Pipeline interlocks are used in a pipelined architecture to prevent the execution of a machine instruction before its operands are available. An alternative to this complex piece of hardware is to rearrange the instructions at compile-time to avoid pipeline interlocks. This problem, called code reorganization, is studied. The basic problem of reorganization of machine level instructions at compile-time is shown to be NP-complete. A heuristic algorithm is proposed and its properties and effectiveness are explored. The impact of code reorganization techniques on the rest of a compiler system are discussed.

read more

Content maybe subject toĀ copyrightĀ Ā Ā  Report

COMPUTER SYSTEMS
LABORATORY
STANFORD UNIVERSITY STANFORD, CA
943053055
Code Generation and
Reorganization in the Presence
of Pipeline Constraints
John Hennessy and Thomas Gross
Technical Report No. 224
November 1981
The MIPS project has been supported by the Defense Advanced Research
Projects
Agency
under contract #
MDA903-79-C-0680.
Thomas Gross is
supported by an
II3M
Graduate Fellowship.
L


Code Generation and
Reorganization in the Presence
of Pipeline Constraints
John
Hcnncssy
and
lā€™homas
Gross
Iā€™cchnical
Report No. 224
November
1981
.
Cornputcr
Systems Laboratory
Dcp:utmcnts
of
Electrical
Engineering
and Computer
Science
Stanford
University
Stanford, California 94305
Abstract
.
Pipeline
interlocks
arc used in a pipelincd architecture to prevent the execution of a machine instruction
before its operands are available. An alternative to this complex piece of hardware is to rearrange
the
instructions at compile-time to avoid pipeline
interlocks.
This problem,
called
code reorganization, is
studied.
The
basic problem of reorganization of machine
level
instructions at compile-time is shown to bc
NP-
complete. A heuristic algorithm is proposed and its properties and effectiveness are explored.
The
impact of
code reorganization techniques on the rest of a compiler system are discussed.
Key Words and Phrases: Code generation, pipelining, interlocks, instruction reordering, code optimization,
register
alhXdiim,
microprogramming
A
version
of this report will appear in the
Proc.
of
the
Ninth ACM
Conference
on
Principles
of Programming
Languages, 1981


1
1 Int
reduction
Recent research in computer
architecture
centers around two major trends:
the
development of
architectures that attempt to support high level language systems through more sophisticated instruction sets,
and the design of simpler architectures that arc
inherently
faster but may rely on more
powerful
compiler
technology. The latter trend has several properties that make it an attractive host for high
level
languages and
their compilers and optimizers:
1.
Because
the instruction set is simpler, individual instructions execute faster.
.
2. A compiler is not faced with the task of attempting to utilize a very sophisticated instruction that
dots not quite fit any particular high level construct.
Besides
slowing down other instructions,
using these instructions is sometimes slower than using a
customized
seque.ncc
of simplier
instructions
[12].
3. Although these architectures may require more sophisticated compiler
technology,
the potential
performance improvements to be obtained from
faster
machines and
better
compilers are
substantial.
.ā€˜.
ā€™
Recently, several articles have
discussed
the relationship between compilers,
architectures
and performance
[16,5].
The concept of simplified instruction sets and their benefits, both for compilers and hardware
implementations, are presented in
[II,
121.
The unique property of some of these experimental architectures is that they will not perform
efflcicntly
without more sophisticated software technology. This paper investigates a major problem that
arises
when
generating code for a pipelined architecture that does not have hardware pipeline
interlocks.
Without
hardware
interlocks,
naively generated code sequences will not run correctly. These interlocks must be
provided
in software by arranging the instructions and inserting no-ops
(when
necessary) to prevent
undefined
execution
sequences.
There are currently several architectures that require software imposition of
certain types of interlocks
[lo,
61.
The absence of interlocks is also very common in micromachine
architectures, and the microprogrammer must often address this problem.
1.1 Background
A pipclined processor is one in which several sequential instructions are in simultaneous execution, usually
in different phases. One component of an instruction may refer to a component that is computed in an earlier
instruction. Because the earlier instruction may still be executing, the value of the component may not bc
available. A hardware mechanism, called a pipeline interlock, prevents the latter instruction from continuing
until
the
needed value is available.
Figure
1 shows a typical
pipeline
configuration. This pipe has three stages:
psa,
psb,
psC.
Three
instructions

Citations
More filters
Journal ArticleDOI

Postpass Code Optimization of Pipeline Constraints

TL;DR: The basic problem of reorganization of machine-level instructions at compile time is shown to be np-complete, and a heuristic algorithm is proposed, and its properties and effectiveness are explored.

A Bibliography of Publications about the Fortran Programming Language: Part 1: 1956{1980

TL;DR: In this paper, the authors proposed a method to solve the problem: see [Cas89a] and http://www.s/0098-3500/116814.html
Journal ArticleDOI

Efficient instruction scheduling for a pipelined architecture

TL;DR: By using a dag representation which prevents scheduling deadlocks and a selection method that requires no lookahead, the resulting algorithm reorganizes instructions almost as effectively in practice, while having an O(n2) worst-case runtime.
Proceedings ArticleDOI

Hardware/software tradeoffs for increased performance

TL;DR: It is argued that the most effective design methodology must make simultaneous tradeoffs across all three areas: hardware, software support, and systems support.
Journal ArticleDOI

MIPS: A microprocessor architecture

TL;DR: The MIPS processor is a fast pipelined engine without pipeline interlocks, which attempts to achieve high performance with the use of a simplified instruction set, similar to those found in microengines.
References
More filters
Journal ArticleDOI

Some Experiments in Local Microcode Compaction for Horizontal Machines

TL;DR: Compaction algorithms implemented and tested on microcode produced by a compiler for a high-level microprogramming language produced microcode compacted into a minimal number of microinstructions in time that was a polynomial function of order two of the number of input microoperations.
Proceedings ArticleDOI

RISC I: a reduced instruction set VLSI computer

TL;DR: The architecture of RISC I and its novel hardware support scheme for procedure call/return are presented and it appears possible to build a single chip computer faster than VAX 11/780 and to have a much shorter design time.
Journal ArticleDOI

The case for the reduced instruction set computer

TL;DR: It is argued that the next generation of VLSI computers may be more effectively implemented as RISC's than CISC's, and in fact may even do more harm than good.
Frequently Asked Questions (1)
Q1. What are the contributions mentioned in the paper "Code generation and reorganization in the presence of pipeline constraints" ?

This problem, called code reorganization, is studied.Ā The impact of code reorganization techniques on the rest of a compiler system are discussed.Ā