This is almost more of a documentation change than anything else...
We currently support the align attribute on all (pointer) parameters, but we only use it for byval parameters. However, it is completely consistent at the IR level to treat 'align n' on all pointer parameters as an alignment assumption on the pointer. This patch does this:
- Causes computeKnownBits to use the align attribute on all pointer parameters, not just byval parameters.
- Updated the LangRef to document the align parameter attribute (as it turns out, it was not documented at all previously, although the byval documentation mentioned that it could be used).
There are two benefits to doing this:
- It allows enhancing alignment based on the pointer alignment after inlining
- It allows simplification of pointer arithmetic
My primary use case for these things involves pointers that are over-aligned to allow for efficient vectorized code generation.
Thanks again!