|Which part of optimization is most important in a compiler? email@example.com (2008-03-23)|
|Re: Which part of optimization is most important in a compiler? firstname.lastname@example.org (2008-03-25)|
|Re: Which part of optimization is most important in a compiler? email@example.com (Brooks Moses) (2008-03-25)|
|Re: Which part of optimization is most important in a compiler? firstname.lastname@example.org (kphillips) (2008-03-27)|
|Re: Which part of optimization is most important in a compiler? email@example.com (=?ISO-8859-1?Q?Pertti_Kellom=E4ki?=) (2008-03-28)|
|Re: Which part of optimization is most important in a compiler? firstname.lastname@example.org (Nils) (2008-03-30)|
|Re: Which part of optimization is most important in a compiler? email@example.com (2008-04-02)|
|From:||Brooks Moses <firstname.lastname@example.org>|
|Date:||Tue, 25 Mar 2008 14:46:17 -0700|
|Posted-Date:||26 Mar 2008 23:09:16 EDT|
> I haven't taken the compiler course at college. Because my job is
> to optimize code on DSP, I hope to understand compiler deep and begin
> to read a compiler textbook. There are a lot of materials in a book,
> but the overview of advanced compiling is not given in the book.
> Maybe every part is important for a optimized compiler. I hope to know
> which part of a compiler is most important in a compiler. Instruction
> scheduling, or register allocation?
"Most important" is an impossible question to answer -- it depends on
which one is being done badly. If the instruction scheduling is done
badly, the compiled program will spend all its time with stalled
pipelines and run slowly, and the best register allocation in the world
won't fix it. If the register allocation is done badly, the compiled
program will spend all its time in memory fetches and stores and run
slowly, and the best instruction scheduling in the world won't fix it.
It also depends heavily on the processor architecture and the program.
On a Cell SPE, instruction ordering can make an order-of-magnitude
difference in execution time, but with 128 registers, allocating the
registers in an optimum way is often not especially critical. On a
processor that does instruction-reordering in hardware but has a
half-dozen registers, however, the register allocation is critical and
the instruction ordering much less so. I don't know where your DSP
would fit in this spectrum.
With that said, a program with poor instruction scheduling will still
run, whereas the registers have to be allocated _somehow_ in order to
get a running program, so you might as well learn about register
Also, if you have any experience with writing assembly-code programs for
your DSP, that should give you some insight into what's most important
to get things to run fast on your processor. (If you don't have
experience with that, it's probably useful to get some -- it's hard to
write a program to produce something that you don't know how to produce
The "bmoses-nospam" address is valid; no unmunging needed.
Return to the
Search the comp.compilers archives again.