code generation

I am MSc student and my thesis subject is “parallelization of sequential program in thread level to run on multi-core processors”. I want automatically parallelize sequential program in thread level to run on multi-core processors with software pipelining.

I’ve use LLVM to code analysis and translate code to IR, I could extract PDG graph form IR code and convert it to SCCDAG and partition DAGSCC considering with my criteria. In next step I could recognize position of communications between partitions.

But for final step and code generation, I don’t have any idea and information to assign partitions and communications to threads. and I stop in this position. Unfortunately I don’t have enough time and I am under force to complete the project.

Can you help me and do you know tools or references that can help me in short time.

thank you for your attention and I wish you a good times.

Best regards

neda

Hi, neda

But for final step and code generation, I don't have any idea and
information to assign partitions and communications to threads. and I stop
in this position. Unfortunately I don’t have enough time and I am under
force to complete the project.

  What you want to do is pretty much like what DSWP does, see
  Decoupled Software Pipelining

  What DSWP does is partitioning a loop into producer/consumer thread.
I know they had implemented DSWP in LLVM before, but I don't know what
the current status is. Maybe you can mail them to ask some idea.

Regards,
chenwj

I’ve study their work carefully.
My problem is the implementation of threads in llvm after partitionning. I want to have information about how to implement producer/consumer thread in llvm.
I do not know where I should start in llvm for code generation and create thread and insert produce and consume statement .

My problem is the implementation of threads in llvm after partitionning. I
want to have information about how to implement producer/consumer thread in
llvm.

  That's why I sugguest you mail them for some advice. :slight_smile:
Or you can search "dswp llvm" on the web. It seems there
are some projects tend to implement DSWP in LLVM. For example,
Google Code Archive - Long-term storage for Google Code Project Hosting. .

HTH,
chenwj

LLVM does not provide any special support for threads. You have to
generate code that calls into whatever native threading library is
available on your operating system, ie pthreads or winthreads, and
link against it.

Reid