Seung Jae Lee
2007-Jul-16 08:20 UTC
[LLVMdev] not to break 'for' statement into basic blocks
Thank you so much but could you tell me a little bit more in detail about that you suggested? Sorry, I'm just a greenhorn. Thanks, Seung J. Lee ---- Original message ---->Date: Sat, 14 Jul 2007 21:26:14 -0500 >From: "David A. Greene" <greened at obbligato.org> >Subject: Re: [LLVMdev] not to break 'for' statement into basic blocks >To: llvmdev at cs.uiuc.edu > >On Saturday 14 July 2007 17:23, Anton Korobeynikov wrote: > >> > 1) First, I tried to re-unite basic blocks which llvm-gcc spits out to >> > make 'for' again. But this is quite tricky. Generalizing it for the >> > optimzed llvm bytecode is not easy. >> >> I'd say 'is not possible at all'. > >No, it certainly is possible. One does this, for example, when constructing >a control dependence graph. It can't be represented in llvm, so one needs >a higher-level abstraction. A control dependence graph is one such >abstraction. > >Even llvm has a notion of "loops" that it extracts from the control flow >graph. Now, these are very low-level abstractions and probably won't work >for the purposes of this ISA. > >And when you get difficult control behavior... >
David Greene
2007-Jul-16 16:07 UTC
[LLVMdev] not to break 'for' statement into basic blocks
On Monday 16 July 2007 03:20, Seung Jae Lee wrote:> Thank you so much but could you tell me a little bit more in detail about > that you suggested? Sorry, I'm just a greenhorn.There's far too much to cover on an e-mail list. Use Google, Citeseer, the ACM digital library, etc. and search for "control dependence graph." I provided the reference for an algorithm to remove unstructured gotos. Everyone starts out as a greenhorn. Compilers are complicated beasts, as evidenced by the number of Ph.D.s still centered on "solved" problems like register allocation. :) It takes a lot of reading and doing to become fluent. I'm very happy to try and answer specific questions. Here are some specific references: Compilers: Principles, Techniques and Tools (a.k.a. The Purple Dragon Book) by Aho, Lam, Sethi and Ullman. This is a good, if at times dense, introductory text. Advanced Compiler Design & Implementation by Muchnick. A somewhat more advanced treatment, better as a reference than a learning book. I strongly suggest that if you're at a University, that you investigate the compiler course offerings. You'll only get so far just reading. Doing is really important. -Dave