[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-20 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes commented:

Maybe add the header for `CIRDialect.cpp` so that we don't land an empty file? 

https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-20 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes edited 
https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][Basic][NFC] Add the CIR language to the Language enum (PR #86072)

2024-03-20 Thread Bruno Cardoso Lopes via llvm-branch-commits


@@ -41,6 +41,7 @@ enum class Language : uint8_t {
   RenderScript,
   HIP,
   HLSL,
+  CIR,

bcardosolopes wrote:

Should this come after `LLVM_IR` with its own / similar comment?

https://github.com/llvm/llvm-project/pull/86072
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][cmake] Add support for cmake variable CLANG_ENABLE_CIR (PR #86078)

2024-03-20 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes approved this pull request.


https://github.com/llvm/llvm-project/pull/86078
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][Basic][NFC] Add the CIR language to the Language enum (PR #86072)

2024-03-21 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes approved this pull request.


https://github.com/llvm/llvm-project/pull/86072
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Bruno Cardoso Lopes via llvm-branch-commits


@@ -0,0 +1,46 @@
+//===- CIRTypes.td - CIR dialect types -*- tablegen 
-*-===//

bcardosolopes wrote:

`CIRTypes.td` ->  `CIRDialect.td`

https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes commented:

`CIR/Dialect/IR/CIRDialect.h` should get a comment header too

https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes edited 
https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Bruno Cardoso Lopes via llvm-branch-commits


@@ -0,0 +1,46 @@
+//===- CIRTypes.td - CIR dialect types -*- tablegen 
-*-===//
+//
+// 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: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+//
+// This file declares the CIR dialect.
+//
+//===--===//
+
+#ifndef MLIR_CIR_DIALECT_CIR
+#define MLIR_CIR_DIALECT_CIR
+
+include "mlir/IR/OpBase.td"
+
+def CIR_Dialect : Dialect {
+  let name = "cir";
+
+  // A short one-line summary of our dialect.
+  let summary = "A high-level dialect for analyzing and optimizing Clang "
+"supported languages";
+
+  let cppNamespace = "::mlir::cir";
+
+  let useDefaultAttributePrinterParser = 0;
+  let useDefaultTypePrinterParser = 0;

bcardosolopes wrote:

We are following MLIR style guide here and these tablegen ones need to be like 
this in order for certain c++ code to be generated.

This comment reminds me of something we need to discuss for the rest of CIR: 
MLIR and clang differs on the coding style, which means that CIRGen code has 
variables starting with capital letter calling into code using lowecase. So far 
we've been using a mix: in the dialect source we keep MLIR style, and in CIRGen 
we keep the clang style. 

We don't have a strong opinion here, we rather apply whatever the 
community/maintainers care and move on with upstreaming. Thoughts? (cc: 
@joker-eph)

https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes edited 
https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-04-17 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes approved this pull request.


https://github.com/llvm/llvm-project/pull/86080
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR] Add options to emit ClangIR and enable the ClangIR pipeline (PR #89030)

2024-04-24 Thread Bruno Cardoso Lopes via llvm-branch-commits


@@ -2876,6 +2876,15 @@ def flax_vector_conversions : Flag<["-"], 
"flax-vector-conversions">, Group, Group,
   HelpText<"Force linking the clang builtins runtime library">;
+
+/// ClangIR-specific options - BEGIN
+def fclangir_enable : Flag<["-"], "fclangir-enable">, Visibility<[ClangOption, 
CC1Option]>,
+  Group, HelpText<"Use ClangIR pipeline to compile">,
+  MarshallingInfoFlag>;
+def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>,
+  Group, HelpText<"Build ASTs and then lower to ClangIR, emit 
the .cir file">;

bcardosolopes wrote:

It mimics `-emit-llvm`. One caveat is that CIR isn't yet serializable, so it 
will emit textual output regardless.

https://github.com/llvm/llvm-project/pull/89030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR] Add options to emit ClangIR and enable the ClangIR pipeline (PR #89030)

2024-04-24 Thread Bruno Cardoso Lopes via llvm-branch-commits


@@ -590,7 +596,7 @@ class FrontendOptions {
 EmitSymbolGraph(false), EmitExtensionSymbolGraphs(false),
 EmitSymbolGraphSymbolLabelsForTesting(false),
 EmitPrettySymbolGraphs(false), GenReducedBMI(false),
-TimeTraceGranularity(500) {}
+UseClangIRPipeline(), TimeTraceGranularity(500) {}

bcardosolopes wrote:

Oops!

https://github.com/llvm/llvm-project/pull/89030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR] Add options to emit ClangIR and enable the ClangIR pipeline (PR #89030)

2024-04-24 Thread Bruno Cardoso Lopes via llvm-branch-commits


@@ -2876,6 +2876,15 @@ def flax_vector_conversions : Flag<["-"], 
"flax-vector-conversions">, Group, Group,
   HelpText<"Force linking the clang builtins runtime library">;
+
+/// ClangIR-specific options - BEGIN
+def fclangir_enable : Flag<["-"], "fclangir-enable">, Visibility<[ClangOption, 
CC1Option]>,

bcardosolopes wrote:

Even better :) 

https://github.com/llvm/llvm-project/pull/89030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR] Add options to emit ClangIR and enable the ClangIR pipeline (PR #89030)

2024-04-24 Thread Bruno Cardoso Lopes via llvm-branch-commits


@@ -2876,6 +2876,15 @@ def flax_vector_conversions : Flag<["-"], 
"flax-vector-conversions">, Group, Group,
   HelpText<"Force linking the clang builtins runtime library">;
+
+/// ClangIR-specific options - BEGIN
+def fclangir_enable : Flag<["-"], "fclangir-enable">, Visibility<[ClangOption, 
CC1Option]>,
+  Group, HelpText<"Use ClangIR pipeline to compile">,
+  MarshallingInfoFlag>;
+def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>,

bcardosolopes wrote:

My preference is to match current `-emit-llvm` behavior (i.e. be a driver level 
flag). It makes it convenient for us to just replace `-emit-llvm` with 
`-emit-cir` in workflows that currently expect LLVM output. If someone fixes 
`-emit-llvm` someday (which I find unlikely), we could then do the same for 
CIR. If this is a over my dead body argument for you, then whatever is fine, 
just wanna make sure I express what I believe is the right approach.

https://github.com/llvm/llvm-project/pull/89030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR] Upstream ComplexImagPtrOp for ComplexType (PR #144236)

2025-06-17 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes commented:

This might look a bit different given the residesign of the other pieces, so 
I'm gonna hold on reviewing this for now, let me know when this is ready again.

https://github.com/llvm/llvm-project/pull/144236
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR] Upstream __real__ for ComplexType (PR #144261)

2025-06-17 Thread Bruno Cardoso Lopes via llvm-branch-commits

bcardosolopes wrote:

This might look a bit different given the redesign of the other pieces, so I'm 
gonna hold on reviewing this for now, let me know when this is ready again.

https://github.com/llvm/llvm-project/pull/144261
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [CIR] Upstream __imag__ for ComplexType (PR #144262)

2025-06-17 Thread Bruno Cardoso Lopes via llvm-branch-commits

bcardosolopes wrote:

This might look a bit different given the redesign of the other pieces, so I'm 
gonna hold on reviewing this for now, let me know when this is ready again.

https://github.com/llvm/llvm-project/pull/144262
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] release/21.x: [Clang] Fix FE crash during CGCoroutine GRO Alloca Emission (#148962) (PR #149013)

2025-07-17 Thread Bruno Cardoso Lopes via llvm-branch-commits

https://github.com/bcardosolopes approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/149013
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits