






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The steps to install and run trimaran, a compiler, on various linux distributions and other unix systems. It covers required software, installation procedures, and provides an overview of trimaran's components. Students in a compiler course may find this document useful for understanding the practical aspects of setting up and using a compiler.
Typology: Assignments
1 / 38
This page cannot be seen from the preview
Don't miss anything!































Agenda for Today
Needed Software Y
Y
Y
Y
Y
Y
3.0.4 works for sure »^
2.8.1 - 3.2 should work
Y
Y
Y
Y
dot – http://www.research.att.com/sw/tools/graphviz »^
xvcg – source on course webpage (./configure, make)
Installation – Step 1
So you don’t forget
Trimaran Overview
C source
Frontend – parsing, profiling function inlining, memory dep analysis. Also, does some backend stuff – region formation, optimization
Impact
Lcode
Backend – analysis, optimization, scheduling register allocation, code generation
Elcor
Rebel
Emulator – emulate VLIW semantics using C code – “compiled simulation”
Simu
C emulation code
Running Trimaran
source, compile flags, link flags y input for profiling the code y output to check it ran properly y To add a new benchmark, follow the organization that is there
Elcor – Directory Structure
, ANALYSIS_DEFAULTS, etc.
y^
Changing switch values^ X
Modify ***_DEFAULTS file X^
-Fswitch=value on the command-line
Running Elcor Manually
583test1.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^
583test1.O_el.tgz – elcor output^ X
Rebel
y^
host_layout_info.md – data structure organization stuff
Running Simu Manually
predicates, NUAL, etc.
test1.c y benchmark_data_init.simu.c
Elcor Organization Y
y^
“homegrown” version of STL - list, dlist, slist, hash_set, hash_map, …
Y
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
y^
process_function.cpp is the main driver
Y
y^
target processor info – built from .lmdes2 file
Y
y^
control flow, dataflow analysis, predicate analysis, edge drawing
Y
y^
Control flow transformations
Y
y^
Whenever you create a List
Must instantiate template – look in the files for example y^
Hw1 – can add to template_control.cpp
Back to Loops – Assembly Generation Schema
loop:
if (i >= y) goto done body; i += z; goto loop
if (i >= y) goto done body; i += z; if (i < y) goto loop
loop:
done:
done:
Loop Induction Variables
Loop Unrolling Y
Y
Loop unrolled N times or Nxunrolled »^
Enable overlap of operations fromdifferent iterations »^
Increase potential for ILP(instruction level parallelism)
Y
Unroll multiple of known tripcount »^
Unroll with remainder loop »^
While loop unroll
Loop:r1 = MEM[r2 + 0]r4 = r1 * r5r6 = r4 << 2MEM[r3 + 0] = r6r2 = r2 + 1blt r2 100 Loop
Loop Unroll – Type 1
r1 = MEM[r2 + 0] r4 = r1 * r5 r6 = r4 << 2 MEM[r3 + 0] = r6 r2 = r2 + 1 blt r2 100 Loop
Loop: r1 = MEM[r2 + 0] r4 = r1 * r5 r6 = r4 << 2 MEM[r3 + 0] = r6 r2 = r2 + 1 blt r2 100 Loop r2 is the loop variable, Increment is 1 Initial value is 0 Final value is 100 Trip count is 100
Loop: r1 = MEM[r2 + 0] r4 = r1 * r5 r6 = r4 << 2 MEM[r3 + 0] = r6 r2 = r2 + 1
Loop: r1 = MEM[r2 + 0] r4 = r1 * r5 r6 = r4 << 2 MEM[r3 + 0] = r6 r1 = MEM[r2 + 1] r4 = r1 * r5 r6 = r4 << 2 MEM[r3 + 0] = r6 r2 = r2 + 2 blt r2 100 Loop
Counted loop All parms known
Remove r2 increments from first N-1 iterations and update last increment
Remove branch from first N-1 iterations