[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-04-05 Thread Bruno Cardoso Lopes via cfe-commits
@@ -293,7 +294,8 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Value addrVal = emitAlloca(cast(paramVar)->getName(), - convertType(paramVar->getType()), paramLoc, alignment); + convertType(param

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-04-05 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/132468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-04-04 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/132468 >From 6e84a91e4721d066ff3b79d5cb3535ac92f05af1 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 21 Mar 2025 13:11:11 -0700 Subject: [PATCH 1/4] [CIR] Emit allocas into the proper lexical scope Alloca op

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes Alloca operations were being emitted into the entry block of the current function unconditionally, even if the variable they represented was declared in a different scope. This change upstreams the code for

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/132468 >From 9e84f55c840890befed2720e498c068ff4ca36cd Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 21 Mar 2025 13:11:11 -0700 Subject: [PATCH 1/4] [CIR] Emit allocas into the proper lexical scope Alloca op

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-25 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-25 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-25 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Andy Kaylor via cfe-commits
@@ -293,7 +294,8 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Value addrVal = emitAlloca(cast(paramVar)->getName(), - convertType(paramVar->getType()), paramLoc, alignment); + convertType(param

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM after nit https://github.com/llvm/llvm-project/pull/132468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
@@ -44,3 +44,100 @@ void l0() { // OGCG: br label %[[FOR_COND:.*]] // OGCG: [[FOR_COND]]: // OGCG: br label %[[FOR_COND]] + +void l1() { + for (int i = 0; ; ) { + } +} + +// CIR: cir.func @l1 +// CIR-NEXT: cir.scope { +// CIR-NEXT: %[[I:.*]] = cir.alloca !s32i,

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
@@ -293,7 +294,8 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Value addrVal = emitAlloca(cast(paramVar)->getName(), - convertType(paramVar->getType()), paramLoc, alignment); + convertType(param

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/132468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/132468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-21 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/132468 Alloca operations were being emitted into the entry block of the current function unconditionally, even if the variable they represented was declared in a different scope. This change upstreams the code for ha

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) Changes Alloca operations were being emitted into the entry block of the current function unconditionally, even if the variable they represented was declared in a different scope. This change upstreams the code fo

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-21 Thread Andy Kaylor via cfe-commits
andykaylor wrote: CC: @mmha https://github.com/llvm/llvm-project/pull/132468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits