[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/138222 >From b3ae2d60a178f3c5bb8950804041386a667abc6e Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 29 Apr 2025 15:47:01 -0700 Subject: [PATCH 1/2] [CIR] Refactor global variable emission and initialization

[clang] [CIR] Upstream support for range-based for loops (PR #138176)

2025-05-01 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/138176 Rate limit ยท GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,san

[clang] [CIR] Upstream support for switch statements case kinds (PR #138003)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -428,6 +429,52 @@ mlir::LogicalResult CIRGenFunction::emitBreakStmt(const clang::BreakStmt &s) { return mlir::success(); } +const CaseStmt *CIRGenFunction::foldCaseStmt(const clang::CaseStmt &s, + mlir::Type condType, +

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/138222 >From b3ae2d60a178f3c5bb8950804041386a667abc6e Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 29 Apr 2025 15:47:01 -0700 Subject: [PATCH 1/3] [CIR] Refactor global variable emission and initialization

[clang] [CIR] Upstream local initialization for VectorType (PR #138107)

2025-05-01 Thread Andy Kaylor via cfe-commits
@@ -39,23 +39,43 @@ vi4 d = { 1, 2, 3, 4 }; // OGCG: @[[VEC_D:.*]] = global <4 x i32> -void vec_int_test() { +int x = 5; + +void foo() { vi4 a; vd2 b; vll2 c; + + vi4 d = { 1, 2, 3, 4 }; + + vi4 e = { x, 5, 6, x + 1 }; andykaylor wrote: Can you a

[clang] [CIR] Upstream local initialization for VectorType (PR #138107)

2025-05-01 Thread Andy Kaylor via cfe-commits
@@ -1584,6 +1586,47 @@ mlir::Value ScalarExprEmitter::VisitMemberExpr(MemberExpr *e) { return emitLoadOfLValue(e); } +mlir::Value ScalarExprEmitter::VisitInitListExpr(InitListExpr *e) { + const unsigned numInitElements = e->getNumInits(); + + if (e->hadArrayRangeDesignato

[clang] [CIR] Unblock simple C++ structure support (PR #138368)

2025-05-02 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/138368 This change adds additional checks to a few places where a simple struct in C++ code was triggering `errorNYI` in places where no additional handling was needed, and adds a very small amount of trivial initi

[clang] [CIR] Unblock simple C++ structure support (PR #138368)

2025-05-06 Thread Andy Kaylor via cfe-commits
@@ -365,10 +365,15 @@ mlir::Attribute ConstantEmitter::tryEmitPrivateForVarInit(const VarDecl &d) { if (!d.hasLocalStorage()) { QualType ty = cgm.getASTContext().getBaseElementType(d.getType()); if (ty->isRecordType()) - if (d.getInit() && isa(d.getInit())) { -

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/138413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good to me, with a small request. https://github.com/llvm/llvm-project/pull/138413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-06 Thread Andy Kaylor via cfe-commits
@@ -96,3 +96,36 @@ void foo2(vi4 p) {} // OGCG: %[[VEC_A:.*]] = alloca <4 x i32>, align 16 // OGCG: store <4 x i32> %{{.*}}, ptr %[[VEC_A]], align 16 + +void foo3() { + vi4 a = { 1, 2, 3, 4 }; + int e = a[1]; +} andykaylor wrote: Can you add a test where th

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-05-06 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @el-ev Can you rebase this now that the call args change has landed? Thanks! https://github.com/llvm/llvm-project/pull/136854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [CIR] Upstream support for switch statements case kinds (PR #138003)

2025-05-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good to me! https://github.com/llvm/llvm-project/pull/138003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/138317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Unblock simple C++ structure support (PR #138368)

2025-05-07 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/138368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Remove inferred context from pointer type getters (PR #138858)

2025-05-07 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/138858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for switch statements case kinds (PR #138003)

2025-05-07 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/138003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    6   7   8   9   10   11