




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















Reading Material
Y
“Profiled Guided Code Positioning”, K. Pettis and R. Hansen, Proc. PLDI-90, 1999
“Procedure Placement Using Temporal Ordering Information”, N. Gloy et al., Proc. MICRO-30, 1997
Y
Compilers: Principles, Techniques, and Tools
A. Aho, R. Sethi, and J. Ullman, Addison-Wesley, 1988. (Sections: 10.5, 10.6, 10.9, 10.10)
Running Elcor Manually
Y
tcc –bench strcpy
Y
impact_intermediate
elcor_intermediate
y
strcpy.O_tr.tgz – impact output / elcor input (bridge code)
X
Impact assembly (called Lcode or Mcode)
X
This is what you will run Elcor manually on
X
Untar this file
±
file1.O_tr, file2.O_tr, … ±
1 file per original C source file
y
strcpy.O_el.tgz – elcor output
X
Rebel
y
host_layout_info.md – data structure organization stuff
simu_intermediate
Running Elcor Manually (2)
Y
Get used to Rebel – no need to worry about 2 assembly codes
elcor –i strcpy.O_tr –o strcpy.O_reb –Foutput_format=rebel \ –Fdo_null_processing=yes
strcpy.O_reb is our input file
Y
Default input/output format is Lcode (see IO_DEFAULTS)
elcor –i strcpy.O_reb –o strcpy.O_el –Finput_format=rebel \ –Foutput_format=rebel
Can also just directly use the strcpy.O_tr file if you wish
Invokes eecs583_hw1_driver(Procedure *f)
y
Entry point for HW
In elcor/src/eecs583/hyperblock.cpp
After, perform scheduling (may want to disable this duringdebugging, see elcor/parms/DRIVER_DEFAULTS)
Elcor Organization
Y
src/Tools
y
“homegrown” version of STL - list, dlist, slist, hash_set, hash_map, …
Y
src/Graph
y
All the core compiler data structs in here
y
operand.h, port.h, op.h, region.h, edge.h, *_utilities.h, opcode_properties.h
Y
Main
y
process_function.cpp is the main driver
Y
Mdes
y
target processor info – built from .lmdes2 file
Y
Analysis
y
control flow, dataflow analysis, predicate analysis, edge drawing
Y
Control
y
Control flow transformations
Y
Templates
y
Whenever you create a List
y
Must instantiate template – look in the files for example
y
Hw1 – add to eecs583/templates.cpp
Core IR (see src/Graph)
Y
C0 = control flow (always around, even sequential flow)
C1 = control dependence (not in by default)
Y
All ops connected to/from with C0 edges
Branches have multiple outgoing C0 edges
Y
Regions must be perfectly nested
Basicblocks, Hyperblocks, and Procedures are all you need toworry about now.
Y
Motivation
Instruction memory critical to programperformance
Default code layout for most compilers is bad
Compilers can
rearrange code
to reduce misses
Example Call Graph
Merging Nodes
) The heaviest weight edge is one connecting procedures A and D.They are merged. Edge weights areupdated.
Basic Block Ordering
Define the order of the basic blocks in eachprocedure
First, identify chains of blocks
y
Top-down
y
Bottom-up
Second, define precedence relation between thechains
Top-Down Chain Formation
Bottom-up Chain Formation
Form BB chains using the following steps
Class Problem
Create the BB chains using bottom-uppositioning