Skip to content

Loading…

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

Open
petdance opened this Issue · 4 comments

4 participants

@petdance

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
Parrot Virtual Machine member

+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
@gerdr

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
Parrot Virtual Machine member

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.

@rurban rurban self-assigned this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.