parrot / parrot

Parrot Virtual Machine
http://parrot.org
Artistic License 2.0
593 stars 138 forks source link

Look at using the "restrict" keyword on pointers. #177

Open petdance opened 13 years ago

petdance commented 13 years ago

The restrict keyword can lead to improved optimizations by the compiler: http://en.wikipedia.org/wiki/Restrict

GCC 4.5 "now makes better use of the information provided by the restrict keyword... to generate better optimized code." https://lwn.net/SubscriberLink/387122/4555e15215cc7faf/

Look to see if we can get any performance benefits from it.

Here's a good blog post about the restrict qualifier: http://lbrandy.com/blog/2010/06/you-cant-beat-a-good-compile/

leto commented 13 years ago

+1. Does this mean that we will not sticking to ANSI 89 C compilers? Or will we only generate the restrict keyword when the compiler has shown to support it?

petdance commented 13 years ago

Don't know. That's why it says "look at".

I just brought iit over from Trac since it was created by and assigned to me.

gerdr commented 12 years ago

MSVC has __restrict, which provides a subset of the C99 restrict functionality, ie there's no real reason not to use it as it's available on all major platform; the Parrot codebase already uses non-C90 features, btw, so that shouldn't be an issue either...

rurban commented 9 years ago

Esp. nqp 6model would benefit from it, parrot not so I guess. We don't have that much aliasing going on. But I'll look into it.