[llvm] [VPlan] Use pragma pack(1) for VPIRFlags on AIX. (PR #184687)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 13:10:49 PST 2026


================
@@ -668,6 +668,16 @@ class VPSingleDefRecipe : public VPRecipeBase, public VPRecipeValue {
 };
 
 /// Class to record and manage LLVM IR flags.
+#if defined(_AIX) && (!defined(__GNUC__) || defined(__clang__))
+// Except for GCC; by default, AIX compilers store bit-fields in 4-byte words
+// and give the `pack` pragma push semantics.
+#define BEGIN_ONE_BYTE_PACK() _Pragma("pack(1)")
+#define END_ONE_BYTE_PACK() _Pragma("pack(pop)")
+#else
+#define BEGIN_ONE_BYTE_PACK()
+#define END_ONE_BYTE_PACK()
+#endif
----------------
artagnon wrote:

There is already LLVM_PACKED in Support/Compiler.h that we can reuse?

https://github.com/llvm/llvm-project/pull/184687


More information about the llvm-commits mailing list