[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux` running on `sanitizer-buildbot8` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/51/builds/11171 Here is the relevant piece of the

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread David Olsen via cfe-commits
https://github.com/dkolsen-pgi closed https://github.com/llvm/llvm-project/pull/127674 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread David Olsen via cfe-commits
https://github.com/dkolsen-pgi updated https://github.com/llvm/llvm-project/pull/127674 >From c0f10395ec6bff05bdb9eb04ed2c1f349c647d50 Mon Sep 17 00:00:00 2001 From: David Olsen Date: Tue, 18 Feb 2025 09:41:35 -0800 Subject: [PATCH 1/2] [CIR] Upstream simple function bodies Enable ClangIR gene

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread David Olsen via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread David Olsen via cfe-commits
@@ -0,0 +1,203 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. My unanswered questions are mostly simple style changes, which I'm happy to let David decide if he thinks they need to be addressed. https://github.com/llvm/llvm-project/pull/127674 ___ cfe-com

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Andy Kaylor via cfe-commits
@@ -11,8 +11,8 @@ /// //===--===// -#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIROPS -#define LLVM_CLANG_CIR_DIALECT_IR_CIROPS +#ifndef CLANG_CIR_DIALECT_IR_CIROPS_TD andykaylor wrote: It looks like

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread David Olsen via cfe-commits
@@ -224,3 +225,19 @@ mlir::Type CIRGenTypes::convertType(QualType type) { typeCache[ty] = resultType; return resultType; } + +mlir::Type CIRGenTypes::convertTypeForMem(clang::QualType qualType, + bool forBitField) { + assert(!qualTy

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. https://github.com/llvm/llvm-project/pull/127674 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/127674 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,53 @@ +// Simple functions +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s + +void empty() { } +// CHECK: cir.func @empty() -> !cir.void { xlauko wrote: Ideally once there will be abi-lib: h

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread David Olsen via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread David Olsen via cfe-commits
@@ -0,0 +1,203 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread David Olsen via cfe-commits
@@ -0,0 +1,203 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread David Olsen via cfe-commits
@@ -11,8 +11,8 @@ /// //===--===// -#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIROPS -#define LLVM_CLANG_CIR_DIALECT_IR_CIROPS +#ifndef CLANG_CIR_DIALECT_IR_CIROPS_TD dkolsen-pgi wrote: Because the

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,53 @@ +// Simple functions +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s + +void empty() { } +// CHECK: cir.func @empty() -> !cir.void { andykaylor wrote: Why aren't the function names mang

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,203 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -61,6 +64,13 @@ class CIRGenTypes { /// Convert a Clang type into a mlir::Type. mlir::Type convertType(clang::QualType type); + + /// Convert type T into an mlir::Type. This differs from convertType in that + /// it is used to convert to the memory representation for

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,203 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,203 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -11,8 +11,8 @@ /// //===--===// -#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIROPS -#define LLVM_CLANG_CIR_DIALECT_IR_CIROPS +#ifndef CLANG_CIR_DIALECT_IR_CIROPS_TD andykaylor wrote: Why is the LL

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,203 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,128 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,128 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// 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: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread Andy Kaylor via cfe-commits
@@ -78,16 +82,37 @@ class CIRGenModule : public CIRGenTypeCache { void emitTopLevelDecl(clang::Decl *decl); + /// Return the address of the given function. If funcType is non-null, then + /// this function will use the specified type if it has to create it. + // TODO: th

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: David Olsen (dkolsen-pgi) Changes Enable ClangIR generation for very simple functions. The functions have to return `void` or an integral type, contain only compound statements or `return` statements, and `return` statement expressions ca

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-18 Thread David Olsen via cfe-commits
https://github.com/dkolsen-pgi created https://github.com/llvm/llvm-project/pull/127674 Enable ClangIR generation for very simple functions. The functions have to return `void` or an integral type, contain only compound statements or `return` statements, and `return` statement expressions can