[llvm] [DataLayout] Remove i1 alignment entry (PR #156657)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 07:44:23 PDT 2025


https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/156657

>From 495b15c08826bedccdf90a57d5cc9a800918d2c4 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Wed, 3 Sep 2025 14:41:54 +0200
Subject: [PATCH 1/2] [DataLayout] Remove i1 alignment entry

I don't think we need to explicitly specify i1 alignment, as this
is going to fall back to i8 alignment.

This may change behavior if a data layout explicitly sets i8 alignment
without also setting i1 layout, but I'd expect this to be a bug
fix in that case.
---
 llvm/lib/IR/DataLayout.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index ee43ad49d0df2..38f33f96fca7d 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -187,7 +187,6 @@ const char *DataLayout::getManglingComponent(const Triple &T) {
 // Default primitive type specifications.
 // NOTE: These arrays must be sorted by type bit width.
 constexpr DataLayout::PrimitiveSpec DefaultIntSpecs[] = {
-    {1, Align::Constant<1>(), Align::Constant<1>()},  // i1:8:8
     {8, Align::Constant<1>(), Align::Constant<1>()},  // i8:8:8
     {16, Align::Constant<2>(), Align::Constant<2>()}, // i16:16:16
     {32, Align::Constant<4>(), Align::Constant<4>()}, // i32:32:32

>From b11f216a27c21aad39dadea15e221ec8b524a597 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Thu, 4 Sep 2025 16:43:59 +0200
Subject: [PATCH 2/2] Also drop bullet point in LangRef

---
 llvm/docs/LangRef.rst | 1 -
 1 file changed, 1 deletion(-)

diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index e64b9343b7622..f708c8e8b8ec1 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -3273,7 +3273,6 @@ specifications are given in this list:
 -  ``p[n]:64:64:64`` - Other address spaces are assumed to be the
    same as the default address space.
 -  ``S0`` - natural stack alignment is unspecified
--  ``i1:8:8`` - i1 is 8-bit (byte) aligned
 -  ``i8:8:8`` - i8 is 8-bit (byte) aligned as mandated
 -  ``i16:16:16`` - i16 is 16-bit aligned
 -  ``i32:32:32`` - i32 is 32-bit aligned



More information about the llvm-commits mailing list