On Sun, 27 Nov 2005, Daniel Berlin wrote:
On Sun, 2005-11-27 at 11:58 -0800, Devang Patel wrote:
What makes you think implementing LTO from scratch is different here?

Here are the questions for LLVM as well as LTO folks. (To be fair,

1) Documentation

How well is the documentation so that _new_ compiler engineer can
become productive sooner ?

There is no question that LLVM has much better documentation of IR and
semantics than we do,

See, e.g., http://llvm.org/docs/LangRef.html

It has tutorials on writing a pass, as well as example passes,
http://llvm.org/docs/WritingAnLLVMPass.html

Yup, in addition, LLVM has several pretty good docs for various subsystems, the full set is included here: http://llvm.org/docs/

Another good tutorial (aimed at people writing mid-level optimization passes) is here: http://llvm.org/pubs/2004-09-22-LCPCLLVMTutorial.html

Note that the organization of the 'llvm-gcc' compiler reflects the old compiler, not the new one. Other than that it is up-to-date.

For a grab bag of various LLVM apis that you may run into, this document is useful: http://llvm.org/docs/ProgrammersManual.html

2) Testability of optimization passes

How much precision one can get while testing particular feature,
optimization pass?

You can run one pass at a time, if you wanted to, using opt (or two, or
three).

Yup, however there is one specific reason that is important/useful. With the ability to write out the IR and a truly modular pass manager, you can write really good regression tests. This means you can write regression tests for optimizers/analyses that specify the exact input to a pass.

With traditional GCC regtests, you write your test in C (or some other language). If you're testing the 7th pass from the parser, the regression test may fail to test what you want as time progresses and the 6 passes before you (or the parser) changes. With LLVM, this isn't an issue.

Note that the link-time proposal could also implement this, but would require some hacking (e.g. implementing a text form for the IR) and time to get right.

3) Integrated tools to investigate/debug/fix optimizer bugs

bugpoint beats pretty much anything we have, IMHO :).

For those that are not familiar with it, here's some info:
http://llvm.org/docs/Bugpoint.html

If you are familiar with delta, it is basically a far more fast and powerful (but similar in spirit) automatic debugger. It can reduce test cases, identify which pass is the problem, can debug ICE's and miscompilations, and can debug the optimizer, native backend, or JIT compiler.

4) Basic APIs needed to implement various optimization techniques

All the basics are there for scalar opts.  There is no data dependence
yet, but they have a fine working SCEV, so it's only a few months to
implement, at most.

Yup. LLVM has the scalar optimizations basically covered, but is weak on loop optimizations. This is something that we intend to cover in time (if noone else ends up helping) but will come after debug info and other things are complete.

-Chris

--
http://nondot.org/sabre/
http://llvm.org/

Reply via email to