[llvm] [llvm] ABIInfo and TargetCodegenInfo (PR #190730)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 8 11:59:40 PDT 2026
================
@@ -0,0 +1,102 @@
+//===- ABIInfo.cpp - ABI information access & encapsulation
+//-----------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ABI/ABIInfo.h"
+
+using namespace llvm::abi;
+
+bool ABIInfo::isAggregateTypeForABI(const Type *Ty) const {
+ // Check for fundamental scalar types
+ if (Ty->isInteger() || Ty->isFloat() || Ty->isPointer() || Ty->isVector())
+ return false;
+
+ // Everything else is treated as aggregate
+ return true;
+}
+
+bool ABIInfo::isPromotableInteger(const IntegerType *IT) const {
+ unsigned BitWidth = IT->getSizeInBits().getFixedValue();
+ return BitWidth < 32;
----------------
nikic wrote:
Right. I'm talking about what the current clang codegen does (which does generate zeroext for it), not what the ABI library would do.
https://github.com/llvm/llvm-project/pull/190730
More information about the llvm-commits
mailing list