Skip to content

[llvm][docs] Expand section on non-integral pointers #73242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

danilaml
Copy link
Collaborator

Specify their restrictions w.r.t. align attribute.

@danilaml danilaml self-assigned this Nov 23, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 23, 2023

@llvm/pr-subscribers-llvm-ir

Author: Danila Malyutin (danilaml)

Changes

Specify their restrictions w.r.t. align attribute.


Full diff: https://github.com/llvm/llvm-project/pull/73242.diff

1 Files Affected:

  • (modified) llvm/docs/LangRef.rst (+6)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index bc1eab1e0b7a07f..99a7dcbc6226006 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -634,6 +634,12 @@ implementation defined, the optimizer can't do the latter.  The former is
 challenging as many commonly expected properties, such as
 ``ptrtoint(v)-ptrtoint(v) == 0``, don't hold for non-integral types.
 
+Similar restrictions apply to intrinsics that might examine the pointer bits,
+such as :ref:`llvm.ptrmask<llvm-ptrmask-intrinsic>`. In particular, it's not
+correct to infer `align` attributes for such pointers based on examining their
+bits and frontends must ensure that all `align` attributes represent the
+conservative alignment valid for every possible representation of the pointer.
+
 .. _globalvars:
 
 Global Variables

Specify their restrictions w.r.t. `align` attribute.
@danilaml danilaml force-pushed the langref-align-nonintegral branch from a0a4f7c to 1ac0e48 Compare November 23, 2023 17:34
@sanjoy sanjoy removed their request for review November 23, 2023 22:33
@sanjoy
Copy link
Contributor

sanjoy commented Nov 23, 2023

Conceptually looks fine to me but please wait for the other reviewers to take a look. I've not worked in this stuff for more than five years so it's pretty paged out.

Copy link
Contributor

@arpilipe arpilipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually looks good. Minor suggestion about the wording inline.

@danilaml danilaml merged commit 6b4b6d9 into llvm:main Dec 5, 2023
@danilaml danilaml deleted the langref-align-nonintegral branch December 5, 2023 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants