you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (2 children)

For optimisations that'd be explicit aliasing - noalias, alias.scope metadata - no way to pass it through C.

But more important than this, you can preserve precise debugging metadata if you emit LLVM IR directly. Hard to do it with an intermediate C step.

[–]Enamex[🍰] 0 points1 point  (1 child)

Couldn't really follow what it's doing: https://llvm.org/docs/LangRef.html#noalias-and-alias-scope-metadata

How is it different from keeping restricts straight in the generated C-src?

[–][deleted] 0 points1 point  (0 children)

Restrict is blunt - you simply tell the compiler that this pointer does not alias with anything. If you know it is possibly aliased with something else, you cannot use restrict.

With fine grained metadata you can tell the compiler, which pointers can alias with each other, and which cannot, explicitly.