@@ -73,8 +73,8 @@ def CIRFlattenCFG : Pass<"cir-flatten-cfg"> {
}
def LoweringPrepare : Pass<"cir-lowering-prepare"> {
- let summary = "Lower to more fine-grained CIR operations before lowering to
-other dialects";
+ let summary = "Lower to more fine-grained CIR operatio
https://github.com/andykaylor approved this pull request.
https://github.com/llvm/llvm-project/pull/148025
___
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/148080
___
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/148011
These decl types don't require any code generation, though when debug info is
implemented, we will need to add handling for that. Until then, we just need to
have a handler so they don't generate an NYI err
@@ -1669,6 +1669,94 @@ def GetGlobalOp : CIR_Op<"get_global",
}];
}
+//===--===//
+// SetBitfieldOp
+//===--===//
+
+def SetBitfieldOp : CI
@@ -105,6 +106,27 @@ class CIRGenFunction : public CIRGenTypeCache {
mlir::Value emitAlloca(llvm::StringRef name, mlir::Type ty,
mlir::Location loc, clang::CharUnits alignment);
+private:
+ // Track current variable initialization (if there's one)
+
@@ -2661,6 +2661,45 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt",
}];
}
+def BitReverseOp : CIR_BitOpBase<"bit.reverse",
+ CIR_UIntOfWidths<[8, 16, 32, 64]>> {
+ let summary = "Reverse the bit pattern of the operand integer";
+ let desc
https://github.com/andykaylor approved this pull request.
lgtm, apart from my request for an additional test case
https://github.com/llvm/llvm-project/pull/147609
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
@@ -1669,6 +1669,94 @@ def GetGlobalOp : CIR_Op<"get_global",
}];
}
+//===--===//
+// SetBitfieldOp
+//===--===//
+
+def SetBitfieldOp : CI
https://github.com/andykaylor commented:
I'm not sure we want to do this as part of our general canonicalization. It's a
good optimization, but I don't think this kind of thing should be happening
before the optimization phase. That may be true of most of our folders.
I suppose this is a broad
https://github.com/andykaylor approved this pull request.
I strongly approve!
https://github.com/llvm/llvm-project/pull/147365
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -82,12 +85,17 @@ llvm::LogicalResult
prepareCIRModuleDataLayout(mlir::ModuleOp mod,
// Data layout is fully determined by the target triple. Here we only pass
the
// triple to get the data layout.
+ llvm::IntrusiveRefCntPtr diagID(
+ new clang::DiagnosticIDs);
+
@@ -82,12 +85,17 @@ llvm::LogicalResult
prepareCIRModuleDataLayout(mlir::ModuleOp mod,
// Data layout is fully determined by the target triple. Here we only pass
the
// triple to get the data layout.
+ llvm::IntrusiveRefCntPtr diagID(
+ new clang::DiagnosticIDs);
+
@@ -65,6 +65,10 @@ struct CIROpAsmDialectInterface : public
OpAsmDialectInterface {
os << (boolAttr.getValue() ? "true" : "false");
return AliasResult::FinalAlias;
}
+if (auto bitfield = mlir::dyn_cast(attr)) {
andykaylor wrote:
Yes, I see
andykaylor wrote:
> Is there any reason why this is special a operation and not `cmp` operation
> parameterized by (ne, eq) as for floats, integers?
I like this suggestion.
https://github.com/llvm/llvm-project/pull/146129
___
cfe-commits mailing list
https://github.com/andykaylor approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/146167
___
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/145979
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -76,3 +77,31 @@ void def() {
T t;
U u;
}
+
+int load_field(S* s) {
+ return s->c;
andykaylor wrote:
Can you add a test case with an unsigned field?
https://github.com/llvm/llvm-project/pull/145971
___
cfe-co
@@ -2244,6 +2245,54 @@ mlir::LogicalResult
CIRToLLVMComplexImagOpLowering::matchAndRewrite(
return mlir::success();
}
+mlir::LogicalResult CIRToLLVMGetBitfieldOpLowering::matchAndRewrite(
+cir::GetBitfieldOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &r
@@ -65,6 +65,10 @@ struct CIROpAsmDialectInterface : public
OpAsmDialectInterface {
os << (boolAttr.getValue() ? "true" : "false");
return AliasResult::FinalAlias;
}
+if (auto bitfield = mlir::dyn_cast(attr)) {
andykaylor wrote:
Can you ad
@@ -2244,6 +2245,54 @@ mlir::LogicalResult
CIRToLLVMComplexImagOpLowering::matchAndRewrite(
return mlir::success();
}
+mlir::LogicalResult CIRToLLVMGetBitfieldOpLowering::matchAndRewrite(
+cir::GetBitfieldOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &r
@@ -326,13 +326,61 @@ mlir::Value
CIRGenFunction::emitStoreThroughBitfieldLValue(RValue src,
return {};
}
+RValue CIRGenFunction::emitLoadOfBitfieldLValue(LValue lv, SourceLocation loc)
{
+ const CIRGenBitFieldInfo &info = lv.getBitFieldInfo();
+
+ // Get the output type
@@ -405,6 +406,16 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
return createGlobal(module, loc, uniqueName, type, linkage);
}
+
+ mlir::Value createGetBitfield(mlir::Location loc, mlir::Type resultType,
+mlir::Value addr, mli
@@ -375,4 +375,42 @@ def CIR_VisibilityAttr : CIR_EnumAttr {
}];
}
+//===--===//
+// BitfieldInfoAttr
+//===--===//
+
+def BitfieldInfoAttr
@@ -375,4 +375,42 @@ def CIR_VisibilityAttr : CIR_EnumAttr {
}];
}
+//===--===//
+// BitfieldInfoAttr
+//===--===//
+
+def BitfieldInfoAttr
@@ -258,6 +258,30 @@ void CIRGenFunction::emitDelegateCXXConstructorCall(
/*Delegating=*/true, thisAddr, delegateArgs, loc);
}
+void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args)
{
+ const auto *assignOp = cast(curGD.getDe
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/145979
>From af4621f2944e84801f425bba3c77313ab625e714 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 16 May 2025 14:14:21 -0700
Subject: [PATCH 1/2] [CIR] Upstream support for operator assign
This adds suppo
@@ -258,6 +258,30 @@ void CIRGenFunction::emitDelegateCXXConstructorCall(
/*Delegating=*/true, thisAddr, delegateArgs, loc);
}
+void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args)
{
+ const auto *assignOp = cast(curGD.getDe
https://github.com/andykaylor approved this pull request.
Thanks for handling this!
https://github.com/llvm/llvm-project/pull/146147
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -258,6 +258,30 @@ void CIRGenFunction::emitDelegateCXXConstructorCall(
/*Delegating=*/true, thisAddr, delegateArgs, loc);
}
+void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args)
{
+ const auto *assignOp = cast(curGD.getDe
@@ -258,6 +258,30 @@ void CIRGenFunction::emitDelegateCXXConstructorCall(
/*Delegating=*/true, thisAddr, delegateArgs, loc);
}
+void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args)
{
+ const auto *assignOp = cast(curGD.getDe
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/145802
___
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/145792
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -95,6 +95,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext,
// TODO(CIR): Should be updated once TypeSizeInfoAttr is upstreamed
const unsigned sizeTypeSize =
astContext.getTypeSize(astContext.getSignedSizeType());
+ SizeSizeInBytes = astContext.toCha
@@ -95,6 +95,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext,
// TODO(CIR): Should be updated once TypeSizeInfoAttr is upstreamed
const unsigned sizeTypeSize =
astContext.getTypeSize(astContext.getSignedSizeType());
+ SizeSizeInBytes = astContext.toCha
@@ -66,6 +66,16 @@ struct CIRGenTypeCache {
unsigned char PointerSizeInBytes;
};
+ /// The size and alignment of size_t.
+ union {
+unsigned char SizeSizeInBytes; // sizeof(size_t)
andykaylor wrote:
It will eventually be used by the array cookie i
@@ -888,6 +888,69 @@ void CIRGenModule::updateCompletedType(const TagDecl *td) {
genTypes.updateCompletedType(td);
}
+void CIRGenModule::addReplacement(StringRef name, mlir::Operation *op) {
+ replacements[name] = op;
+}
+
+void CIRGenModule::replacePointerTypeArgs(cir::Fun
@@ -79,17 +79,102 @@ void
CIRGenItaniumCXXABI::emitInstanceFunctionProlog(SourceLocation loc,
}
}
+// Find out how to cirgen the complete destructor and constructor
+namespace {
+enum class StructorCIRGen { Emit, RAUW, Alias, COMDAT };
+}
+
+static StructorCIRGen getCIRGenT
https://github.com/andykaylor approved this pull request.
Thanks for the fix. For some reason my compiler (clang 14) doesn't warn about
these situations.
https://github.com/llvm/llvm-project/pull/145922
___
cfe-commits mailing list
cfe-commits@lists.l
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/145792
This change adds support for handling the -mconstructor-aliases option in CIR.
Aliases are not yet correctly lowered to LLVM IR. That will be implemented in a
future change.
>From b9fa4c7e927b01bf998380334d
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/145770
___
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/145750
This sorts the 'Misc' section of the MissingFeatures.h file lexicographically.
The goal is to reduce the number of merge conflicts we're having with this
file. Currently, we've been adding new entries at the
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/145600
___
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.
lgtm
https://github.com/llvm/llvm-project/pull/144877
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1737,25 +1737,51 @@ def GetMemberOp : CIR_Op<"get_member"> {
def FuncOp : CIR_Op<"func", [
AutomaticAllocationScope, CallableOpInterface, FunctionOpInterface,
+ DeclareOpInterfaceMethods,
IsolatedFromAbove
]> {
let summary = "Declare or define a function";
let
@@ -1737,25 +1737,51 @@ def GetMemberOp : CIR_Op<"get_member"> {
def FuncOp : CIR_Op<"func", [
AutomaticAllocationScope, CallableOpInterface, FunctionOpInterface,
+ DeclareOpInterfaceMethods,
IsolatedFromAbove
]> {
let summary = "Declare or define a function";
let
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/145551
The CIR handling of `dso_local` for globals was upstreamed without the
underscore, making it inconsistent with the incubator and LLVM IR. This change
restores the underscore.
>From f3927e3fd07cad46f183e4341
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/145560
___
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.
Thanks for handling this!
I have a minor comment, but let's just merge this as is to get the tests
passing.
https://github.com/llvm/llvm-project/pull/145560
___
cfe-commits mailing list
cfe-co
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/144583
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -778,10 +778,8 @@ void CIRRecordLowering::computeVolatileBitfields() {
!cirGenTypes.getCGModule().getCodeGenOpts().AAPCSBitfieldWidth)
return;
- for ([[maybe_unused]] auto &I : bitFields) {
+ for ([[maybe_unused]] auto &I : bitFields)
andykaylor
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/145560
___
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/144583
>From 79e712f0f3bd9ff64308a8dc30fb48eff2fd1706 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 approved this pull request.
lgtm with one nit
https://github.com/llvm/llvm-project/pull/144868
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -48,6 +55,48 @@ static const ComplexType *getComplexType(QualType type) {
return cast(cast(type)->getValueType());
}
+LValue ComplexExprEmitter::emitBinAssignLValue(const BinaryOperator *e,
+ mlir::Value &value) {
+ assert(cg
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/144868
___
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/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
1 - 100 of 1455 matches
Mail list logo