[llvm] [LangRef] Clarify requirement for non-pow-2 align bundle (PR #195631)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 03:46:07 PDT 2026


https://github.com/nikic created https://github.com/llvm/llvm-project/pull/195631

Now that null pointers are not necessarily zero pointers, I believe that `"align"` with a non-power-of-two alignment should be requiring a zero pointer specifically, not a null pointer.

This is because a zero pointer is aligned for any alignment (which we can generalize to non-power-of-two alignments), while a -1 null pointer only has alignment 1.

>From 9a108423f99be8baea5dd3cc76b331e27c3a8207 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Mon, 4 May 2026 12:42:36 +0200
Subject: [PATCH] [LangRef] Clarify requirement for non-pow-2 align bundle

Now that null pointers are not necessarily zero pointers, I believe
that `"align"` with a non-power-of-two alignment should be requiring
a zero pointer specifically, not a null pointer.

This is because a zero pointer is aligned for any alignment (which
we can generalize to non-power-of-two alignments), while a -1
null pointer only has alignment 1.
---
 llvm/docs/LangRef.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index a1442a2a607d3..912cca72e1ad5 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -3152,7 +3152,7 @@ the behavior is undefined, unless one of the following exceptions applies:
 
 * ``"align"`` operand bundles may specify a non-power-of-two alignment
   (including a zero alignment). If this is the case, then the pointer value
-  must be a null pointer, otherwise the behavior is undefined.
+  must be an all-zero pointer, otherwise the behavior is undefined.
 
 * ``dereferenceable(<n>)`` operand bundles only guarantee the pointer is
   dereferenceable at the point of the assumption. The pointer may not be



More information about the llvm-commits mailing list