https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/144583
>From 80cd92fd1ea93a2f1c1b037d3a5354ee94f565f6 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 16 Jun 2025 16:39:15 -0700
Subject: [PATCH 1/3] [CIR] Add support for member initialization from
construct
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/144583
>From 389f3d95239c28415a95696cc7645e3399a5d9ab Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 16 Jun 2025 16:39:15 -0700
Subject: [PATCH 1/2] [CIR] Add support for member initialization from
construct
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/144719
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -538,6 +538,104 @@ void CIRGenFunction::emitConstructorBody(FunctionArgList
&args) {
}
}
+/// Emits the body of the current destructor.
+void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
+ const CXXDestructorDecl *dtor = cast(curGD.getDecl());
+ CXXDtorT
https://github.com/andykaylor approved this pull request.
Looks good. I just have a couple of minor suggestions.
https://github.com/llvm/llvm-project/pull/144719
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
@@ -538,6 +538,104 @@ void CIRGenFunction::emitConstructorBody(FunctionArgList
&args) {
}
}
+/// Emits the body of the current destructor.
+void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
+ const CXXDestructorDecl *dtor = cast(curGD.getDecl());
+ CXXDtorT
@@ -0,0 +1,50 @@
+// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu
-Wno-unused-value -fclangir -emit-cir -mno-constructor-aliases %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu
https://github.com/andykaylor approved this pull request.
https://github.com/llvm/llvm-project/pull/144376
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/144384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/144583
Upstream the code to handle member variable initialization in a constructor. At
this point only simple scalar values (including members of anonymous unions)
are handled.
>From 389f3d95239c28415a95696cc7645e
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/144384
>From 815c01f5041c83c1612f49ee8ccda23c8eca16c8 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 13 Jun 2025 16:03:08 -0700
Subject: [PATCH 1/2] [CIR] Handle global string literals as char array
initiali
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [
// CallOp
//===--===//
+def SE_All : I32EnumAttrCase<"All", 1, "all">;
+def SE_Pure : I32EnumAttrCase<"Pure", 2, "pure">;
+def SE_Const : I32EnumAttrCase<"
https://github.com/andykaylor approved this pull request.
Looks good to me!
https://github.com/llvm/llvm-project/pull/144519
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/144165
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2385,4 +2385,33 @@ def ComplexCreateOp : CIR_Op<"complex.create", [Pure,
SameTypeOperands]> {
let hasFolder = 1;
}
+//===--===//
+// ComplexRealPtrOp
+//===--
https://github.com/andykaylor commented:
I have concerns about the CIR representation here. I think we should be
aligning our representation of complex operations with the MLIR complex
dialect. As such, we want `__real__` to be lowerable to `complex.re` but the
explicit representation of inter
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/144235
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor approved this pull request.
https://github.com/llvm/llvm-project/pull/144223
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [
// CallOp
//===--===//
+def SE_All : I32EnumAttrCase<"All", 1, "all">;
+def SE_Pure : I32EnumAttrCase<"Pure", 2, "pure">;
+def SE_Const : I32EnumAttrCase<"
@@ -1940,22 +1975,30 @@ def CallOp : CIR_CallOpBase<"call",
[NoRegionArguments]> {
let arguments = commonArgs;
let builders = [
-// Build a call op for a direct call
-OpBuilder<(ins "mlir::SymbolRefAttr":$callee, "mlir::Type":$resType,
- "mlir::V
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [
// CallOp
//===--===//
+def SE_All : I32EnumAttrCase<"All", 1, "all">;
+def SE_Pure : I32EnumAttrCase<"Pure", 2, "pure">;
+def SE_Const : I32EnumAttrCase<"
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [
// CallOp
//===--===//
+def SE_All : I32EnumAttrCase<"All", 1, "all">;
+def SE_Pure : I32EnumAttrCase<"Pure", 2, "pure">;
+def SE_Const : I32EnumAttrCase<"
@@ -24,16 +24,17 @@ let cppNamespace = "::cir" in {
def CIRCallOpInterface : OpInterface<"CIRCallOpInterface",
[CallOpInterface]> {
// Currently we don't have any methods defined in CIRCallOpInterface. We'll
// add more methods as the upstreaming proceeds.
-let m
@@ -1940,22 +1975,30 @@ def CallOp : CIR_CallOpBase<"call",
[NoRegionArguments]> {
let arguments = commonArgs;
let builders = [
-// Build a call op for a direct call
-OpBuilder<(ins "mlir::SymbolRefAttr":$callee, "mlir::Type":$resType,
- "mlir::V
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [
// CallOp
//===--===//
+def SE_All : I32EnumAttrCase<"All", 1, "all">;
andykaylor wrote:
Can you update this to reflect the changes @xlau
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/144165
>From 92176c5b15f708afc0765dbd41e6a79c7023b700 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 13 Jun 2025 14:33:17 -0700
Subject: [PATCH 1/2] [CIR][NFC] Refactor constant pointer l-value handling
This
@@ -44,6 +68,15 @@ void ComplexExprEmitter::emitStoreOfComplex(mlir::Location
loc, mlir::Value val,
builder.createStore(loc, val, destAddr);
}
+mlir::Value ComplexExprEmitter::VisitCallExpr(const CallExpr *e) {
+ if (e->getCallReturnType(cgf.getContext())->isReferenceType(
@@ -32,6 +46,16 @@ static const ComplexType *getComplexType(QualType type) {
return cast(cast(type)->getValueType());
}
+mlir::Value ComplexExprEmitter::emitLoadOfLValue(LValue lv,
+ SourceLocation loc) {
+ assert(lv.isSimple(
@@ -96,6 +96,7 @@ class RValue {
er.isVolatile = false;
return er;
}
+
andykaylor wrote:
Not needed in this PR
https://github.com/llvm/llvm-project/pull/144225
___
cfe-commits mailing list
cfe-commits@list
@@ -50,6 +50,14 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd,
unsigned builtinID,
}
mlir::Location loc = getLoc(e->getExprLoc());
- cgm.errorNYI(loc, "non constant foldable builtin calls");
+ switch (builtinID) {
+ case Builtin::BI__builtin_complex: {
@@ -176,3 +176,27 @@ void foo7() {
// OGCG: store float %[[TMP_A]], ptr %[[C_REAL_PTR]], align 4
// OGCG: store float 2.00e+00, ptr %[[C_IMAG_PTR]], align 4
+void foo9(double r, double i) {
+ double _Complex c = __builtin_complex(r, i);
andykaylor wrote:
@@ -176,3 +176,27 @@ void foo7() {
// OGCG: store float %[[TMP_A]], ptr %[[C_REAL_PTR]], align 4
// OGCG: store float 2.00e+00, ptr %[[C_IMAG_PTR]], align 4
+void foo9(double r, double i) {
andykaylor wrote:
```suggestion
void foo9(double a, double b) {
`
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/144223
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -176,3 +176,17 @@ void foo7() {
// OGCG: store float %[[TMP_A]], ptr %[[C_REAL_PTR]], align 4
// OGCG: store float 2.00e+00, ptr %[[C_IMAG_PTR]], align 4
+void foo8() {
andykaylor wrote:
Can you add a test case for integer types?
https://github.com/ll
https://github.com/andykaylor approved this pull request.
Looks good, with request for additional test case
https://github.com/llvm/llvm-project/pull/144223
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/144384
This change adds the line of code needed to handle a string literal as an
initializer for a character array.
>From 815c01f5041c83c1612f49ee8ccda23c8eca16c8 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: F
@@ -34,28 +32,85 @@ namespace clang::CIRGen {
class RValue {
enum Flavor { Scalar, Complex, Aggregate };
- // Stores first value and flavor.
- llvm::PointerIntPair v1;
- // Stores second value and volatility.
- llvm::PointerIntPair, 1, bool> v2;
- // Stores element type
@@ -329,6 +329,222 @@ emitArrayConstant(CIRGenModule &cgm, mlir::Type
desiredType,
return {};
}
+//===--===//
+// ConstantLValueEmitter
+//===---
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/144165
This change introduces a ConstantLValueEmitter class, which will be needed for
emitting CIR for non-trivial constant pointers. This change introduces the
class with most branches reaching an NYI diagnostic.
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/144123
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/143980
>From 996df6fabc699f36ef352d73a51a2127a993b6ed Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 4 Jun 2025 10:27:48 -0700
Subject: [PATCH 1/2] [CIR] Support for static variables
This adds support for em
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/144123
A recent change has cause the begin and end iterators in the forrange.cpp CIR
codegen test to be marked as 'init' causing the test to fail. This change fixes
the checks in the test.
>From 87ae5ce9854f73d07f
https://github.com/andykaylor approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/143960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/144004
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/144004
The code to read the "nobuiltins" attributes hasn't been implemented yet, but
we were defaulting to the assumption that use of builtins is allowed for
function calls that we recognize as standard C library c
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/143980
>From 3041ad6f68f4097dadf0870177eed4e749e915cc Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 4 Jun 2025 10:27:48 -0700
Subject: [PATCH 1/2] [CIR] Support for static variables
This adds support for em
@@ -219,6 +236,252 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) {
return emitAutoVarDecl(d);
}
+static std::string getStaticDeclName(CIRGenModule &cgm, const VarDecl &d) {
+ if (cgm.getLangOpts().CPlusPlus)
+return cgm.getMangledName(&d).str();
+
+ // If this
@@ -219,6 +236,252 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) {
return emitAutoVarDecl(d);
}
+static std::string getStaticDeclName(CIRGenModule &cgm, const VarDecl &d) {
+ if (cgm.getLangOpts().CPlusPlus)
+return cgm.getMangledName(&d).str();
+
+ // If this
@@ -219,6 +236,252 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) {
return emitAutoVarDecl(d);
}
+static std::string getStaticDeclName(CIRGenModule &cgm, const VarDecl &d) {
+ if (cgm.getLangOpts().CPlusPlus)
+return cgm.getMangledName(&d).str();
+
+ // If this
@@ -208,8 +208,25 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) {
if (d.hasExternalStorage())
return;
- if (d.getStorageDuration() != SD_Automatic)
-cgm.errorNYI(d.getSourceRange(), "emitVarDecl automatic storage duration");
+ if (d.getStorageDuration() !=
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/143994
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
andykaylor wrote:
I should mention that the problem was introduced by
https://github.com/llvm/llvm-project/pull/143932
Top-of-trunk clang doesn't report an error for this situation.
https://github.com/llvm/llvm-project/pull/143994
___
cfe-commits mai
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/143994
A recent commit introduced the use of [[maybe_unused]] following
LLVM_PREFFERED_TYPE(bool) on a member variable declaration. I compiled it with
clang 14.0, which doesn't support the `preferred_type` attribut
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/143932
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/143980
This adds support for emitting static variables and their initializers.
>From 3041ad6f68f4097dadf0870177eed4e749e915cc Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 4 Jun 2025 10:27:48 -0700
Subject:
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/143932
>From 96cdd2ebeb43d2f30581c15cf290b7d0be0a5c71 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 11 Jun 2025 16:27:28 -0700
Subject: [PATCH 1/2] [CIR] Add support for delegating constructors
This change
@@ -267,23 +267,60 @@ class AggValueSlot {
Address addr;
clang::Qualifiers quals;
+ /// This is set to true if some external code is responsible for setting up a
+ /// destructor for the slot. Otherwise the code which constructs it should
+ /// push the appropriate cle
https://github.com/andykaylor approved this pull request.
Thanks!
https://github.com/llvm/llvm-project/pull/143933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor approved this pull request.
This looks good with one minor note. Sorry about the ongoing conflicts
requiring rebase. Feel free to merge after rebasing.
https://github.com/llvm/llvm-project/pull/143377
___
cfe-commits mail
@@ -246,6 +290,44 @@ void
AggExprEmitter::emitNullInitializationToLValue(mlir::Location loc,
cgf.emitNullInitialization(loc, lv.getAddress(), lv.getType());
}
+void AggExprEmitter::VisitCallExpr(const CallExpr *e) {
+ if (e->getCallReturnType(cgf.getContext())->isReference
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
assert(!cir::MissingFeatures::opCallBitcastArg());
cirCallArgs[argNo] = v;
} else {
- assert(!cir::MissingFeatures::opCallAggregateArgs());
- cgm.errorNYI("emitCa
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
assert(!cir::MissingFeatures::opCallBitcastArg());
cirCallArgs[argNo] = v;
} else {
- assert(!cir::MissingFeatures::opCallAggregateArgs());
- cgm.errorNYI("emitCa
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/143377
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/143932
This change adds the necessary support for handling delegating constructors in
ClangIR. The implementation is kept as small as possible by not handling any
other sort of initialization (members, base classes
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/143639
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -21,6 +21,88 @@
using namespace clang;
using namespace clang::CIRGen;
+/// Checks whether the given constructor is a valid subject for the
+/// complete-to-base constructor delgation optimization, i.e. emitting the
+/// complete constructor as a simple call to the base cons
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/143639
>From 7e08ebf8887cb4ef90a06b853ebacfff1e57f510 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 9 Jun 2025 09:38:55 -0700
Subject: [PATCH 1/2] [CIR] Upstream support for emitting constructors
This chang
https://github.com/andykaylor approved this pull request.
https://github.com/llvm/llvm-project/pull/143771
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor approved this pull request.
https://github.com/llvm/llvm-project/pull/143355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/143639
>From aeaef15434292dd7621541f7105356bfb1b9d57c Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 9 Jun 2025 09:38:55 -0700
Subject: [PATCH 1/2] [CIR] Upstream support for emitting constructors
This chang
@@ -21,6 +21,88 @@
using namespace clang;
using namespace clang::CIRGen;
+/// Checks whether the given constructor is a valid subject for the
+/// complete-to-base constructor delgation optimization, i.e. emitting the
+/// complete constructor as a simple call to the base cons
@@ -55,12 +59,29 @@ class CIRGenCXXABI {
return md->getParent();
}
+ /// Return whether the given global decl needs a VTT parameter.
andykaylor wrote:
It's going to look like a typo, but OK. ;-)
https://github.com/llvm/llvm-project/pull/143639
___
@@ -21,6 +21,88 @@
using namespace clang;
using namespace clang::CIRGen;
+/// Checks whether the given constructor is a valid subject for the
+/// complete-to-base constructor delgation optimization, i.e. emitting the
+/// complete constructor as a simple call to the base cons
@@ -496,6 +496,47 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl
gd, cir::FuncOp fn,
return fn;
}
+void CIRGenFunction::emitConstructorBody(FunctionArgList &args) {
+ assert(!cir::MissingFeatures::sanitizers());
+ const auto *ctor = cast(curGD.getDecl());
+
@@ -496,6 +496,47 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl
gd, cir::FuncOp fn,
return fn;
}
+void CIRGenFunction::emitConstructorBody(FunctionArgList &args) {
+ assert(!cir::MissingFeatures::sanitizers());
+ const auto *ctor = cast(curGD.getDecl());
+
@@ -72,6 +82,72 @@ void
CIRGenItaniumCXXABI::emitInstanceFunctionProlog(SourceLocation loc,
}
}
+void CIRGenItaniumCXXABI::addImplicitStructorParams(CIRGenFunction &cgf,
+QualType &retTY,
+
@@ -21,6 +21,88 @@
using namespace clang;
using namespace clang::CIRGen;
+/// Checks whether the given constructor is a valid subject for the
+/// complete-to-base constructor delgation optimization, i.e. emitting the
+/// complete constructor as a simple call to the base cons
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/143579
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor approved this pull request.
https://github.com/llvm/llvm-project/pull/139827
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -223,21 +272,114 @@ void CIRRecordLowering::fillOutputFields() {
fieldTypes.size() - 1;
// A field without storage must be a bitfield.
assert(!cir::MissingFeatures::bitfields());
+ if (!member.data)
+setBitFieldInfo(member.fieldDecl, memb
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/143579
>From 844b07e53937d3496405fd2c58148bd03c1f7407 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 9 Jun 2025 09:38:55 -0700
Subject: [PATCH 1/3] [CIR] Upstream support for calling constructors
This change
@@ -223,21 +272,114 @@ void CIRRecordLowering::fillOutputFields() {
fieldTypes.size() - 1;
// A field without storage must be a bitfield.
assert(!cir::MissingFeatures::bitfields());
+ if (!member.data)
+setBitFieldInfo(member.fieldDecl, memb
@@ -1393,6 +1393,57 @@ RValue CIRGenFunction::emitCXXMemberCallExpr(const
CXXMemberCallExpr *ce,
ce, md, returnValue, hasQualifier, qualifier, isArrow, base);
}
+void CIRGenFunction::emitCXXConstructExpr(const CXXConstructExpr *e,
+
andykaylor wrote:
Sorry for the delay in getting back to this. The summary of what I am about to
say is that I'm in agreement with the plan of moving forward with the current
implementation, but I have some lingering thoughts about it that I want to
explore.
> As you noticed, we went higher l
https://github.com/andykaylor approved this pull request.
lgtm -- thanks for sticking with this!
https://github.com/llvm/llvm-project/pull/132680
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cf
@@ -135,4 +135,38 @@ cir.func @vector_insert_element_test() {
// CHECK:cir.return
// CHECK: }
+cir.func @vector_splat_test() {
+%0 = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr>,
["a", init]
+%1 = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr>,
["shl", init]
+
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/139827
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor approved this pull request.
Other than pattern matching the value identifiers in the test, this looks good
to me.
https://github.com/llvm/llvm-project/pull/139827
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ht
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/143579
>From 844b07e53937d3496405fd2c58148bd03c1f7407 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 9 Jun 2025 09:38:55 -0700
Subject: [PATCH 1/2] [CIR] Upstream support for calling constructors
This change
@@ -76,6 +83,48 @@ static void appendParameterTypes(const CIRGenTypes &cgt,
cgt.getCGModule().errorNYI("appendParameterTypes: hasExtParameterInfos");
}
+const CIRGenFunctionInfo &
+CIRGenTypes::arrangeCXXStructorDeclaration(GlobalDecl gd) {
+ auto *md = cast(gd.getDecl());
@@ -63,3 +66,74 @@ Address CIRGenFunction::getAddressOfBaseClass(
return value;
}
+
+void CIRGenFunction::emitCXXConstructorCall(const clang::CXXConstructorDecl *d,
+clang::CXXCtorType type,
+
@@ -141,6 +190,44 @@ arrangeFreeFunctionLikeCall(CIRGenTypes &cgt, CIRGenModule
&cgm,
return cgt.arrangeCIRFunctionInfo(retType, argTypes, required);
}
+/// Arrange a call to a C++ method, passing the given arguments.
+///
+/// passProtoArgs indicates whether `args` has arg
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/143579
This change adds support for calling C++ constructors. The support for actually
defining a constructor is still missing and will be added in a later change.
>From 844b07e53937d3496405fd2c58148bd03c1f7407 Mon
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/143195
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
assert(!cir::MissingFeatures::opCallBitcastArg());
cirCallArgs[argNo] = v;
} else {
- assert(!cir::MissingFeatures::opCallAggregateArgs());
- cgm.errorNYI("emitCa
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
assert(!cir::MissingFeatures::opCallBitcastArg());
cirCallArgs[argNo] = v;
} else {
- assert(!cir::MissingFeatures::opCallAggregateArgs());
- cgm.errorNYI("emitCa
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o
%t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o %t-cir.ll
+// RUN:
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
assert(!cir::MissingFeatures::opCallBitcastArg());
cirCallArgs[argNo] = v;
} else {
- assert(!cir::MissingFeatures::opCallAggregateArgs());
- cgm.errorNYI("emitCa
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
assert(!cir::MissingFeatures::opCallBitcastArg());
cirCallArgs[argNo] = v;
} else {
- assert(!cir::MissingFeatures::opCallAggregateArgs());
- cgm.errorNYI("emitCa
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o
%t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o %t-cir.ll
+// RUN:
1 - 100 of 1444 matches
Mail list logo