On Wed, Aug 20, 2008 at 12:21:42AM +0200, Nils Pipenbrinck wrote: > Well - I had a lot of time to kill during the last weeks, and I had a > lot of timeto read into the source. Business trips without internet > access are a perfect opportunity to read such stuf... > > Anyway, after all this passive read-work, I've been able to add the > humble beginnings of my pass. I'm now able to and I've been able to run > a code that does a printf as soon as I find an structure in the SSA tree > that is a potential candidate for my optimization. > > However, approaching this point has been very painfull and I'm far away > from chainging anything in the SSA. > > Let's get to the point: The documentation sucks. If you want to learn > how things work the wiki and the documentation is of little help. You > have to read other code, step through other optimizations and do a lot > of reverse-engineering and code-reading to understand how all the > different things fit and relate to each other.
You may be in a unique position to do something about this problem, as someone who has just had to painfully learn how to write a pass. You could write up what you've learned on a wiki page, and we might be able to convince some more experienced people to help correct anything you got wrong. > I think a well commented pseudo-pass (well document as: talk to someone > who know C but has no idea about the GCC magic..) that does something > stupid but valid like re-inventing the neg-operator by using not and > subtraction could act as be a very nice boilerplate code for people like me. Alternatively you could contribute that. > For someone who is into the SSA structures and the gcc internals should > be able to write up something within a day or an half. Right, but in many cases the people that know this stuff cold don't have a day and a half, so it will happen when someone contributes it.