[clang] [llvm] Revert "Enable unnecessary-virtual-specifier by default" (PR #134105)

2025-04-08 Thread Devon Loehr via cfe-commits
DKLoehr wrote: Thanks for the revert, can you link to a failed build or something so I know what exactly went wrong? Was the issue the presence of an unrecognized warning flag in the build files? https://github.com/llvm/llvm-project/pull/134105 ___ c

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

2025-04-08 Thread George Burgess IV via cfe-commits
https://github.com/gburgessiv approved this pull request. LGTM, thanks for adding the clarity! https://github.com/llvm/llvm-project/pull/134899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

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

2025-04-08 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. I love this! 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

[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 commented: Just some general comments, most of which apply to multiple files. In principle I like the change, though - thank you. I also think the idea of making overriding based solely on filename is interesting. https://github.com/llvm/llvm-project/pull/134489

[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) \ +_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile global TYPE *p, TYPE cmp, TYP

[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] 79cb6f0 - [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (#134713)

2025-04-08 Thread via cfe-commits
Author: Joseph Huber Date: 2025-04-08T07:27:12-05:00 New Revision: 79cb6f05da37520949c006e26c5cef1826090d9d URL: https://github.com/llvm/llvm-project/commit/79cb6f05da37520949c006e26c5cef1826090d9d DIFF: https://github.com/llvm/llvm-project/commit/79cb6f05da37520949c006e26c5cef1826090d9d.diff

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

2025-04-08 Thread David Rivera via cfe-commits
RiverDave wrote: > We should fix `IgnoreSingleElementAggregates` instead. great observation, will fix https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

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

2025-04-08 Thread Erich Keane via cfe-commits
@@ -1562,6 +1563,60 @@ void clang::EmitClangDiagsCompatIDs(const llvm::RecordKeeper &Records, OS << "DIAG_COMPAT_IDS_END()\n"; } +/// ClangDiagsIntefaceEmitter - Emit the diagnostics interface header for +/// a Clang component. +void clang::EmitClangDiagsInterface(llvm::r

[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] 204d8c0 - [clang][llvm] Fix AArch64 MOP4{A/S} intrinsic tests (NFC) (#134746)

2025-04-08 Thread via cfe-commits
Author: Jonathan Thackray Date: 2025-04-08T11:45:47+01:00 New Revision: 204d8c0d588b647e63d925705a7fe12c47242fc9 URL: https://github.com/llvm/llvm-project/commit/204d8c0d588b647e63d925705a7fe12c47242fc9 DIFF: https://github.com/llvm/llvm-project/commit/204d8c0d588b647e63d925705a7fe12c47242fc9.d

[clang] clang_EvalResult_getAsCXString impl (PR #134551)

2025-04-08 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > What are the ABI guarantees of libclang? Won't adding a new field to CXString > break compatibility? That's a great point, it would be an ABI breaking change and we don't want those in libclang: https://github.com/llvm/llvm-project/blob/25e08c0b9cafaab09af35ce6a03317ffd5

[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/7] This commit implements a CC1 flag `-dump-deserialized-d

[clang] Add more tests for _Countof (PR #133333)

2025-04-08 Thread Aaron Ballman via cfe-commits
@@ -144,3 +177,13 @@ void test_compound_literals() { static_assert(_Countof((int[2]){}) == 2); static_assert(_Countof((int[]){1, 2, 3, 4}) == 4); } + +static int test_f1(); +static int test_f2(); // expected-warning {{never defined}} AaronBallman wrote:

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

2025-04-08 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts created https://github.com/llvm/llvm-project/pull/134844 When a callee is marked as `convergent`, some targets like HLSL/SPIR-V add a convergent token to the call. This is valid if both functions are marked as `convergent`. ADCE/BDCE and other DCE passes were allowed

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

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-spir-v Author: Nathan Gauër (Keenuts) Changes When a callee is marked as `convergent`, some targets like HLSL/SPIR-V add a convergent token to the call. This is valid if both functions are marked as `convergent`. ADCE/BDCE and other DCE passes

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

2025-04-08 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. 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] [llvm] [IR] Mark convergence intrins as has-side-effect (PR #134844)

2025-04-08 Thread Nathan Gauër via cfe-commits
Keenuts wrote: > These should not have side effects. I agree I'm stretching the "hasSideEffect" definition here. > Whatever is removing the convergent needs to consider the uses (or more > likely, just leave it alone) I suspect the long-term change to change the default IR to assume convergen

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

2025-04-08 Thread Oleksandr T. via cfe-commits
@@ -16232,7 +16232,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. - if (FD->hasImplicitReturnZero() || FD->hasAttr()) +

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-08 Thread Baranov Victor via cfe-commits
=��___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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/2] [HLSL] Add separate handle for the counter In DXIL, the cou

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

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -281,3 +281,33 @@ bool CIRGenTypes::isZeroInitializable(clang::QualType t) { return true; } + +const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo() { + // Lookup or create unique function info. + llvm::FoldingSetNodeID id; + CIRGenFunctionInfo::Profile(id);

[clang] 6c74fe9 - [Clang] [NFC] Tablegen component diags headers (#134777)

2025-04-08 Thread via cfe-commits
Author: Sirraide Date: 2025-04-08T17:21:45+02:00 New Revision: 6c74fe9087fd85059158719ad1ab67e0f5098300 URL: https://github.com/llvm/llvm-project/commit/6c74fe9087fd85059158719ad1ab67e0f5098300 DIFF: https://github.com/llvm/llvm-project/commit/6c74fe9087fd85059158719ad1ab67e0f5098300.diff LOG:

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

2025-04-08 Thread Chris B via cfe-commits
@@ -280,6 +280,17 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); } _DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp) _DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp) +//===--===// +// lit builtins overloa

[clang] clang_EvalResult_getAsCXString impl (PR #134551)

2025-04-08 Thread Damian Andrei via cfe-commits
xTachyon wrote: `CXString::private_flags` only has 2 bits used. Could we use the rest for the size? Would it be enough? There's also the possibility to not touch `CXString` at all, and add a function that returns ptr+size only for `clang_EvalResult_getAs...`. What do you think? https://githu

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

2025-04-08 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/17916 Here is th

[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: Those are actually *useful* failures and expose real issues in those tests. -

[clang] [Clang][counted_by] Add support for 'counted_by' on struct pointers (PR #127116)

2025-04-08 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/127116 >From b5b9b158e7e379f2d430584e3ccf519677bf27a3 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 10 Jan 2025 17:13:30 -0800 Subject: [PATCH 1/6] [Clang][counted_by] Add support for 'counted_by' on struc

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

2025-04-08 Thread Andy Kaylor 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] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-04-08 Thread via cfe-commits
https://github.com/choikwa updated https://github.com/llvm/llvm-project/pull/129347 >From 46da769c11937a8f210596f45c29ddcf149d0080 Mon Sep 17 00:00:00 2001 From: Kevin Choi Date: Fri, 28 Feb 2025 16:52:03 -0600 Subject: [PATCH] [AMDGPU][clang] provide device implementation for __builtin_logb a

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

2025-04-08 Thread Amr Hesham 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] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-08 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: define {{.*}} <4 x float> @{{[A-Za-z1-9_]+}}dst_impl{{[A-Za-z1-9_]*}}( +//

[clang] [llvm] [LLVM][Clang][Cygwin] Fix building Clang for Cygwin (PR #134494)

2025-04-08 Thread via cfe-commits
Mateusz =?utf-8?q?Mikuła?= , Mateusz =?utf-8?q?Mikuła?= , Mateusz =?utf-8?q?Mikuła?= Message-ID: In-Reply-To: @@ -106,7 +106,7 @@ if (LLVM_EXPORTED_SYMBOL_FILE) DEPENDS ${LIBCLANG_VERSION_SCRIPT_FILE}) endif() -if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCL

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-08 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp,c,h -- clang/include/clang/Parse/Parser.h clang/lib/Pars

[clang] [llvm] [LLVM][Clang][Cygwin] Fix building Clang for Cygwin (PR #134494)

2025-04-08 Thread Mateusz Mikuła via cfe-commits
@@ -106,7 +106,7 @@ if (LLVM_EXPORTED_SYMBOL_FILE) DEPENDS ${LIBCLANG_VERSION_SCRIPT_FILE}) endif() -if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCLANG_BUILD_STATIC)) +if(LLVM_ENABLE_PIC OR ((WIN32 OR CYGWIN) AND NOT LIBCLANG_BUILD_STATIC)) mat

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

2025-04-08 Thread Amr Hesham via cfe-commits
@@ -232,6 +233,152 @@ 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] [llvm] [LLVM][Clang][Cygwin] Fix building Clang for Cygwin (PR #134494)

2025-04-08 Thread Mateusz Mikuła via cfe-commits
https://github.com/mati865 updated https://github.com/llvm/llvm-project/pull/134494 From ee496adcd21933ce9c8f0304c27b8a070d2b83f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 5 Apr 2025 13:18:35 +0200 Subject: [PATCH 1/5] [LLVM][Cygwin] Fix Signals compatibility w

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

2025-04-08 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,16 @@ +// 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 -verify-ignore-unexpected=note + +float4 test_double_inputs(double p0, double p1, double p2) { + retur

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-08 Thread Farzon Lotfi via cfe-commits
@@ -174,6 +174,31 @@ const inline float distance(__detail::HLSL_FIXED_VECTOR X, __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } +//===--===// +// dst

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

2025-04-08 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. 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] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #131838)

2025-04-08 Thread via cfe-commits
@@ -4528,6 +4528,115 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dyn_cast(SubExpr

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

2025-04-08 Thread via cfe-commits
@@ -4528,6 +4528,115 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { SunilKuravinakop wrote: It is my mistake in naming the function as getIni

[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 to dig for the captured expr here?

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

2025-04-08 Thread via cfe-commits
@@ -4528,6 +4528,115 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { SunilKuravinakop wrote: I use S.clauses() to get the list of all the clau

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
https://github.com/inbelic approved this pull request. LGTM, just two small things https://github.com/llvm/llvm-project/pull/134174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Handle incomplete array types (PR #133508)

2025-04-08 Thread Chris B via cfe-commits
@@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) { } } } - -static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E, -llvm::SmallVectorImpl &List, -llvm::SmallVectorImpl &Des

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
@@ -2268,17 +2268,15 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, // handling here. if (ToType->isArrayParameterType()) { FromType = S.Context.getArrayParameterType(FromType); - SCS.First = ICK_HLSL_Array_RValue; } else if (

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

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

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-08 Thread Farzon Lotfi via cfe-commits
farzonl wrote: Codgen looks right. The only changes I want to see are around testing. https://github.com/llvm/llvm-project/pull/134288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
@@ -2268,17 +2268,15 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, // handling here. if (ToType->isArrayParameterType()) { FromType = S.Context.getArrayParameterType(FromType); - SCS.First = ICK_HLSL_Array_RValue; } else if (

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-08 Thread via cfe-commits
https://github.com/metkarpoonam updated https://github.com/llvm/llvm-project/pull/133828 >From 3a45246453d120da108e597d23da0fb8d9df0b1b Mon Sep 17 00:00:00 2001 From: Poonam Vilas Metkar Date: Mon, 31 Mar 2025 16:49:18 -0700 Subject: [PATCH 01/16] Implement a dst function with test cases for HL

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-08 Thread via cfe-commits
https://github.com/DenisGZM updated https://github.com/llvm/llvm-project/pull/133107 >From c46eda67cd7434dcce5c1f29125a940dc4ff64ba Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Wed, 26 Mar 2025 18:29:38 +0300 Subject: [PATCH 1/5] [CLANG] Enable alignas after GNU attributes --- clang/l

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

2025-04-08 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/134536 >From 81e1cd76594d3eaeda67d5888e5e5daa63fb0e12 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 6 Apr 2025 14:31:35 +0200 Subject: [PATCH 1/5] [CIR] Upstream ArraySubscriptExpr for fixed size array -

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

2025-04-08 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/134536 >From 81e1cd76594d3eaeda67d5888e5e5daa63fb0e12 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 6 Apr 2025 14:31:35 +0200 Subject: [PATCH 1/5] [CIR] Upstream ArraySubscriptExpr for fixed size array -

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

2025-04-08 Thread Amr Hesham via cfe-commits
@@ -232,6 +233,152 @@ 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] a6853cd - [NVPTX] Auto-Upgrade llvm.nvvm.atomic.load.{inc,dec}.32 (#134111)

2025-04-08 Thread via cfe-commits
Author: Alex MacLean Date: 2025-04-08T13:44:11-07:00 New Revision: a6853cd9af40eb330b9aec9762093be077e02f6c URL: https://github.com/llvm/llvm-project/commit/a6853cd9af40eb330b9aec9762093be077e02f6c DIFF: https://github.com/llvm/llvm-project/commit/a6853cd9af40eb330b9aec9762093be077e02f6c.diff

[clang] [CIR][NFC] Upstream LValueBaseInfo handling (PR #134928)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes Previous implementations that used the cir::LValue class omitted hanling of the LValueBaseInfo class, which tracks information about the basis for the LValue's alignment. As mo

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

2025-04-08 Thread Austin Schuh 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 { AustinSchuh wrote: That is super helpful, thanks! I'll get back to you soon https://github.

[clang] [llvm] [NVPTX] Auto-Upgrade llvm.nvvm.atomic.load.{inc,dec}.32 (PR #134111)

2025-04-08 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean closed https://github.com/llvm/llvm-project/pull/134111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Handle incomplete array types (PR #133508)

2025-04-08 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/133508 >From 6234f442adfebaaf73328d2c09ee443facc848b0 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 27 Mar 2025 09:26:31 -0500 Subject: [PATCH 1/5] [HLSL] Handle incomplete array types This refactors the

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

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,152 @@ 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][MicrosoftMangle] Implement mangling for ConstantMatrixType (PR #134930)

2025-04-08 Thread via cfe-commits
https://github.com/Losy001 created https://github.com/llvm/llvm-project/pull/134930 This pull request implements mangling for the ConstantMatrixType, allowing matrices to be used on Windows. Related issues: #53158, #127127 This example code: ```cpp #include #include typedef float Matrix4 _

[clang] [Clang][MicrosoftMangle] Implement mangling for ConstantMatrixType (PR #134930)

2025-04-08 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

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

2025-04-08 Thread Kaitlin Peng via cfe-commits
@@ -0,0 +1,34 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s ---

[clang] 1a1698b - [CIR] Handle NullStmt (#134889)

2025-04-08 Thread via cfe-commits
Author: Andy Kaylor Date: 2025-04-08T13:55:12-07:00 New Revision: 1a1698b5dde28debc8331ca933a226e79164949a URL: https://github.com/llvm/llvm-project/commit/1a1698b5dde28debc8331ca933a226e79164949a DIFF: https://github.com/llvm/llvm-project/commit/1a1698b5dde28debc8331ca933a226e79164949a.diff L

[clang] [Clang][MicrosoftMangle] Implement mangling for ConstantMatrixType (PR #134930)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Losy001) Changes This pull request implements mangling for the ConstantMatrixType, allowing matrices to be used on Windows. Related issues: #53158, #127127 This example code: ```cpp #include #include typedef f

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

2025-04-08 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM. Probably give @mshockwave a chance to weigh in before landing, though. https://github.com/llvm/llvm-project/pull/134065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

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

2025-04-08 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm requested changes to this pull request. These should not have side effects. The problem you are experiencing is because the design of the convergent attribute is broken. It imposes a structural requirement on the IR, rather than relaxing an assumed restriction. Whateve

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-08 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/134713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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) || __

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

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

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

2025-04-08 Thread Matheus Izvekov 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

[libclc] 0e98817 - libclc: frexp: fix implementation regarding denormals (#134823)

2025-04-08 Thread via cfe-commits
Author: Romaric Jodin Date: 2025-04-08T14:50:26+01:00 New Revision: 0e9881745834863a6f5a3a0556bb3eb75cdf URL: https://github.com/llvm/llvm-project/commit/0e9881745834863a6f5a3a0556bb3eb75cdf DIFF: https://github.com/llvm/llvm-project/commit/0e9881745834863a6f5a3a0556bb3eb75cdf.diff

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

2025-04-08 Thread Matheus Izvekov 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] [Clang][AMDGPU] Improve error message when device libraries for COV6 are missing (PR #134745)

2025-04-08 Thread Shilei Tian via cfe-commits
https://github.com/shiltian closed https://github.com/llvm/llvm-project/pull/134745 ___ 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] 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] 3f38cd0 - Revert "Inline: Propagate callsite nofpclass attribute"

2025-04-08 Thread Matt Arsenault via cfe-commits
Author: Matt Arsenault Date: 2025-04-08T23:15:00+07:00 New Revision: 3f38cd07d820248fd2043efb1341fabaac2d84a6 URL: https://github.com/llvm/llvm-project/commit/3f38cd07d820248fd2043efb1341fabaac2d84a6 DIFF: https://github.com/llvm/llvm-project/commit/3f38cd07d820248fd2043efb1341fabaac2d84a6.diff

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

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -2616,6 +2616,18 @@ bool ASTReader::shouldDisableValidationForFile( return false; } +namespace { + +std::pair +getUnresolvedInputFilenames(const ASTReader::RecordData &Record, jansvoboda11 wrote: Nit: Per [LLVM Coding Standards](https://llvm.org/docs/Co

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

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -90,63 +90,132 @@ static bool checkHeaderSearchPaths(const HeaderSearchOptions &HSOpts, using PrebuiltModuleFilesT = decltype(HeaderSearchOptions::PrebuiltModuleFiles); -/// A listener that collects the imported modules and optionally the input -/// files. +/// A listene

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

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -237,6 +237,17 @@ class ASTReaderListener { return true; } + /// Overloaded member function of \c visitInputFile that should + /// be defined when the input file contains both the virtual and external + /// paths, for example when deserializing input files from AST

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

2025-04-08 Thread Alex MacLean via cfe-commits
@@ -1548,6 +1548,45 @@ let TargetPrefix = "nvvm" in { Intrinsic<[llvm_v2f16_ty], [llvm_i16_ty], [IntrNoMem, IntrNoCallback]>; def int_nvvm_e5m2x2_to_f16x2_rn_relu : ClangBuiltin<"__nvvm_e5m2x2_to_f16x2_rn_relu">, Intrinsic<[llvm_v2f16_ty], [llvm_i16_ty], [IntrNoM

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

2025-04-08 Thread Alex MacLean via cfe-commits
@@ -1548,6 +1548,45 @@ let TargetPrefix = "nvvm" in { Intrinsic<[llvm_v2f16_ty], [llvm_i16_ty], [IntrNoMem, IntrNoCallback]>; def int_nvvm_e5m2x2_to_f16x2_rn_relu : ClangBuiltin<"__nvvm_e5m2x2_to_f16x2_rn_relu">, Intrinsic<[llvm_v2f16_ty], [llvm_i16_ty], [IntrNoM

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

2025-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/134617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from an 80-col formatting nit, thank you for the fix! https://github.com/llvm/llvm-project/pull/134617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

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

2025-04-08 Thread Aaron Ballman 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] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-04-08 Thread CHANDRA GHALE 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] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-04-08 Thread CHANDRA GHALE 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] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-04-08 Thread CHANDRA GHALE 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] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-04-08 Thread CHANDRA GHALE via cfe-commits
@@ -5201,6 +5345,9 @@ void CGOpenMPRuntime::emitReduction(CodeGenFunction &CGF, SourceLocation Loc, CGF.EmitBranch(DefaultBB); CGF.EmitBlock(DefaultBB, /*IsFinished=*/true); + if (Options.IsPrivateVarReduction) { +emitPrivateReduction(CGF, Loc, Privates, LHSExprs, RH

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

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -90,63 +90,132 @@ static bool checkHeaderSearchPaths(const HeaderSearchOptions &HSOpts, using PrebuiltModuleFilesT = decltype(HeaderSearchOptions::PrebuiltModuleFiles); -/// A listener that collects the imported modules and optionally the input -/// files. +/// A listene

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

2025-04-08 Thread Alex MacLean via cfe-commits
@@ -1944,6 +1944,62 @@ def : Pat<(int_nvvm_e5m2x2_to_f16x2_rn Int16Regs:$a), def : Pat<(int_nvvm_e5m2x2_to_f16x2_rn_relu Int16Regs:$a), (CVT_f16x2_e5m2x2 $a, CvtRN_RELU)>; +def : Pat<(int_nvvm_ff_to_e2m3x2_rn f32:$a, f32:$b), + (CVT_e2m3x2_f32 $a, $b, CvtRN)

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

2025-04-08 Thread Alex MacLean via cfe-commits
@@ -703,6 +703,53 @@ let hasSideEffects = false in { defm CVT_to_tf32_rz_satf : CVT_TO_TF32<"rz.satfinite", [hasPTX<86>, hasSM<100>]>; defm CVT_to_tf32_rn_relu_satf : CVT_TO_TF32<"rn.relu.satfinite", [hasPTX<86>, hasSM<100>]>; defm CVT_to_tf32_rz_relu_satf : CVT_TO_TF

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

2025-04-08 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/134617 >From 64210203803f7ba9deec06d467ee570bff761108 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Sun, 6 Apr 2025 00:17:38 +0300 Subject: [PATCH 1/5] [Clang] add ext warning for missing return in 'main'

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

2025-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Please be sure to update https://github.com/llvm/llvm-project/blob/46d4c3b1f64dfbca2a029ff30434aaa5248fc190/clang/docs/InternalsManual.rst?plain=1#L227 as well so the new `%quoted` specifier is explicitly documented. https://github.com/llvm/llvm-proje

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

2025-04-08 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/134892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [fatlto] Add coroutine passes when using FatLTO with ThinLTO (PR #134434)

2025-04-08 Thread Vitaly Buka via cfe-commits
@@ -1692,6 +1692,19 @@ PassBuilder::buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO, if (ThinLTO && PGOOpt && PGOOpt->Action == PGOOptions::SampleUse) MPM.addPass(buildThinLTODefaultPipeline(Level, /*ImportSummary=*/nullptr)); else { +// ModuleSimp

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

2025-04-08 Thread via cfe-commits
https://github.com/Andres-Salamanca updated https://github.com/llvm/llvm-project/pull/134333 >From a91edc37387fb6babceee62bbdd97fca003fad5a Mon Sep 17 00:00:00 2001 From: Andres Salamanca Date: Thu, 3 Apr 2025 12:07:25 -0500 Subject: [PATCH 1/3] [CIR] Add if statement support Upstream if statem

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-08 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,45 @@ +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s +; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC + +target triple = "dxil-pc-shadermodel6.7-library" + +;CHECK: ; Combined Shader Flags for Module +;CHECK-NEXT: ;

<    1   2   3   4   5   >