https://github.com/andykaylor updated 
https://github.com/llvm/llvm-project/pull/224121

>From 9999df67ce590839d3df33d5a4af4daf83316bcb Mon Sep 17 00:00:00 2001
From: Andy Kaylor <[email protected]>
Date: Mon, 14 Sep 2026 14:07:18 -0700
Subject: [PATCH 1/2] [LLVMABI][AARCH64] Add Clang 23 compatible handling for
 matrix types

This change updates the LLVM ABI library to enable Clang 23 compatible
classification of matrix types when the `-fclang-abi-compt=23` option is
used. Clang versions 23 and earlier did not accept matrix types as base
types for homogeneous aggregates, but the current version does. The LLVM
ABI library use the new behavior when isHomogeneousAggregate was introduced
there. This change adds an ABICompatInfo setting to allow version 23
compatibility to be implemented.

This change also moves X86-specific ABI compatibility options into an
X86-specific subclass of ABICompatInfo.

Assisted-by: Cursor / various models
---
 clang/include/clang/CIR/Dialect/Passes.h      |  3 +-
 .../Transforms/CallConvLoweringPass.cpp       |  7 ++--
 clang/lib/CIR/Lowering/CIRPasses.cpp          |  4 +--
 clang/lib/CodeGen/CodeGenModule.cpp           |  5 ++-
 .../AArch64/abi-lowering-matrix-ha-compat23.c | 29 +++++++++++++++
 llvm/include/llvm/ABI/TargetInfo.h            | 35 ++++++++++++-------
 llvm/lib/ABI/TargetInfo.cpp                   |  4 ++-
 llvm/lib/ABI/Targets/AArch64.cpp              |  4 +++
 llvm/lib/ABI/Targets/BPF.cpp                  |  4 +++
 llvm/lib/ABI/Targets/X86.cpp                  | 32 ++++++++++-------
 llvm/unittests/ABI/X86TargetInfoTest.cpp      |  5 +--
 11 files changed, 97 insertions(+), 35 deletions(-)
 create mode 100644 clang/test/CodeGen/AArch64/abi-lowering-matrix-ha-compat23.c

diff --git a/clang/include/clang/CIR/Dialect/Passes.h 
b/clang/include/clang/CIR/Dialect/Passes.h
index 674f2180c27ab..99fc0ea035c30 100644
--- a/clang/include/clang/CIR/Dialect/Passes.h
+++ b/clang/include/clang/CIR/Dialect/Passes.h
@@ -38,7 +38,8 @@ std::unique_ptr<Pass> createTargetLoweringPass();
 std::unique_ptr<Pass> createCallConvLoweringPass();
 std::unique_ptr<Pass> createCallConvLoweringPass(
     cir::CallConvTarget target, llvm::abi::X86AVXABILevel x86AvxAbiLevel,
-    bool allowsX86TargetAttrAvx, const llvm::abi::ABICompatInfo &x86AbiCompat);
+    bool allowsX86TargetAttrAvx,
+    const llvm::abi::X86ABICompatInfo &x86AbiCompat);
 std::unique_ptr<Pass> createHoistAllocasPass();
 std::unique_ptr<Pass> createLoweringPreparePass();
 std::unique_ptr<Pass> createLoweringPreparePass(clang::ASTContext *astCtx);
diff --git a/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp 
b/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
index f51ee6f9169a3..54c8a698e7508 100644
--- a/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
+++ b/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
@@ -788,7 +788,7 @@ struct CallConvLoweringPass
   using CallConvLoweringBase::CallConvLoweringBase;
 
   CallConvLoweringPass(const CallConvLoweringOptions &options,
-                       const llvm::abi::ABICompatInfo &x86AbiCompat)
+                       const llvm::abi::X86ABICompatInfo &x86AbiCompat)
       : CallConvLoweringBase(options), x86AbiCompat(x86AbiCompat) {}
 
   void runOnOperation() override;
@@ -797,7 +797,7 @@ struct CallConvLoweringPass
   /// compatibility version.  Carried outside the pass options because the
   /// struct has no command-line parser, so a cir-opt run gets the library
   /// defaults rather than a target's values.
-  llvm::abi::ABICompatInfo x86AbiCompat;
+  llvm::abi::X86ABICompatInfo x86AbiCompat;
 };
 
 /// Record on \p fc whether \p returnType is CIR's void.  The x86_64 classifier
@@ -1168,7 +1168,8 @@ std::unique_ptr<Pass> mlir::createCallConvLoweringPass() {
 
 std::unique_ptr<Pass> mlir::createCallConvLoweringPass(
     cir::CallConvTarget target, llvm::abi::X86AVXABILevel x86AvxAbiLevel,
-    bool allowsX86TargetAttrAvx, const llvm::abi::ABICompatInfo &x86AbiCompat) 
{
+    bool allowsX86TargetAttrAvx,
+    const llvm::abi::X86ABICompatInfo &x86AbiCompat) {
   CallConvLoweringOptions options;
   options.target = target;
   options.x86AvxAbiLevel = x86AvxAbiLevel;
diff --git a/clang/lib/CIR/Lowering/CIRPasses.cpp 
b/clang/lib/CIR/Lowering/CIRPasses.cpp
index d164d55f512cc..9b5a17dec67af 100644
--- a/clang/lib/CIR/Lowering/CIRPasses.cpp
+++ b/clang/lib/CIR/Lowering/CIRPasses.cpp
@@ -54,12 +54,12 @@ static bool allowsX86TargetAttrAvx(const clang::ASTContext 
&astContext) {
 /// library, which is not what any target computes: Clang11Compat is false for 
a
 /// modern Linux target, so leaving it at the default classifies a union larger
 /// than an eightbyte as though every member spanned its size.
-static llvm::abi::ABICompatInfo
+static llvm::abi::X86ABICompatInfo
 getX86ABICompatInfo(const clang::ASTContext &astContext) {
   const llvm::Triple &triple = astContext.getTargetInfo().getTriple();
   const clang::LangOptions &langOpts = astContext.getLangOpts();
   clang::LangOptions::ClangABI compat = langOpts.getClangABICompat();
-  llvm::abi::ABICompatInfo abiCompat;
+  llvm::abi::X86ABICompatInfo abiCompat;
   abiCompat.HonorsRevision98 = !triple.isOSDarwin();
   abiCompat.ClassifyIntegerMMXAsSSE =
       compat > clang::LangOptions::ClangABI::Ver3_8 && !triple.isOSDarwin() &&
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index 7bb0e9d8ff560..be15ed96caec0 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -411,6 +411,9 @@ CodeGenModule::getLLVMABITargetInfo(llvm::abi::TypeBuilder 
&TB) {
     Opts.IsILP32 = T.getArch() == llvm::Triple::aarch64_32;
     Opts.IsMicrosoftCXXABI = getTarget().getCXXABI().isMicrosoft();
 
+    Opts.CompatInfo.IsMatrixHA =
+        getLangOpts().getClangABICompat() > LangOptions::ClangABI::Ver23;
+
     TheLLVMABITargetInfo = llvm::abi::createAArch64TargetInfo(TB, Opts);
     return *TheLLVMABITargetInfo;
   }
@@ -427,7 +430,7 @@ CodeGenModule::getLLVMABITargetInfo(llvm::abi::TypeBuilder 
&TB) {
         : ABI == "avx"  ? llvm::abi::X86AVXABILevel::AVX
                         : llvm::abi::X86AVXABILevel::None;
 
-    llvm::abi::ABICompatInfo CompatInfo;
+    llvm::abi::X86ABICompatInfo CompatInfo;
     LangOptions::ClangABI Compat = getLangOpts().getClangABICompat();
     CompatInfo.ClassifyIntegerMMXAsSSE =
         Compat > LangOptions::ClangABI::Ver3_8 && !T.isOSDarwin() &&
diff --git a/clang/test/CodeGen/AArch64/abi-lowering-matrix-ha-compat23.c 
b/clang/test/CodeGen/AArch64/abi-lowering-matrix-ha-compat23.c
new file mode 100644
index 0000000000000..78a33f48f45a4
--- /dev/null
+++ b/clang/test/CodeGen/AArch64/abi-lowering-matrix-ha-compat23.c
@@ -0,0 +1,29 @@
+// REQUIRES: asserts
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -fenable-matrix 
-fexperimental-abi-lowering -emit-llvm -o - %s 2>&1 | FileCheck %s 
--check-prefix=LATEST --implicit-check-not="not yet implemented"
+// RUN: not --crash %clang_cc1 -triple aarch64-linux-gnu -fclang-abi-compat=23 
-fenable-matrix -fexperimental-abi-lowering -emit-llvm -o - %s 2>&1 | FileCheck 
%s --check-prefix=COMPAT23
+// RUN: %clang_cc1 -triple arm64-apple-ios -target-abi darwinpcs 
-fenable-matrix -fexperimental-abi-lowering -emit-llvm -o - %s 2>&1 | FileCheck 
%s --check-prefix=LATEST --implicit-check-not="not yet implemented"
+// RUN: not --crash %clang_cc1 -triple arm64-apple-ios -target-abi darwinpcs 
-fclang-abi-compat=23 -fenable-matrix -fexperimental-abi-lowering -emit-llvm -o 
- %s 2>&1 | FileCheck %s --check-prefix=COMPAT23
+
+// This is a temporary test to exercise ABI compatibility handling of matrix
+// types. Clang 23 and earlier did not accept matrix types as HFA base types,
+// but they are now accepted as HFA base types now. When the LLVM ABI library
+// rejects a matrix type as an HFA base type, it falls through to a
+// "not yet implemented" diagnostic, and the Clang asserts because the
+// library's classification does not match Clang's classification.
+//
+// When the AArch64 classification is completed in the ABI library, this test
+// will be removed and test cases will be added elsewhere to verify that the
+// classification matches Clang's classification when the ABI compatibility
+// flag is used.
+
+typedef float fx2x2_t __attribute__((matrix_type(2, 2)));
+struct MatrixStruct {
+  fx2x2_t m;
+};
+
+struct MatrixStruct ret_matrix_struct(void) {
+  struct MatrixStruct s;
+  return s;
+}
+// LATEST: define{{.*}} %struct.MatrixStruct @ret_matrix_struct()
+// COMPAT23: Aggregate return type handling is not yet implemented for AArch64 
in the LLVM ABI library.
diff --git a/llvm/include/llvm/ABI/TargetInfo.h 
b/llvm/include/llvm/ABI/TargetInfo.h
index 61f41992f2107..9dbd7a7fedd2e 100644
--- a/llvm/include/llvm/ABI/TargetInfo.h
+++ b/llvm/include/llvm/ABI/TargetInfo.h
@@ -37,10 +37,20 @@ enum RecordArgABI {
   RAA_Indirect
 };
 
-/// Flags controlling target-specific ABI compatibility behaviour.
+/// Flags controlling ABI compatibility behaviour that applies to every target.
+/// Targets with compatibility flags of their own extend this with a derived
+/// structure.
+struct ABICompatInfo {
+  /// Whether a matrix type may be the base type of a homogeneous aggregate.
+  bool IsMatrixHA : 1;
+
+  ABICompatInfo() : IsMatrixHA(true) {}
+};
+
+/// Flags controlling X86-specific ABI compatibility behaviour.
 /// Construct with the default constructor for the current ABI, or use
 /// fromVersion() to get the flags that match a specific Clang version.
-struct ABICompatInfo {
+struct X86ABICompatInfo : ABICompatInfo {
   bool PassInt128VectorsInMem : 1;
   bool ReturnCXXRecordGreaterThan128InMem : 1;
   bool ClassifyIntegerMMXAsSSE : 1;
@@ -48,29 +58,24 @@ struct ABICompatInfo {
   bool Clang11Compat : 1;
   bool ClassifyUnnamedBitFields : 1;
 
-  ABICompatInfo()
+  X86ABICompatInfo()
       : PassInt128VectorsInMem(true), ReturnCXXRecordGreaterThan128InMem(true),
         ClassifyIntegerMMXAsSSE(true), HonorsRevision98(true),
         Clang11Compat(true), ClassifyUnnamedBitFields(true) {}
 
   /// Return flags matching the ABI emitted by the given Clang major version.
   // TODO: fill in per-version flag overrides.
-  static ABICompatInfo fromVersion(unsigned /*ClangMajor*/) {
-    return ABICompatInfo();
+  static X86ABICompatInfo fromVersion(unsigned /*ClangMajor*/) {
+    return X86ABICompatInfo();
   }
 };
 
 class TargetInfo {
-private:
-  ABICompatInfo CompatInfo;
-
 protected:
   TypeBuilder &TB;
 
 public:
-  explicit TargetInfo(TypeBuilder &Builder) : CompatInfo(), TB(Builder) {}
-  TargetInfo(TypeBuilder &Builder, const ABICompatInfo &Info)
-      : CompatInfo(Info), TB(Builder) {}
+  explicit TargetInfo(TypeBuilder &Builder) : TB(Builder) {}
 
   virtual ~TargetInfo() = default;
 
@@ -78,7 +83,10 @@ class TargetInfo {
   /// and return value.
   virtual void computeInfo(FunctionInfo &FI) const = 0;
   virtual bool isPassByRef(const Type *Ty) const { return false; }
-  const ABICompatInfo &getABICompatInfo() const { return CompatInfo; }
+
+  /// Return this target's ABI compatibility flags. Targets with extra flags
+  /// store a derived object and return that as an ABICompatInfo reference.
+  virtual const ABICompatInfo &getABICompatInfo() const = 0;
 
 protected:
   LLVM_ABI RecordArgABI getRecordArgABI(const RecordType *RT) const;
@@ -137,7 +145,7 @@ enum class X86AVXABILevel {
 
 LLVM_ABI std::unique_ptr<TargetInfo>
 createX86_64TargetInfo(TypeBuilder &TB, X86AVXABILevel AVXLevel,
-                       bool Has64BitPointers, const ABICompatInfo &Compat);
+                       bool Has64BitPointers, const X86ABICompatInfo &Compat);
 
 enum class AArch64ABIKind {
   AAPCS = 0,
@@ -153,6 +161,7 @@ struct AArch64ABIOptions {
   AArch64ABIKind Kind = AArch64ABIKind::AAPCS;
   bool IsILP32 = false;
   bool IsMicrosoftCXXABI = false;
+  ABICompatInfo CompatInfo;
 
   AArch64ABIOptions() = default;
   explicit AArch64ABIOptions(AArch64ABIKind Kind) : Kind(Kind) {}
diff --git a/llvm/lib/ABI/TargetInfo.cpp b/llvm/lib/ABI/TargetInfo.cpp
index 9e8325eefc021..9ad8cb8f5829a 100644
--- a/llvm/lib/ABI/TargetInfo.cpp
+++ b/llvm/lib/ABI/TargetInfo.cpp
@@ -102,8 +102,10 @@ bool isEmptyRecordForHA(const Type *Ty) {
 
 bool TargetInfo::isHomogeneousAggregate(const Type *Ty, const Type *&Base,
                                         uint64_t &Members) const {
-  // TODO: Add handling for Clang 23 compatibility with matrix types.
+  bool isMatrixHA = getABICompatInfo().IsMatrixHA;
   if (const auto *AT = dyn_cast<ArrayType>(Ty)) {
+    if (!isMatrixHA && AT->isMatrixType())
+      return false;
     uint64_t NElements = AT->getNumElements();
     if (NElements == 0)
       return false;
diff --git a/llvm/lib/ABI/Targets/AArch64.cpp b/llvm/lib/ABI/Targets/AArch64.cpp
index 9faea71ec9b51..56321bc1f4d72 100644
--- a/llvm/lib/ABI/Targets/AArch64.cpp
+++ b/llvm/lib/ABI/Targets/AArch64.cpp
@@ -24,6 +24,10 @@ class AArch64TargetInfo : public TargetInfo {
   AArch64TargetInfo(TypeBuilder &TB, const AArch64ABIOptions &Opts)
       : TargetInfo(TB), Opts(Opts) {}
 
+  const ABICompatInfo &getABICompatInfo() const override {
+    return Opts.CompatInfo;
+  }
+
   void computeInfo(FunctionInfo &FI) const override {
     if (!maybeCommonClassifyReturnType(FI))
       FI.getReturnInfo() =
diff --git a/llvm/lib/ABI/Targets/BPF.cpp b/llvm/lib/ABI/Targets/BPF.cpp
index 70b838a5abd20..ecaf44eed1960 100644
--- a/llvm/lib/ABI/Targets/BPF.cpp
+++ b/llvm/lib/ABI/Targets/BPF.cpp
@@ -16,6 +16,8 @@ namespace llvm::abi {
 
 class BPFTargetInfo : public TargetInfo {
 private:
+  ABICompatInfo CompatInfo;
+
   ArgInfo classifyReturnType(const Type *RetTy) const {
     if (RetTy->isVoid())
       return ArgInfo::getIgnore();
@@ -72,6 +74,8 @@ class BPFTargetInfo : public TargetInfo {
 public:
   BPFTargetInfo(TypeBuilder &Builder) : TargetInfo(Builder) {}
 
+  const ABICompatInfo &getABICompatInfo() const override { return CompatInfo; }
+
   void computeInfo(FunctionInfo &FI) const override {
     FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
     for (auto &I : FI.arguments())
diff --git a/llvm/lib/ABI/Targets/X86.cpp b/llvm/lib/ABI/Targets/X86.cpp
index 08a5e20cb9070..c1f30892d454a 100644
--- a/llvm/lib/ABI/Targets/X86.cpp
+++ b/llvm/lib/ABI/Targets/X86.cpp
@@ -74,6 +74,7 @@ class X86_64TargetInfo : public TargetInfo {
 private:
   X86AVXABILevel AVXLevel;
   bool Has64BitPointers;
+  X86ABICompatInfo X86CompatInfo;
 
   static Class merge(Class Accum, Class Field);
 
@@ -111,11 +112,17 @@ class X86_64TargetInfo : public TargetInfo {
 
 public:
   X86_64TargetInfo(TypeBuilder &TypeBuilder, X86AVXABILevel AVXABILevel,
-                   bool Has64BitPtrs, const ABICompatInfo &Compat)
-      : TargetInfo(TypeBuilder, Compat), AVXLevel(AVXABILevel),
-        Has64BitPointers(Has64BitPtrs) {}
+                   bool Has64BitPtrs, const X86ABICompatInfo &Compat)
+      : TargetInfo(TypeBuilder), AVXLevel(AVXABILevel),
+        Has64BitPointers(Has64BitPtrs), X86CompatInfo(Compat) {}
 
   bool has64BitPointers() const { return Has64BitPointers; }
+
+  const ABICompatInfo &getABICompatInfo() const override {
+    return X86CompatInfo;
+  }
+
+  const X86ABICompatInfo &getX86ABICompatInfo() const { return X86CompatInfo; }
 };
 
 static bool bitsContainNoUserData(const Type *Ty, unsigned StartBit,
@@ -192,7 +199,7 @@ void X86_64TargetInfo::postMerge(unsigned AggregateSize, 
Class &Lo,
 
   if (Hi == Memory)
     Lo = Memory;
-  if (Hi == X87Up && Lo != X87 && getABICompatInfo().HonorsRevision98)
+  if (Hi == X87Up && Lo != X87 && getX86ABICompatInfo().HonorsRevision98)
     Lo = Memory;
   if (AggregateSize > 128 && (Lo != Sse || Hi != SseUp))
     Lo = Memory;
@@ -359,7 +366,7 @@ void X86_64TargetInfo::classify(const Type *T, uint64_t 
OffsetBase, Class &Lo,
       // platform compiler, we must continue to use integer.
       if (const auto *IT = dyn_cast<IntegerType>(ElementType)) {
         uint64_t ElemBits = IT->getSizeInBits().getFixedValue();
-        if (!getABICompatInfo().ClassifyIntegerMMXAsSSE && ElemBits == 64 &&
+        if (!getX86ABICompatInfo().ClassifyIntegerMMXAsSSE && ElemBits == 64 &&
             !IT->isBitInt()) {
           Current = Integer;
         } else {
@@ -377,7 +384,7 @@ void X86_64TargetInfo::classify(const Type *T, uint64_t 
OffsetBase, Class &Lo,
       if (const auto *IT = dyn_cast<IntegerType>(ElementType)) {
         uint64_t ElemBits = IT->getSizeInBits().getFixedValue();
         // gcc passes 256 and 512 bit <X x __int128> vectors in memory. :(
-        if (getABICompatInfo().PassInt128VectorsInMem && Size != 128 &&
+        if (getX86ABICompatInfo().PassInt128VectorsInMem && Size != 128 &&
             ElemBits == 128 && !IT->isBitInt())
           return;
       }
@@ -534,7 +541,7 @@ void X86_64TargetInfo::classify(const Type *T, uint64_t 
OffsetBase, Class &Lo,
         Lo = merge(Lo, FieldLo);
         Hi = merge(Hi, FieldHi);
 
-        if (getABICompatInfo().ReturnCXXRecordGreaterThan128InMem &&
+        if (getX86ABICompatInfo().ReturnCXXRecordGreaterThan128InMem &&
             (Size > 128 &&
              (Size != Base.FieldType->getSizeInBits().getFixedValue() ||
               Size > getNativeVectorSizeForAVXABI(AVXLevel))))
@@ -549,7 +556,7 @@ void X86_64TargetInfo::classify(const Type *T, uint64_t 
OffsetBase, Class &Lo,
 
     // Classify the fields one at a time, merging the results.
 
-    bool IsUnion = RT->isUnion() && !getABICompatInfo().Clang11Compat;
+    bool IsUnion = RT->isUnion() && !getX86ABICompatInfo().Clang11Compat;
     for (const auto &Field : RT->getFields()) {
       uint64_t Offset = OffsetBase + Field.OffsetInBits;
       bool BitField = Field.IsBitField;
@@ -557,7 +564,7 @@ void X86_64TargetInfo::classify(const Type *T, uint64_t 
OffsetBase, Class &Lo,
       // Ignore padding bit-fields. Normally only zero-length bit-fields are
       // padding, but under Clang 23 compatibility every unnamed bit-field is,
       // faithfully reproducing Clang 23.
-      if (BitField && (getABICompatInfo().ClassifyUnnamedBitFields
+      if (BitField && (getX86ABICompatInfo().ClassifyUnnamedBitFields
                            ? Field.BitFieldWidth == 0
                            : Field.IsUnnamedBitfield))
         continue;
@@ -1230,7 +1237,7 @@ const Type *X86_64TargetInfo::getByteVectorType(const 
Type *Ty) const {
   if (const VectorType *VT = dyn_cast<VectorType>(Ty)) {
     // Don't pass vXi128 vectors in their native type, the backend can't
     // legalize them.
-    if (getABICompatInfo().PassInt128VectorsInMem &&
+    if (getX86ABICompatInfo().PassInt128VectorsInMem &&
         VT->getElementType()->isInteger() &&
         cast<IntegerType>(VT->getElementType())->getSizeInBits() == 128) {
       unsigned Size = VT->getSizeInBits().getFixedValue();
@@ -1318,7 +1325,7 @@ bool X86_64TargetInfo::isIllegalVectorType(const Type 
*Ty) const {
 
     // Check for 128-bit integer element vectors that should be passed in 
memory
     const Type *EltTy = VecTy->getElementType();
-    if (getABICompatInfo().PassInt128VectorsInMem && EltTy->isInteger()) {
+    if (getX86ABICompatInfo().PassInt128VectorsInMem && EltTy->isInteger()) {
       const auto *IntTy = cast<IntegerType>(EltTy);
       if (IntTy->getSizeInBits().getFixedValue() == 128)
         return true;
@@ -1462,7 +1469,8 @@ void X86_64TargetInfo::computeInfo(FunctionInfo &FI) 
const {
 
 std::unique_ptr<TargetInfo>
 createX86_64TargetInfo(TypeBuilder &TB, X86AVXABILevel AVXLevel,
-                       bool Has64BitPointers, const ABICompatInfo &Compat) {
+                       bool Has64BitPointers,
+                       const X86ABICompatInfo &Compat) {
   return std::make_unique<X86_64TargetInfo>(TB, AVXLevel, Has64BitPointers,
                                             Compat);
 }
diff --git a/llvm/unittests/ABI/X86TargetInfoTest.cpp 
b/llvm/unittests/ABI/X86TargetInfoTest.cpp
index 0ee99d1f7a9e3..d4e299fd76af4 100644
--- a/llvm/unittests/ABI/X86TargetInfoTest.cpp
+++ b/llvm/unittests/ABI/X86TargetInfoTest.cpp
@@ -22,7 +22,6 @@ namespace {
 using namespace llvm;
 
 using ABIType = llvm::abi::Type;
-using llvm::abi::ABICompatInfo;
 using llvm::abi::ArgInfo;
 using llvm::abi::createX86_64TargetInfo;
 using llvm::abi::FieldInfo;
@@ -31,6 +30,7 @@ using llvm::abi::RecordFlags;
 using llvm::abi::StructPacking;
 using llvm::abi::TargetInfo;
 using llvm::abi::TypeBuilder;
+using llvm::abi::X86ABICompatInfo;
 using llvm::abi::X86AVXABILevel;
 
 class X86TargetInfoTest : public ::testing::Test {
@@ -64,7 +64,8 @@ class X86TargetInfoTest : public ::testing::Test {
   std::unique_ptr<TargetInfo> target() const {
     return createX86_64TargetInfo(const_cast<TypeBuilder &>(TB),
                                   X86AVXABILevel::None,
-                                  /*Has64BitPointers=*/true, ABICompatInfo());
+                                  /*Has64BitPointers=*/true,
+                                  X86ABICompatInfo());
   }
 
   const ABIType *unionOf(llvm::ArrayRef<FieldInfo> Fields, uint64_t SizeInBits,

>From 9fb8e8ec66d80efd5cf5225c854e15e9968ead3e Mon Sep 17 00:00:00 2001
From: Andy Kaylor <[email protected]>
Date: Wed, 16 Sep 2026 22:06:05 -0700
Subject: [PATCH 2/2] Fix formatting

---
 clang/include/clang/CIR/Dialect/Passes.h | 9 +++++----
 llvm/lib/ABI/Targets/X86.cpp             | 3 +--
 llvm/unittests/ABI/X86TargetInfoTest.cpp | 7 +++----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/clang/include/clang/CIR/Dialect/Passes.h 
b/clang/include/clang/CIR/Dialect/Passes.h
index 99fc0ea035c30..42dd338306456 100644
--- a/clang/include/clang/CIR/Dialect/Passes.h
+++ b/clang/include/clang/CIR/Dialect/Passes.h
@@ -36,10 +36,11 @@ std::unique_ptr<Pass> createCIREHABILoweringPass();
 std::unique_ptr<Pass> createCXXABILoweringPass();
 std::unique_ptr<Pass> createTargetLoweringPass();
 std::unique_ptr<Pass> createCallConvLoweringPass();
-std::unique_ptr<Pass> createCallConvLoweringPass(
-    cir::CallConvTarget target, llvm::abi::X86AVXABILevel x86AvxAbiLevel,
-    bool allowsX86TargetAttrAvx,
-    const llvm::abi::X86ABICompatInfo &x86AbiCompat);
+std::unique_ptr<Pass>
+createCallConvLoweringPass(cir::CallConvTarget target,
+                           llvm::abi::X86AVXABILevel x86AvxAbiLevel,
+                           bool allowsX86TargetAttrAvx,
+                           const llvm::abi::X86ABICompatInfo &x86AbiCompat);
 std::unique_ptr<Pass> createHoistAllocasPass();
 std::unique_ptr<Pass> createLoweringPreparePass();
 std::unique_ptr<Pass> createLoweringPreparePass(clang::ASTContext *astCtx);
diff --git a/llvm/lib/ABI/Targets/X86.cpp b/llvm/lib/ABI/Targets/X86.cpp
index c1f30892d454a..4ad763167b96f 100644
--- a/llvm/lib/ABI/Targets/X86.cpp
+++ b/llvm/lib/ABI/Targets/X86.cpp
@@ -1469,8 +1469,7 @@ void X86_64TargetInfo::computeInfo(FunctionInfo &FI) 
const {
 
 std::unique_ptr<TargetInfo>
 createX86_64TargetInfo(TypeBuilder &TB, X86AVXABILevel AVXLevel,
-                       bool Has64BitPointers,
-                       const X86ABICompatInfo &Compat) {
+                       bool Has64BitPointers, const X86ABICompatInfo &Compat) {
   return std::make_unique<X86_64TargetInfo>(TB, AVXLevel, Has64BitPointers,
                                             Compat);
 }
diff --git a/llvm/unittests/ABI/X86TargetInfoTest.cpp 
b/llvm/unittests/ABI/X86TargetInfoTest.cpp
index d4e299fd76af4..88d038648ad60 100644
--- a/llvm/unittests/ABI/X86TargetInfoTest.cpp
+++ b/llvm/unittests/ABI/X86TargetInfoTest.cpp
@@ -62,10 +62,9 @@ class X86TargetInfoTest : public ::testing::Test {
                                    {}, RecordFlags::CanPassInRegisters)) {}
 
   std::unique_ptr<TargetInfo> target() const {
-    return createX86_64TargetInfo(const_cast<TypeBuilder &>(TB),
-                                  X86AVXABILevel::None,
-                                  /*Has64BitPointers=*/true,
-                                  X86ABICompatInfo());
+    return createX86_64TargetInfo(
+        const_cast<TypeBuilder &>(TB), X86AVXABILevel::None,
+        /*Has64BitPointers=*/true, X86ABICompatInfo());
   }
 
   const ABIType *unionOf(llvm::ArrayRef<FieldInfo> Fields, uint64_t SizeInBits,

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to