logoalt Hacker News

Aliasing

59 pointsby ibobevlast Tuesday at 10:13 AM12 commentsview on HN

Comments

Ono-Sendaitoday at 12:15 PM

When you have done enough C++ you don't need to fire up compiler explorer, you just use local variables to avoid aliasing pessimisations.

I also wrote about this a while ago: https://forwardscattering.org/post/51

turoltoday at 9:41 AM

For a real world example of how this can affect code check out this commit I made in mesa: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20...

andrepdtoday at 3:02 PM

Thank you Rust for having aliasing guarantees on references!

adev_today at 9:37 AM

Aliasing is no joke and currently the only reason why some arithmetic intensive code-bases still prefer Fortran even nowadays.

While it is possible to remove most aliasing performance issues in a C or C++ codebase, it is a pain to do it properly.

show 1 reply
Bootvistoday at 6:54 AM

The whole series is excellent and as a non regular user of assembly I learned a ton.

artemonstertoday at 7:51 AM

I wonder how much potential optimisation there is if we entirely drop pointer nonsense.

show 1 reply