Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
laziness, impatience, and hubris
 
PerlMonks  

Re^4: perllVm: A start.

by BrowserUk (Pope)
on Sep 05, 2012 at 13:22 UTC ( #991845=note: print w/ replies, xml ) Need Help??


in reply to Re^3: perllVm: A start.
in thread perllVm: A start.

Thanks for the link Reini.

I can see that I am duplicating some of Yuval's efforts, but I think it will be worth it.

Beyond simply using llvm as an alternate C compiler -- though if doing so recovered (some of) the 15% to 30% loss of performance that has come about since perl5.6.1 with the additions of threading and Unicode support, that alone would be worth something -- I also want to explore what benefits (or not) are derived from the passes of the individual optimisers in llvm, on a the various groups of the perl core.

For now, my chosen task of having llvm-built binaries (perl.exe/perl5x.dll) that inter-operate with an otherwise standard distribution and modules -- including XS modules -- built using the normal compiler for the platform is (cautiously) going well. Most of the problems I've encountered so far result from my choosing to use MSVC rather than a gcc-compatible compiler to build the distribution I am inter-operating with. Simple reasoning: if I can make LLVM inter-operate with MSVC, gcc/mingw should be a doddle; but more importantly, inter-operation on other more obscure platforms should also be possible.

One of the bits of using LLVM that has gone completely unmentioned in all of the discussion I've seen so far, is the benefits of using its (frankly amazing) analysis & tracing tools. I've learnt more about the structure (and cruft) of the perl internals in the last 100 hours than in the previous 5 years.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re^4: perllVm: A start.
Re^5: perllVm: A start.
by Anonymous Monk on Sep 05, 2012 at 13:29 UTC

    One of the bits of using LLVM that has gone completely unmentioned in all of the discussion I've seen so far, is the benefits of using its (frankly amazing) analysis & tracing tools. I've learnt more about the structure (and cruft) of the perl internals in the last 100 hours than in the previous 5 years.

    Can you please point a camera at your computer screen and vocalize your thoughts?

    Then upload this recording somewhere?

    Thank you :)

      For whom, mister anonymous?

      A simple example. A bug (exception fault) that arises from the interaction of LLVM, MSVC and a 40,000-line post preprocessed C-source. Compile the source to bitcode, feed it to one of their tools and it does a binary chop on the code, excluding bits of it -- in a code-aware manner -- until the trap doesn't occur. Put the bit back that contains the bug and remove other bits. Rinse and repeat until you've excluded everything that doesn't contribute to the trap.

      In less than 2 minutes, it reduces 40,000 lines of C, to 680 bytes of bitcode, that converted back amounts to about 12 lines of C. A simple, standalone testcase for further examination.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

        That's pretty awesome. I've wanted something like that for Inline::C code for a while.

        For whom, mister anonymous?

        For all the world :) I figured that asking for a proper how-to use one of those tools, was asking a bit much to ask

        But a peek at peek at your screen as you're doing what you do?

        Might be a nice demonstration, inspire other to try it...

        :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991845]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-04-20 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls