Speculative paralellisation!!

Please cc llvm-dev in replies to llvm-dev emails.

Hi Nick,
Thanks for your reply.Now i need some help about how can i proceed to start writing a patch for acheiving paralellisation in llvm.

Great!

I am new to open source and llvm. So please dont mind if my questions are simple. Please do reply about how i can go about writing a patch .

Sure. I’ll start by assuming you have the code checked out of SVN per the instructions in http://llvm.org/docs/GettingStarted.html#checkout .

Then you just modify your code in-place.

  • make sure to follow our coding standards: http://llvm.org/docs/CodingStandards.html. Try hard to make your code look/feel like the rest of the code in LLVM. You’ll need to read more code than you write.
  • since you’re implementing LoopDependenceAnalysis, there are certain rules it will need to follow since it will be used by a LoopPass. Read http://llvm.org/docs/WritingAnLLVMPass.html.
  • you can use DEBUG(dbgs() << “…”); statements in your code to see what’s going on inside your pass. Turn on those print statements with “opt -debug-pass=lda”.
  • once you’ve written one piece of functionality (don’t wait until a large project is done; just implementing analyseMIV would be enough), write tests for it. There are two test frameworks, one which relies on running the llvm tools in test/. Most of our tests go there. The other uses the C++ API directly and is in unittests/.
  • create the patch by running “svn diff” in the llvm source tree. The patch is plain text and should be reasonably easy to read. Make sure the patch has exactly the parts you want, in particular new files (your tests) won’t be included unless you ran “svn add test/filename” on them.

Nick