幻灯片 1 - CAPSL

Retargeting Open64 to A RISC processor
-- A Student’s Perspective
Author:
Huimin Cui
Xiaobing Feng
2009.03
1
Motivation
 Retarget is of significance for Open64
– Good retarget-ability brings more targets
– more targets support brings more user.
 But there is no detailed manual
– To show how to retarget step by step, to let even
a green-hand can do the porting.
– To give an overview of the performance just
after retarget done.
2
Retarget Procedure
 Summarized a detailed procedure for future
retarget
–
–
–
–
3
File creation order
Building order
Listed all the files that require modification
How to fix up some critical files
Retarget Procedure
—our methodology(1)
 1st step
– Verify basic compiler issues,
 C Front-end
 IR transformation
 Code generation
 Simple Library Function Call
– Naïve HelloWorld
4
Retarget Procedure
—our methodology(2)
 2nd step
– Verify ABI/CFlow
– Variations of HelloWorld
 Change Data types of parameters
 Add control-flow: branch & loop
 3rd step
– Verify optimization FRAMEWORK
– -O0, -O2, -O3
Retarget Procedure
—our methodology(3)
 4th step
– Further verify CG/optimizations/multiple
procedures
– Stanford benchmark, -O0 to –O3
 5th step
– Verify c++ FE/loop optimizations
– Abstraction penalty benchmark, -O0 to –O3
6
Retarget Procedure—some points
 In most cases, it’s easier to tailor the files
from existing ones
 Make the compiler work, then make it
perform
 Use debugging tools of isolation/tracing/
dumping
7
Discussion—Easy of Retarget
 Took a student 2 months
 Dealt with
–
–
–
–
ISA
ABI
Code Generation
Some machine-dependent functions
 Passed the benchmarks, (-O0 to –O3)
– Stanford Benchmark
– Abstraction Penalty Benchmark
– Some applications from CPU2000, bzip2 & mcf
8
Discussion—Performance (1)
 NO machine-dependent performance tuning
after retarget.
– competitive or better performance compared to
a matured GCC-Mips compiler
– obvious performance improvement from –O2 to –
O3, especially for C++ programs with higher
abstraction levels.
9
Discussion—Performance(2)
Performance of abstraction penalty, -O2 and –O3
The higher, the better
10
Discussion—Performance(3)
Performance of Stanford Benchmark
The lower, the better
11
Discussion—Performance(4)
Performance of bzip2 & mcf
12
Suggestions
 Can the flags distributed in multiple files be
merged into one file?
– Eg. Endianness
 Can some graphic tools be developed for
view IR, flow, etc?
13
Summary
 A detailed retarget procedure (derived
from Fred Chow’s document)
– Shared our methodology
 Discussed two retargeting issues
– Ease of retarget
– Performance
 Some suggestions
Questions & Comments?
 please mail to: [email protected]
15