[libclc] libclc: frexp: fix implementation regarding denormals (PR #134823)

2025-04-08 Thread Fraser Cormack via cfe-commits
@@ -26,7 +26,7 @@ __clc_frexp(__CLC_GENTYPE x, __CLC_ADDRESS_SPACE __CLC_INTN *ep) { (ai & (__CLC_INTN)MANTBITS_SP32); __CLC_INTN is_inf_nan_or_zero = - x == __CLC_FP_LIT(0.0) || __clc_isinf(x) || __clc_isnan(x); + ai == (__CLC_INTN)0 || __clc_isinf(x) || __

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-08 Thread via cfe-commits
@@ -11683,7 +11683,10 @@ static void DiagnoseIntInBoolContext(Sema &S, Expr *E) { S.Diag(ExprLoc, diag::warn_left_shift_always) << (Result.Val.getInt() != 0); else if (E->getType()->isSignedIntegerType()) -S.Diag(ExprLoc, diag::warn_left_shift

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-08 Thread via cfe-commits
@@ -1144,20 +1144,25 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, switch (Kind) { // STRINGS -case DiagnosticsEngine::ak_std_string: { - const std::string &S = getArgStdStr(ArgNo); - assert(ModifierLen == 0 && "No modifiers for

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-04-08 Thread via cfe-commits
choikwa wrote: Updated and addressed feedback except the triplet check. At the moment, I'm unsure if there is better way than to query using llvm::isLibFuncEmittable, but that requires TLI. https://github.com/llvm/llvm-project/pull/129347 ___ cfe-com

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-08 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > I found interesting was the fact that you could access the > implementation-defined internal array field Yes, this is required in order for `std::array` to be an aggregate type. https://github.com/llvm/llvm-project/pull/134774

[clang] [Clang] Handle default template arguments for alias CTAD guides (PR #134807)

2025-04-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/134807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle default template arguments for alias CTAD guides (PR #134807)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Younan Zhang (zyn0217) Changes It's possible that some deduced template arguments come from default arguments, not just from the return type. So we need to recursively visit the default arguments of the parameter if it's referenced, there

[clang] [Clang][CodeGen] Respect -fwrapv-pointer when emitting struct GEPs (PR #134269)

2025-04-08 Thread Yingwei Zheng via cfe-commits
@@ -10,3 +10,24 @@ void test(void) { // DEFAULT: getelementptr inbounds nuw i32, ptr // FWRAPV-POINTER: getelementptr i32, ptr } + +struct S { + int a; + int b; + int c: 10; dtcxzyw wrote: Bitfields are handled by a different code path: https://github.

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/4] This commit implements a CC1 flag `-dump-deserialized-d

[clang] bb50061 - [CodeGen] Change placeholder from `undef` to `poison` (#134731)

2025-04-08 Thread via cfe-commits
Author: Pedro Lobo Date: 2025-04-08T09:50:48+01:00 New Revision: bb5006169f9f72a87b4358356976e0fa33353728 URL: https://github.com/llvm/llvm-project/commit/bb5006169f9f72a87b4358356976e0fa33353728 DIFF: https://github.com/llvm/llvm-project/commit/bb5006169f9f72a87b4358356976e0fa33353728.diff LO

[clang] [CodeGen] Change placeholder from `undef` to `poison` (PR #134731)

2025-04-08 Thread Pedro Lobo via cfe-commits
https://github.com/pedroclobo closed https://github.com/llvm/llvm-project/pull/134731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add clang driver changes to support MTI RISC-V (PR #134065)

2025-04-08 Thread Djordje Todorovic via cfe-commits
djtodoro wrote: > There's a lot going on here that has absolutely no explanation (no comments > in the code, and the commit message is a single sentence that tells me > nothing of use), and it's doing multiple different things. There's changing > default arch strings, which makes some sense (w

[clang] [llvm] [NVPTX] Add builtins and intrinsics for conversions of new FP types (PR #134345)

2025-04-08 Thread Srinivasa Ravi via cfe-commits
@@ -1021,6 +1036,174 @@ __device__ void nvvm_cvt_sm89() { __nvvm_e5m2x2_to_f16x2_rn(0x4c4c); // CHECK_PTX81_SM89: call <2 x half> @llvm.nvvm.e5m2x2.to.f16x2.rn.relu(i16 19532) __nvvm_e5m2x2_to_f16x2_rn_relu(0x4c4c); + + // CHECK_PTX81_SM89: call i32 @llvm.nvvm.f2tf32.rn

[clang] [clang] fp options fix for __builtin_convertvector (PR #134102)

2025-04-08 Thread Jakub Ficek via cfe-commits
ficol wrote: @shafik @tbaederr thanks, can you help with merging this PR? https://github.com/llvm/llvm-project/pull/134102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Define pointer layout for AVR program address space (PR #134254)

2025-04-08 Thread Ben Shi via cfe-commits
benshi001 wrote: Is this change necessary? I find there is not change in the size of addrspace 0/1 pointers, before and after your patch. for program ```c++ clang a.c --target=avr -mmcu=atmega2560 int gf(int a); int (*p)(int) = gf; int f; int *p1 = &f; ``` the generated assembly is unique by

[clang] [Clang][Docs] Add release note for execute-only support on AArch64 (PR #134802)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Csanád Hajdú (Il-Capitano) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/134802.diff 1 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+3) ``diff diff --git a/clang/docs/ReleaseNotes.rst b/clang/

[clang] [Clang] Handle default template arguments for alias CTAD guides (PR #134807)

2025-04-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/134807 It's possible that some deduced template arguments come from default arguments, not just from the return type. So we need to recursively visit the default arguments of the parameter if it's referenced, thereby

[clang] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

2025-04-08 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/93046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] ExprSequence: Handle ternary operators. (PR #132913)

2025-04-08 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/132913 >From dcb97b74e78148e03f7749f436f01d5488c11ae1 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 25 Mar 2025 09:42:53 + Subject: [PATCH 1/3] [clang-tidy] ExprSequence: Handle ternary operators.

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/5] This commit implements a CC1 flag `-dump-deserialized-d

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/6] This commit implements a CC1 flag `-dump-deserialized-d

[clang] [Clang][Docs] Add release note for execute-only support on AArch64 (PR #134802)

2025-04-08 Thread Csanád Hajdú via cfe-commits
https://github.com/Il-Capitano updated https://github.com/llvm/llvm-project/pull/134802 From c48168df95781b8fe5d6f72c9bdcbe1ad6a94fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csan=C3=A1d=20Hajd=C3=BA?= Date: Tue, 8 Apr 2025 09:47:46 +0200 Subject: [PATCH 1/2] [Clang][Docs] Add release note for

[clang] [Clang][Docs] Add release note for execute-only support on AArch64 (PR #134802)

2025-04-08 Thread Csanád Hajdú via cfe-commits
Il-Capitano wrote: > There is a `Arm and AArch64 Support` section too, is it worth adding a note > there either instead or as well? It could maybe just be a note that points > back to the Modified Compiler Flags section. Thanks, I didn't notice that section. I simplified the note in "Modified

[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/133910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-04-08 Thread CHANDRA GHALE via cfe-commits
https://github.com/chandraghale edited https://github.com/llvm/llvm-project/pull/134709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/134529 >From ac389b8b92fbb77c8884515d8f7293b4af17dfa5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 6 Apr 2025 18:30:42 +0800 Subject: [PATCH 1/4] [clang-format] Add 'cl' to enable OpenCL kernel file formatting

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-08 Thread Wenju He via cfe-commits
@@ -126,6 +126,7 @@ def main(): "pb.txt", "textproto", "asciipb", # TextProto +"cl", # OpenCL wenju-he wrote: done, moved after line 108. > Do we want to add "clcpp", # OpenCL C++? I actually don't know about

[clang] clang/AMDGPU: Stop looking for hip.bc in device libs (PR #134801)

2025-04-08 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm ready_for_review https://github.com/llvm/llvm-project/pull/134801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/AMDGPU: Stop looking for hip.bc in device libs (PR #134801)

2025-04-08 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/134801 This has been an empty library since January 2023 >From b46b307e034fed518437f8e28ce05704d1c20560 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 8 Apr 2025 14:00:34 +0700 Subject: [PATCH] clang/AMDGPU:

[clang] [Clang][Docs] Add release note for execute-only support on AArch64 (PR #134802)

2025-04-08 Thread Csanád Hajdú via cfe-commits
https://github.com/Il-Capitano created https://github.com/llvm/llvm-project/pull/134802 None From c48168df95781b8fe5d6f72c9bdcbe1ad6a94fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csan=C3=A1d=20Hajd=C3=BA?= Date: Tue, 8 Apr 2025 09:47:46 +0200 Subject: [PATCH] [Clang][Docs] Add release note fo

[clang] [llvm] [RISCV] Add processor definition for XiangShan-KunMingHu-V2R2 (PR #123193)

2025-04-08 Thread Yangyu Chen via cfe-commits
cyyself wrote: I think some feature is missing here, such as "Zvbb". https://github.com/llvm/llvm-project/pull/123193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle default template arguments for alias CTAD guides (PR #134807)

2025-04-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/134807 >From 3f09d114d6c4c51bd879a19caaf1c73c531cfedd Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 8 Apr 2025 16:16:53 +0800 Subject: [PATCH] [Clang] Handle default template arguments for alias CTAD guides

[libclc] [libclc] Reduce bithacking in CLC frexp (PR #129871)

2025-04-08 Thread Romaric Jodin via cfe-commits
rjodinchr wrote: I'm clearly seeing those devices returning true when comparing subnormals to zero. So either they all have a bug, or the SPIR-V code produced by `clspv` is buggy. If it ends up being a bug from the device, we might want to have something more architecture friendly, or at least

[clang] [llvm] [NVPTX] Add builtins and intrinsics for conversions of new FP types (PR #134345)

2025-04-08 Thread Srinivasa Ravi via cfe-commits
https://github.com/Wolfram70 edited https://github.com/llvm/llvm-project/pull/134345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][llvm] Fix AArch64 MOP4{A/S} intrinsic tests (NFC) (PR #134746)

2025-04-08 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray closed https://github.com/llvm/llvm-project/pull/134746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #131838)

2025-04-08 Thread Alexey Bataev via cfe-commits
@@ -4528,6 +4528,115 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { alexey-bataev wrote: Why do you need it? CapturedExpr should be emitted a

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #131838)

2025-04-08 Thread Alexey Bataev via cfe-commits
@@ -537,6 +537,10 @@ Python Binding Changes OpenMP Support -- +- Added support for 'omp assume' directive. +- Added support for 'omp scope' directive. +- Added support for allocator-modifier in 'allocate' clause. alexey-bataev wrote: Unrelated to

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #131838)

2025-04-08 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/131838 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [NFC] Tablegen component diags headers (PR #134777)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Sirraide) Changes The component diagnostic headers (i.e. `DiagnosticAST.h` and friends) all follow the same format, and there’s enough of them (and in them) to where updating all of them has become rather tedious (at least it was fo

[clang] clang/AMDGPU: Stop looking for hip.bc in device libs (PR #134801)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Matt Arsenault (arsenm) Changes This has been an empty library since January 2023 --- Full diff: https://github.com/llvm/llvm-project/pull/134801.diff 5 Files Affected: - (modified) clang/lib/Driver/ToolChains/AMDGPU.cpp (-2) -

[clang] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-04-08 Thread Alexey Bataev via cfe-commits
@@ -4899,6 +4899,150 @@ void CGOpenMPRuntime::emitSingleReductionCombiner(CodeGenFunction &CGF, } } +void CGOpenMPRuntime::emitPrivateReduction( +CodeGenFunction &CGF, SourceLocation Loc, ArrayRef Privates, +ArrayRef LHSExprs, ArrayRef RHSExprs, +ArrayRef Reduct

[clang] [HLSL] Add separate handle for the counter (PR #134864)

2025-04-08 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/134864 >From 496aaf5a3265793fc0b4b5a1a6dfb526531d825c Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 2 Apr 2025 15:53:50 -0400 Subject: [PATCH 1/3] [HLSL] Add separate handle for the counter In DXIL, the cou

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Daniel Chen via cfe-commits
https://github.com/DanielCChen updated https://github.com/llvm/llvm-project/pull/134362 >From cd100a70479adbb4619d685e345485eea99987c5 Mon Sep 17 00:00:00 2001 From: Daniel Chen Date: Fri, 4 Apr 2025 06:10:56 -0400 Subject: [PATCH 1/4] [driver] Generalize adding the path of libflang_rt.runtime

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -1242,6 +1242,43 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOp extr

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-04-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From 613ef41a6e3bfa3a24e45ce7761918639143cf82 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH] [Clang] Add __builtin_invoke and recognize std::invoke as a

[clang] [clang-tools-extra] [libcxx] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-08 Thread Erich Keane via cfe-commits
@@ -7379,6 +7379,14 @@ class RecoveryExpr final : public Expr, friend class ASTStmtWriter; }; +/// Insertion operator for diagnostics. This allows sending +/// Expr into a diagnostic with <<. +inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, +

[clang] Mark CXX module initializer with PACBTI attributes (PR #133716)

2025-04-08 Thread Victor Campos via cfe-commits
@@ -447,6 +447,8 @@ llvm::Function *CodeGenModule::CreateGlobalInitOrCleanUpFunction( if (Linkage == llvm::GlobalVariable::InternalLinkage) SetInternalFunctionAttributes(GlobalDecl(), Fn, FI); + else +getTargetCodeGenInfo().setTargetAttributes(nullptr, Fn, *this);

[clang] [llvm] [IR] Mark convergence intrins as has-side-effect (PR #134844)

2025-04-08 Thread Matt Arsenault via cfe-commits
arsenm wrote: > I suspect the long-term change to change the default IR to assume convergent > will take some time as it will impact many subprojects. Turns out not really, I ran spec with this about 2 years ago and the only non-noise change was a mild improvement > Would you be OK with me

[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/9] This commit implements a CC1 flag `-dump-deserialized-d

[clang] [clang-tools-extra] [libcxx] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-08 Thread Erich Keane via cfe-commits
@@ -7379,6 +7379,14 @@ class RecoveryExpr final : public Expr, friend class ASTStmtWriter; }; +/// Insertion operator for diagnostics. This allows sending +/// Expr into a diagnostic with <<. +inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, +

[clang] [Clang][Sema] Fix -Whigher-precision-for-complex-division (PR #131477)

2025-04-08 Thread Zahira Ammarguellat via cfe-commits
=?utf-8?q?Mészáros?= Gergely Message-ID: In-Reply-To: @@ -0,0 +1,58 @@ +// RUN: %clang_cc1 %s -complex-range=promoted -triple x86_64-unknown-linux -verify=no-diag \ +// RUN: -DDIV_CC -DDIV_RC -DDIVASSIGN -DDIVMIXEDFD -DDIVMIXEDID + +// RUN: %clang_cc1 %s -complex-range=promote

[clang] [Clang][Sema] Fix -Whigher-precision-for-complex-division (PR #131477)

2025-04-08 Thread Zahira Ammarguellat via cfe-commits
=?utf-8?q?Mészáros?= Gergely Message-ID: In-Reply-To: @@ -10591,6 +10591,45 @@ static void checkArithmeticNull(Sema &S, ExprResult &LHS, ExprResult &RHS, << LHS.get()->getSourceRange() << RHS.get()->getSourceRange(); } +static void DetectPrecisionLossInComplexDivisio

[clang] [clang-tools-extra] [libcxx] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-08 Thread Matheus Izvekov via cfe-commits
@@ -7379,6 +7379,14 @@ class RecoveryExpr final : public Expr, friend class ASTStmtWriter; }; +/// Insertion operator for diagnostics. This allows sending +/// Expr into a diagnostic with <<. +inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, +

[clang] [Clang] add ext warning for missing return in 'main' for C89 mode (PR #134617)

2025-04-08 Thread Oleksandr T. via cfe-commits
@@ -1031,6 +1031,8 @@ def err_mainlike_template_decl : Error<"%0 cannot be a template">; def err_main_returns_nonint : Error<"'main' must return 'int'">; def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">, InGroup; +def ext_main_no_return : Extensi

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. https://github.com/llvm/llvm-project/pull/132237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream CmpOp (PR #133159)

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

[clang] [CIR] Upstream CmpOp (PR #133159)

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

[clang] [Clang][Docs] Add release note for execute-only support on AArch64 (PR #134802)

2025-04-08 Thread David Green via cfe-commits
=?utf-8?q?Csan=C3=A1d_Hajd=C3=BA?= Message-ID: In-Reply-To: https://github.com/davemgreen approved this pull request. Thanks, LGTM https://github.com/llvm/llvm-project/pull/134802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-08 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,36 @@ +//===--===// +// +// 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

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-08 Thread Fraser Cormack via cfe-commits
@@ -6,7 +6,28 @@ // //===--===// -#include +#include +#include + +// cl_khr_global_int32_base_atomics +#define IMPL(TYPE) \ frasercrmck wrote: This doesn't look clang-formatted. https://

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-08 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/134489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] improved preservation of template keyword (PR #133610)

2025-04-08 Thread Alexander Kornienko via cfe-commits
alexfh wrote: #134748 doesn't fix errors in the original code, unfortunately. Now we're getting `out-of-line definition of 'X' does not match any declaration in 'Y'`. It's hard to tell whether the original code is correct, but I suppose that the purpose of this change was not to make Clang str

[clang] [llvm][Stmt]:Fix musttail attribute on a function with not_tail_called attribute has no warning/error (PR #134465)

2025-04-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. First: The title of this PR has `llvm` and `stmt` in it, neither of which should be used here, so don't bother with a tag. Second: The PR message (which we use as a commit message) needs a ton more detail. Third: Please add

[clang] [Clang] [NFC] Tablegen component diags headers (PR #134777)

2025-04-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/134777 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-08 Thread Yanzuo Liu via cfe-commits
@@ -47,3 +47,21 @@ namespace InvalidInsertPos { template<> int v; int k = v; } + +namespace GH51347 { + template + auto p = p; // expected-error {{the type of variable template specialization 'p'}} zwuis wrote: I think this pattern is always illegal. B

[libclc] libclc: frexp: fix implementation regarding denormals (PR #134823)

2025-04-08 Thread Romaric Jodin via cfe-commits
@@ -26,7 +26,7 @@ __clc_frexp(__CLC_GENTYPE x, __CLC_ADDRESS_SPACE __CLC_INTN *ep) { (ai & (__CLC_INTN)MANTBITS_SP32); __CLC_INTN is_inf_nan_or_zero = - x == __CLC_FP_LIT(0.0) || __clc_isinf(x) || __clc_isnan(x); + ai == (__CLC_INTN)0 || __clc_isinf(x) || __

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/134889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenCL][AMDGPU] Use `byref` for OpenCL kernel arguments (PR #134892)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Shilei Tian (shiltian) Changes Due to a previous workaround allowing kernels to be called from other functions, Clang currently doesn't use the `byref` attribute for aggregate kernel arguments. The issue was recently resolved in ht

[clang] [Clang][OpenCL][AMDGPU] Use `byref` for OpenCL kernel arguments (PR #134892)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Shilei Tian (shiltian) Changes Due to a previous workaround allowing kernels to be called from other functions, Clang currently doesn't use the `byref` attribute for aggregate kernel arguments. The issue was recently resolved in https://git

[libcxx] [libcxxabi] [libunwind] [llvm] [libcxxabi][libunwind] Support for using LLVM libc (PR #134893)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libcxx @llvm/pr-subscribers-libunwind Author: Petr Hosek (petrhosek) Changes This generalizes the support added in #99287 renaming the option to RUNTIMES_USE_LIBC and integrating the module into libc++abi and libunwind as well. --- Full diff: https://

[libcxx] [libcxxabi] [libunwind] [llvm] [libcxxabi][libunwind] Support for using LLVM libc (PR #134893)

2025-04-08 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/134893 This generalizes the support added in #99287 renaming the option to RUNTIMES_USE_LIBC and integrating the module into libc++abi and libunwind as well. >From 1677ee5c547018472a1f6a29282d3af3500abcd7 Mon Sep 1

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

2025-04-08 Thread Amr Hesham via cfe-commits
@@ -29,8 +29,15 @@ int f[5] = {1, 2}; void func() { int arr[10]; - // CHECK: %[[ARR:.*]] = cir.alloca !cir.array, !cir.ptr>, ["arr"] + + int e = arr[1]; + // CHECK: %[[INIT:.*]] = cir.alloca !s32i, !cir.ptr, ["e", init] + // CHECK: %[[IDX:.*]] = cir.const #cir.int<1>

[clang] [Clang][OpenCL][AMDGPU] Use `byref` for OpenCL kernel arguments (PR #134892)

2025-04-08 Thread Shilei Tian via cfe-commits
shiltian wrote: * **#134892** https://app.graphite.dev/github/pr/llvm/llvm-project/134892?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/134

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes The handling for NullStmt was going to an error saying the statement handling wasn't implemented. It doesn't need any implementation. It is sufficient for emitSimpleStmt to just return success for that sta

[clang] Reject invalid integer constants in unevaluated preprocessor operands (PR #134884)

2025-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/134884 >From 2661b9381e0a182fb53a81c8bf66cecd51c73b0f Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 8 Apr 2025 13:17:32 -0400 Subject: [PATCH 1/2] Reject invalid integer constants in unevaluated preproc

[clang] Reject invalid integer constants in unevaluated preprocessor operands (PR #134884)

2025-04-08 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. LGTM. I suppose if people complain, we can make the non-live value case a warning rather than an error, but given no other implementation does, I think it makes sense not to do that speculatively. https://github.com/llvm/llvm-project/pul

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -57,6 +57,7 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s, switch (s->getStmtClass()) { case Stmt::BreakStmtClass: + case Stmt::NullStmtClass: andykaylor wrote: Sure. Do you know what code leads to `NoStmtClass`? https://github.com/ll

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Erich Keane via cfe-commits
@@ -57,6 +57,7 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s, switch (s->getStmtClass()) { case Stmt::BreakStmtClass: + case Stmt::NullStmtClass: erichkeane wrote: I'm about 99.9% sure that there is no code that can result in it, barring

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Erich Keane via cfe-commits
@@ -90,3 +90,18 @@ int f3(void) { // OGCG-NEXT: store i32 3, ptr %[[I_PTR]], align 4 // OGCG-NEXT: %[[I:.*]] = load i32, ptr %[[I_PTR]], align 4 // OGCG-NEXT: ret i32 %[[I]] + +// Verify null statement handling. +void f4(void) { + ; erichkeane wrote: Th

[clang] [llvm] [HIP][HIPSTDPAR][NFC] Re-order & adapt `hipstdpar` specific passes (PR #134753)

2025-04-08 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/134753 >From a988ecf63dc79d226c2f7aa1430f65d08256888b Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 8 Apr 2025 00:20:27 +0100 Subject: [PATCH 1/3] Re-order & adapt `hipstdpar` specific passes. --- clang/lib/Co

[clang] [llvm] [HIP][HIPSTDPAR][NFC] Re-order & adapt `hipstdpar` specific passes (PR #134753)

2025-04-08 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/134753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-08 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B requested changes to this pull request. Hold on a sec. https://github.com/llvm/llvm-project/pull/134758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -57,6 +57,7 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s, switch (s->getStmtClass()) { case Stmt::BreakStmtClass: + case Stmt::NullStmtClass: andykaylor wrote: I just looked at classic codegen. It puts NoStmtClass (along with CXXCatc

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-08 Thread Artem Belevich via cfe-commits
@@ -2,6 +2,170 @@ // RUN: %clang_cc1 -triple nvptx64-unknown-unknown -fcuda-is-device -O3 -o - %s -emit-llvm | FileCheck %s #include "Inputs/cuda.h" +struct char1 { Artem-B wrote: These type declarations should go into Inputs/cuda.h https://github.com/llvm/

[clang-tools-extra] [clang-tidy] ExprSequence: Handle ternary operators. (PR #132913)

2025-04-08 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: ping https://github.com/llvm/llvm-project/pull/132913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida updated https://github.com/llvm/llvm-project/pull/132237 >From 3aaaf3371215de0f214836da32f862518f223760 Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Wed, 12 Mar 2025 21:26:36 -0700 Subject: [PATCH 1/3] [clang][DependencyScanning] Track dependencies from preb

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -57,6 +57,7 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s, switch (s->getStmtClass()) { case Stmt::BreakStmtClass: + case Stmt::NullStmtClass: andykaylor wrote: I'm fine with that. Trying to avoid doing multiple things, but this is all

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng updated https://github.com/llvm/llvm-project/pull/134171 >From 719bb94279f64f134c826faa22898e4e549bb23c Mon Sep 17 00:00:00 2001 From: kmpeng Date: Thu, 27 Mar 2025 14:39:27 -0700 Subject: [PATCH 01/12] finished lit implementation, added codegen and sema tests --- .

[clang] [clang] Add comment about misleading alloc_size argument names (PR #134899)

2025-04-08 Thread via cfe-commits
https://github.com/thejh created https://github.com/llvm/llvm-project/pull/134899 Attr.td names the first alloc_size argument "ElemSizeParam" and the second optional argument "NumElemsParam"; but the semantics of how the two-argument version is used in practice is the opposite of that. glibc

[clang] [clang] Add comment about misleading alloc_size argument names (PR #134899)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jann (thejh) Changes Attr.td names the first alloc_size argument "ElemSizeParam" and the second optional argument "NumElemsParam"; but the semantics of how the two-argument version is used in practice is the opposite of that. glibc decla

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread via cfe-commits
@@ -0,0 +1,50 @@ +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s --check-prefix=CIR +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll +//

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Kaitlin Peng via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s -DTEST_TYPE=half +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_0 -HV 202x %s 2>&1 | FileCheck %s -DTEST_TYPE=int16_t +// RUN: not %clang_dxc -enable-16bit-types -T cs_6_

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Kaitlin Peng via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float4 test_no_second_arg(float p0) { + return lit(p0); + // expected-error@-1 {{no matching funct

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Erich Keane via cfe-commits
@@ -57,6 +57,7 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s, switch (s->getStmtClass()) { case Stmt::BreakStmtClass: + case Stmt::NullStmtClass: erichkeane wrote: Ah, i missed that it wasn't just the same unreachable. No real reason to

[clang] [llvm] [HIP][HIPSTDPAR][NFC] Re-order & adapt `hipstdpar` specific passes (PR #134753)

2025-04-08 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx commented: > Needs test Done. https://github.com/llvm/llvm-project/pull/134753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >