Implementing data flow analysis in single pass parser

This is a discussion on Implementing data flow analysis in single pass parser within the Compilers forums in Theory and Concepts category; Hi all, I am new to compiler writing and need some help in implementing some of the classical algorithms for data flow analysis given in the Dragon book. I am trying to come up with a method to synthesize pointers in the C program to VHDL or Verilog so that it can be translated into hardware circuits. For this I should be able to first identify pointers in the C program. I read the chapter 10.8 in dragon book "Dealing with aliases" which vaguely gives a method to determine pointers in each basic block of the program. It looks to ...

Go Back   Application Development Forum > Theory and Concepts > Compilers

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-18-2008, 02:03 PM
Madhu-K7
Guest
 
Default Implementing data flow analysis in single pass parser

Hi all,

I am new to compiler writing and need some help in implementing some
of the classical algorithms for data flow analysis given in the Dragon
book. I am trying to come up with a method to synthesize pointers in
the C program to VHDL or Verilog so that it can be translated into
hardware circuits. For this I should be able to first identify
pointers in the C program. I read the chapter 10.8 in dragon book
"Dealing with aliases" which vaguely gives a method to determine
pointers in each basic block of the program. It looks to me like it
can be implemented only by multiple parses of the source to achieve
the desired convergence.

I have written a parser to parse the CFG version of the C code dumped
by the gcc option "gcc -fdump-tree-cfg <filename.c>". Its a single
pass parser. I am stuck at this point of how to implement the pointer
identification further. I previously implemented algorithm for finding
the reaching definitions (algorithm 10.2) as a post parse one and it
was a success.

Can someone look into the compiler book and let me know if I can
implement this using a single parse or do I need to change the
implementation method ?.

Thanks a lot!

K7...

Reply With Quote
  #2  
Old 07-28-2008, 04:23 AM
johnhull2008
Guest
 
Default Re: Implementing data flow analysis in single pass parser

There are several papers on synthesizing C pointers to hardware
including the following one:
http://citeseer.ist.psu.edu/237630.html

I have only read the introduction and abstract but it seems to be
suggesting a way of analyzing which variables a pointer might be
pointing to in order to synthesize it into hardware.

Most compilers, including gcc, already have an alias analysis pass, so
it might save you time if you can find a way to use the existing code.
I think tree-ssa-alias.c of gcc-4.3.1 is the pass you might be
interested in.

Reply With Quote
  #3  
Old 07-30-2008, 02:59 PM
Madhu-K7
Guest
 
Default Re: Implementing data flow analysis in single pass parser

On Jul 28, 2:23 am, johnhull2008 <johnhull2...@gmail.com> wrote:
> There are several papers on synthesizing C pointers to hardware
> including the following one:http://citeseer.ist.psu.edu/237630.html
>
> I have only read the introduction and abstract but it seems to be
> suggesting a way of analyzing which variables a pointer might be
> pointing to in order to synthesize it into hardware.
>
> Most compilers, including gcc, already have an alias analysis pass, so
> it might save you time if you can find a way to use the existing code.
> I think tree-ssa-alias.c of gcc-4.3.1 is the pass you might be
> interested in.


Hey John,

Thanks for your reply. That was the first paper that I read on pointer
synthesis. Its a pretty good idea. Thanks for your suggestions.

Regards,
Madhu...

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:17 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.