Seung Jae Lee
2007-Aug-25 07:28 UTC
[LLVMdev] constructing 'for' statement from LLVM bitcode
---- Original message ---->Date: Fri, 24 Aug 2007 22:23:39 -0700 >From: Chris Lattner <sabre at nondot.org> >Subject: Re: [LLVMdev] constructing 'for' statement from LLVM bitcode >To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > > >On Aug 24, 2007, at 10:07 PM, Seung Jae Lee wrote: > >> Do you have any idea on how I can construct 'for' more systemically >> with this CDG info from LLVM bitcode? >> > >I strongly suggest looking at the Muchnick book: http:// >www.amazon.com/Advanced-Compiler-Design-Implementation-Muchnick/dp/ >1558603204 > >It has a section on "structural analysis" that you will find useful. > >Why do you want "for statements"? >Thank you for this info, Chris. I'm doing this 'cause I'm making a backend for a virtual machine assembly has an instruction which is very similar to 'for' statement. I know this seems quite strange for that machine instruction looks quite high-level. Furthermore, it doesn't have instructions such as 'br' in LLVM so this is why I have to re-construct 'for' statement for the assembly from LLVM bitcode. (I must not use 'goto' in the high-level source code, either. :-/) Thanks, SJL>-Chris >_______________________________________________ >LLVM Developers mailing list >LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Chris Lattner
2007-Aug-26 06:19 UTC
[LLVMdev] constructing 'for' statement from LLVM bitcode
>> It has a section on "structural analysis" that you will find useful. >> >> Why do you want "for statements"? >> > > Thank you for this info, Chris. > I'm doing this 'cause I'm making a backend for a virtual machine > assembly has an instruction which is very similar to 'for' statement. > I know this seems quite strange for that machine instruction looks > quite high-level. > Furthermore, it doesn't have instructions such as 'br' in LLVM so > this is why I have to re-construct 'for' statement for the assembly > from LLVM bitcode. (I must not use 'goto' in the high-level source > code, either. :-/)Ok. Note that LLVM can represent irreducible loops. You can handle this through code duplication. -Chris
Domagoj Babic
2007-Aug-29 18:39 UTC
[LLVMdev] constructing 'for' statement from LLVM bitcode
Seung, On 8/25/07, Chris Lattner <sabre at nondot.org> wrote:> Ok. Note that LLVM can represent irreducible loops. You can handle > this through code duplication. > -ChrisIf you are willing to invest more effort into a more complicated analysis, in many cases you can even avoid code duplication. See this paper for details: @inproceedings{erosa94taming, author = {Ana M. Erosa and Laurie J. Hendren}, title = {Taming Control Flow: A Structured Approach to Eliminating Goto Statements.}, booktitle = {ICCL}, year = {1994}, pages = {229--240}, } Cheers, -- Domagoj Babic http://www.domagoj.info/ http://www.calysto.org/
Possibly Parallel Threads
- [LLVMdev] constructing 'for' statement from LLVM bitcode
- [LLVMdev] constructing 'for' statement from LLVM bitcode
- [LLVMdev] constructing 'for' statement from LLVM bitcode
- Calysto v1.5 reports on ssh v4.6p1
- NULL ptr dereferences found with Calysto static checker