[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-11 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 a9cd941f392dbf99ddfcde9721bd5c485823bdf0 35f20bbe5ce45194dff68c52018cb3cf04b533f7 --e

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: > Thanks for the commit, I'm satisfied with it :) > > I actually like that these two related changes (the checker change and the > constraint manager improvement) are handled together in a single commit -- > this way somebody who browses the commit log ca

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/115579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -verify + +void clang_analyzer_eval(int); + +void test_derived_sym_simplification_on_assume(int s0, int s1) { + int elem = s0 + s1 + 1; + if (elem-- == 0) // elem = s

[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

2024-11-11 Thread Utkarsh Saxena via cfe-commits
@@ -3967,6 +3967,80 @@ Attribute ``trivial_abi`` has no effect in the following cases: }]; } + +def LifetimeCaptureByDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Similar to `lifetimebound`_, the ``lifetime_capture_by(X)`` attribute on a

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=unix.StdCLibraryFunctions \ +// RUN: -analyzer-config unix.StdCLibraryFunctions:ModelPOSIX=true \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -triple x86_64-unknown-linux-gnu \ +//

[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

2024-11-11 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/111499 >From 85df517d9e09f355691fa797e80514e738999f1b Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Sun, 10 Nov 2024 07:42:49 + Subject: [PATCH] Introduce [[clang::lifetime_capture_by]] --- clang/docs/Release

[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

2024-11-11 Thread Utkarsh Saxena via cfe-commits
@@ -3967,6 +3967,80 @@ Attribute ``trivial_abi`` has no effect in the following cases: }]; } + +def LifetimeCaptureByDocs : Documentation { usx95 wrote: Done. https://github.com/llvm/llvm-project/pull/111499 ___

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-11 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > So is the sign function currently implemented in the OpenCL headers? The sign function for SPIR-V/Mesa is currently implemented by libclc [here](https://github.com/llvm/llvm-project/blob/main/libclc/generic/lib/common/sign.cl). With this change, `sign` now calls `__clc_sig

[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

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

[clang] [analyzer][NFC] Make RegionStore dumps deterministic (PR #115615)

2024-11-11 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/115615 >From 26f0cfabe3328c8eb8a861dd5d1d541921499f0c Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sat, 9 Nov 2024 15:55:08 +0100 Subject: [PATCH 1/2] [analyzer][NFC] Make RegionStore dumps deterministic Dump t

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2024-11-11 Thread Jon Roelofs via cfe-commits
jroelofs wrote: I think this diagnostic should not be firing on `%x` format specifiers: https://clang.godbolt.org/z/YGh1qdq1h ``` #include void bad() { int u = 0; printf("%x\n", u); } ``` ``` :5:20: warning: format specifies type 'unsigned int' but the argument has type 'int' [-Wfor

[clang] [analyzer][NFC] Make RegionStore dumps deterministic (PR #115615)

2024-11-11 Thread Balazs Benics via cfe-commits
@@ -232,27 +233,86 @@ class RegionBindingsRef : public llvm::ImmutableMapRef StringifyCache; +auto ToString = [&StringifyCache](const MemRegion *R) { + auto [Place, Inserted] = StringifyCache.try_emplace(R); + if (!Inserted) +return Place->second; + std

[clang] [llvm] [Offload] Move HIP and CUDA to new driver by default (PR #84420)

2024-11-11 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/84420 >From 8d63e56aa5af8b86d757d1f1ff68267d3dd1ccd4 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 7 Mar 2024 15:48:00 -0600 Subject: [PATCH] [Offload] Move HIP and CUDA to new driver by default Summary: This

[clang] [PAC][clang][Driver] Add signed GOT flag (PR #96160)

2024-11-11 Thread Fangrui Song via cfe-commits
MaskRay wrote: Sorry, I made a mistake by approving #85235, which added a lot of driver options. It's not clear who are the initial ELF ptrauth users, but I am not sure with a very small user base, there are a lot of demands to customize the protection in such a fine-grained manner. Using cc1

[clang] [flang] [clang][flang] Support -time in both clang and flang (PR #109165)

2024-11-11 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/109165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9d4837f - [clang][deps][modules] Allocate input file paths lazily (#114457)

2024-11-11 Thread via cfe-commits
Author: Jan Svoboda Date: 2024-11-11T09:46:50-08:00 New Revision: 9d4837f47c48c634d4a0ac799188e1f5332495ef URL: https://github.com/llvm/llvm-project/commit/9d4837f47c48c634d4a0ac799188e1f5332495ef DIFF: https://github.com/llvm/llvm-project/commit/9d4837f47c48c634d4a0ac799188e1f5332495ef.diff L

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-11-11 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/114457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3a03513 - Revert "[clang] Introduce [[clang::lifetime_capture_by(X)]] (#111499)"

2024-11-11 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-11-11T20:57:26+01:00 New Revision: 3a03513fc6ef8f3272d33be19164243c9dbf0452 URL: https://github.com/llvm/llvm-project/commit/3a03513fc6ef8f3272d33be19164243c9dbf0452 DIFF: https://github.com/llvm/llvm-project/commit/3a03513fc6ef8f3272d33be19164243c9dbf0452.diff

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-hexagon-elf` running on `hexagon-build-03` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/40/builds/2750 Here is the relevant piece of the buil

[clang] [clang][deps] Only write preprocessor info into PCMs (PR #115239)

2024-11-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-m68k-linux-cross` running on `suse-gary-m68k-cross` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/1875 Here is the relevant piece o

[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

2024-11-11 Thread Evgenii Stepanov via cfe-commits
eugenis wrote: Please note that this change also introduces new memory leaks on the waterfall: https://lab.llvm.org/buildbot/#/builders/169/builds/5193 https://github.com/llvm/llvm-project/pull/111499 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [Clang] Add support for scoped atomic thread fence (PR #115545)

2024-11-11 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: LGTM https://github.com/llvm/llvm-project/pull/115545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Emit constrained atan2 intrinsic for clang builtin (PR #113636)

2024-11-11 Thread Tex Riddell via cfe-commits
tex3d wrote: @farzonl > Here are just a handful of tests that we might want to update, but there are > others: I'm updating these tests that were called out. What others do I need to look for? How do I know if I've found all the tests I need to update? https://github.com/llvm/llvm-project/

[clang] [Clang] enhance diagnostic by attaching source location to deduced type in trailing return without auto (PR #115786)

2024-11-11 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/115786 Fixes #78694 >From da1b3982e84114cb1214ca5c3d8ed520d1589b83 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 12 Nov 2024 00:59:37 +0200 Subject: [PATCH] [Clang] enhance diagnostic by attaching source lo

[clang] [Clang] enhance diagnostic by attaching source location to deduced type in trailing return without auto (PR #115786)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Oleksandr T. (a-tarasyuk) Changes Fixes #78694 --- Full diff: https://github.com/llvm/llvm-project/pull/115786.diff 3 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+1) - (modified) clang/lib/Sema/SemaType.cpp (+12-3) - (mo

[clang] [clang][ASTImporter] Allow import of similar friend template with different depth (PR #115734)

2024-11-11 Thread Michael Buch via cfe-commits
@@ -6120,6 +6119,19 @@ ExpectedDecl ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) { // see ASTTests test ImportExistingFriendClassTemplateDef. continue; } +// When importing a friend, it is possible that multiple declarations

[clang] [clang][OpenMP][NFC] Move 'allocate' clause modifier parsing into fun… (PR #115775)

2024-11-11 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/115775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][FMV] Fix crash with cpu_specific attribute. (PR #115762)

2024-11-11 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/115762 Raised here https://github.com/llvm/llvm-project/issues/115299. The commit a2d3099 introduced `replaceDeclarationWith`, but it shouldn't be called by the fallthrough code which handles the cpu_specific attribu

[clang] [clang][FMV] Fix crash with cpu_specific attribute. (PR #115762)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Alexandros Lamprineas (labrinea) Changes Raised here https://github.com/llvm/llvm-project/issues/115299. The commit a2d3099 introduced `replaceDeclarationWith`, but it shouldn't be called by the fallthro

[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

2024-11-11 Thread Nikita Popov via cfe-commits
nikic wrote: I've reverted this change, because it causes a large compile-time regression, see https://llvm-compile-time-tracker.com/compare.php?from=4a68e4cbd2423dcacada8162ab7c4bb8d7f7e2cf&to=8c4331c1abeb33eabf3cdbefa7f2b6e0540e7f4f&stat=instructions:u. https://github.com/llvm/llvm-project/p

[clang] [clang][AST] Add 'IgnoreTemplateParmDepth' to structural equivalence cache (PR #115518)

2024-11-11 Thread Michael Buch via cfe-commits
Michael137 wrote: > > Another possible solution: Use two `NonEquivalentDecls` sets, one for > > `IgnoreTemplateParmDepth = true` and one for `false`. This may use less > > memory (no rarely used third value in the key) but requires more code > > changes. > > I like this idea, and I think it c

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-solaris11-sparcv9` running on `solaris11-sparcv9` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/13/builds/3473 Here is the relevant piece of t

[clang] [clang][deps] Only write preprocessor info into PCMs (PR #115239)

2024-11-11 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/115239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 25d1ac1 - [clang][deps] Only write preprocessor info into PCMs (#115239)

2024-11-11 Thread via cfe-commits
Author: Jan Svoboda Date: 2024-11-11T13:07:08-08:00 New Revision: 25d1ac11d537debb217c65c2bcdd087a60cff58e URL: https://github.com/llvm/llvm-project/commit/25d1ac11d537debb217c65c2bcdd087a60cff58e DIFF: https://github.com/llvm/llvm-project/commit/25d1ac11d537debb217c65c2bcdd087a60cff58e.diff L

[clang] [NFC][Clang] Use range for loops in ClangDiagnosticsEmitter (PR #115573)

2024-11-11 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/115573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang] Use range for loops in ClangDiagnosticsEmitter (PR #115573)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rahul Joshi (jurahul) Changes Use range based for loops in Clang diagnostics emitter. --- Full diff: https://github.com/llvm/llvm-project/pull/115573.diff 1 Files Affected: - (modified) clang/utils/TableGen/ClangDiagnosticsEmitter.cpp (

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-11-11 Thread via cfe-commits
@@ -4008,6 +3996,38 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction( Owner = FunctionTemplate->getLexicalDeclContext(); FunctionDecl *FD = FunctionTemplate->getTemplatedDecl(); + // C++20 [temp.deduct.general]p5: (CWG2369) + // If the function templat

[clang] [clang][OpenMP][NFC] Move 'allocate' clause modifier parsing into fun… (PR #115775)

2024-11-11 Thread David Pagan via cfe-commits
https://github.com/ddpagan created https://github.com/llvm/llvm-project/pull/115775 …ction Parsing of 'allocate' clause modifier ('allocator') has been moved into a separate function in anticipation of adding another modifier ('align'). >From 78e9809b743f74207dfab2e2271d91a04b2f75ca Mon Sep 1

[clang] [clang][OpenMP][NFC] Move 'allocate' clause modifier parsing into fun… (PR #115775)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: David Pagan (ddpagan) Changes …ction Parsing of 'allocate' clause modifier ('allocator') has been moved into a separate function in anticipation of adding another modifier ('align'). --- Full diff: https://github.com/llvm/llvm-project/pu

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/115777 Summary: GPU targets support several different address spaces which have differing semantics. When targeting C/C++ we have a very pessimistic view that these address spaces are completely incompatible. This has a

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Joseph Huber (jhuber6) Changes Summary: GPU targets support several different address spaces which have differing semantics. When targeting C/C++ we have a very pessimistic view that these address spaces are completely incompatible.

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/115777 >From 34eb41f58518c79c627b5c1cc522c4e142c2d420 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 11 Nov 2024 16:10:31 -0600 Subject: [PATCH] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPU

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-11-11 Thread Matheus Izvekov via cfe-commits
@@ -4008,6 +3996,38 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction( Owner = FunctionTemplate->getLexicalDeclContext(); FunctionDecl *FD = FunctionTemplate->getTemplatedDecl(); + // C++20 [temp.deduct.general]p5: (CWG2369) + // If the function templat

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-11 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/114255 >From 2835f0eae90061d390d1b011b6a98bf43be1a0c6 Mon Sep 17 00:00:00 2001 From: higher-performance Date: Wed, 30 Oct 2024 12:01:00 -0400 Subject: [PATCH] Extend bugprone-use-after-move check to handle

[clang] [NFC][Clang] Use range for loops in ClangDiagnosticsEmitter (PR #115573)

2024-11-11 Thread Kazu Hirata via cfe-commits
@@ -185,10 +174,8 @@ static void groupDiagnostics(ArrayRef Diags, } // Assign unique ID numbers to the groups. - unsigned IDNo = 0; - for (std::map::iterator - I = DiagsInGroup.begin(), E = DiagsInGroup.end(); I != E; ++I, ++IDNo) -I->second.IDNo = IDNo; + fo

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Matt Arsenault via cfe-commits
@@ -1579,7 +1579,7 @@ NamedDecl *Sema::getCurFunctionOrMethodDecl() const { } LangAS Sema::getDefaultCXXMethodAddrSpace() const { - if (getLangOpts().OpenCL) + if (getLangOpts().OpenCL || getLangOpts().OpenCLGenericAddressSpace) arsenm wrote: I think this w

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Joseph Huber via cfe-commits
@@ -1579,7 +1579,7 @@ NamedDecl *Sema::getCurFunctionOrMethodDecl() const { } LangAS Sema::getDefaultCXXMethodAddrSpace() const { - if (getLangOpts().OpenCL) + if (getLangOpts().OpenCL || getLangOpts().OpenCLGenericAddressSpace) jhuber6 wrote: I think it's

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #112400)

2024-11-11 Thread Justin Bogner via cfe-commits
@@ -1824,6 +1824,23 @@ static bool CheckAnyScalarOrVector(Sema *S, CallExpr *TheCall, return false; } +static bool CheckNotScalarType(Sema *S, CallExpr *TheCall, QualType Scalar, + unsigned ArgIndex) { + assert(TheCall->getNumArgs() >= ArgInde

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #112400)

2024-11-11 Thread Justin Bogner via cfe-commits
@@ -2217,6 +2217,105 @@ __attribute__((convergent)) double3 WaveReadLaneAt(double3, int32_t); _HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_read_lane_at) __attribute__((convergent)) double4 WaveReadLaneAt(double4, int32_t); +//===

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Joseph Huber via cfe-commits
jhuber6 wrote: https://godbolt.org/z/qWGaejTx9 for this case, I'm wondering if there's a way to resolve this by considering the AS as part of the pointer, since I don't know if AS means anything on a non-pointer type. https://github.com/llvm/llvm-project/pull/115777 ___

[clang] [clang][Fuchsia] Have global dtors use llvm.global_dtors over atexit (PR #115788)

2024-11-11 Thread via cfe-commits
https://github.com/PiJoules created https://github.com/llvm/llvm-project/pull/115788 None >From 809856e87ba89165061cdd42904d99439793f322 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Mon, 11 Nov 2024 15:40:47 -0800 Subject: [PATCH] [clang][Fuchsia] Have global dtors use llvm.global_dtors o

[clang] [clang][Fuchsia] Have global dtors use llvm.global_dtors over atexit (PR #115788)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (PiJoules) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/115788.diff 2 Files Affected: - (modified) clang/lib/CodeGen/ItaniumCXXABI.cpp (+8) - (added) clang/test/CodeGenCXX/fuchsia-global-dtor.cpp (+25)

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Artem Belevich via cfe-commits
Artem-B wrote: > This has a lot of unfortable effects that limit using address spaces in C++ > as well > as making it more difficult to work with. Can you give some examples? It sounds that what you really want is for address space qualifiers to not be part of a type signature. OpenCL sort o

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2024-11-11 Thread Justin Stitt via cfe-commits
@@ -6664,6 +6664,13 @@ def err_builtin_counted_by_ref_invalid_lhs_use : Error< def err_builtin_counted_by_ref_has_side_effects : Error< "'__builtin_counted_by_ref' argument cannot have side-effects">; +def warn_wraps_attr_var_decl_type_not_integer : Warning< + "using attrib

[clang] [Clang] Add support for scoped atomic thread fence (PR #115545)

2024-11-11 Thread Matt Arsenault via cfe-commits
@@ -5133,6 +5133,132 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Builder.SetInsertPoint(ContBB); return RValue::get(nullptr); } + case Builtin::BI__scoped_atomic_thread_fence: { +auto ScopeModel = AtomicScopeModel::create(

[clang] [Clang] Add support for scoped atomic thread fence (PR #115545)

2024-11-11 Thread Matt Arsenault via cfe-commits
@@ -5133,6 +5133,132 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Builder.SetInsertPoint(ContBB); return RValue::get(nullptr); } + case Builtin::BI__scoped_atomic_thread_fence: { +auto ScopeModel = AtomicScopeModel::create(

[clang] [Clang] Add support for scoped atomic thread fence (PR #115545)

2024-11-11 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/115545 >From 9b8cb87e0e12899df3a5af7f312f637a6c242921 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 8 Nov 2024 15:42:04 -0600 Subject: [PATCH 1/4] [Clang] Add support for scoped atomic thread fence Summary: P

[clang] [Clang] Add support for scoped atomic thread fence (PR #115545)

2024-11-11 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/115545 >From 9b8cb87e0e12899df3a5af7f312f637a6c242921 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 8 Nov 2024 15:42:04 -0600 Subject: [PATCH 1/4] [Clang] Add support for scoped atomic thread fence Summary: P

[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

2024-11-11 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/115094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add support for scoped atomic thread fence (PR #115545)

2024-11-11 Thread Joseph Huber via cfe-commits
@@ -5133,6 +5133,132 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Builder.SetInsertPoint(ContBB); return RValue::get(nullptr); } + case Builtin::BI__scoped_atomic_thread_fence: { +auto ScopeModel = AtomicScopeModel::create(

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > This has a lot of unfortable effects that limit using address spaces in C++ > > as well > > as making it more difficult to work with. > > Can you give some examples? > > It sounds that what you really want is for address space qualifiers to not be > part of a type signature

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > > This has a lot of unfortable effects that limit using address spaces in > > > C++ as well > > > as making it more difficult to work with. > > > > > > Can you give some examples? > > It sounds that what you really want is for address space qualifiers to not > > be part of

[clang] [codegen] Fix crash in codegan caused by pointer calculation overflow (PR #115791)

2024-11-11 Thread via cfe-commits
https://github.com/vabridgers created https://github.com/llvm/llvm-project/pull/115791 Fixes https://github.com/llvm/llvm-project/issues/48168 Under certain conditions, the front end does not detect a possible overflow address calculations until codegen. This change emits a warning instead of

[clang] [codegen] Fix crash in codegan caused by pointer calculation overflow (PR #115791)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: None (vabridgers) Changes Fixes https://github.com/llvm/llvm-project/issues/48168 Under certain conditions, the front end does not detect a possible overflow address calculations until codegen. This change emits a warning instead

[clang] [codegen] Fix crash in codegan caused by pointer calculation overflow (PR #115791)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (vabridgers) Changes Fixes https://github.com/llvm/llvm-project/issues/48168 Under certain conditions, the front end does not detect a possible overflow address calculations until codegen. This change emits a warning instead of allo

[clang] [clang][OpenMP][NFC] Move 'allocate' clause modifier parsing into fun… (PR #115775)

2024-11-11 Thread David Pagan via cfe-commits
https://github.com/ddpagan closed https://github.com/llvm/llvm-project/pull/115775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e8c4842 - [clang][OpenMP][NFC] Move 'allocate' clause modifier parsing into fun… (#115775)

2024-11-11 Thread via cfe-commits
Author: David Pagan Date: 2024-11-11T16:11:16-08:00 New Revision: e8c4842f0ce7a81440e2147a0c9bcc690714a6e5 URL: https://github.com/llvm/llvm-project/commit/e8c4842f0ce7a81440e2147a0c9bcc690714a6e5 DIFF: https://github.com/llvm/llvm-project/commit/e8c4842f0ce7a81440e2147a0c9bcc690714a6e5.diff L

[clang] [clang][OpenMP][NFC] Move 'allocate' clause modifier parsing into fun… (PR #115775)

2024-11-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `libc-x86_64-debian-gcc-fullbuild-dbg` running on `libc-x86_64-debian-fullbuild` while building `clang` at step 4 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/131/builds/10173 Here is t

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2024-11-11 Thread via cfe-commits
https://github.com/no92 updated https://github.com/llvm/llvm-project/pull/87845 >From 9d681fdec1f5f86244dd0ba429f35805e1ddde61 Mon Sep 17 00:00:00 2001 From: no92 Date: Fri, 6 Sep 2024 21:17:53 +0200 Subject: [PATCH 1/4] [llvm] Add managarm OS target --- llvm/include/llvm/ADT/bit.h

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2024-11-11 Thread via cfe-commits
https://github.com/no92 updated https://github.com/llvm/llvm-project/pull/87845 >From 9d681fdec1f5f86244dd0ba429f35805e1ddde61 Mon Sep 17 00:00:00 2001 From: no92 Date: Fri, 6 Sep 2024 21:17:53 +0200 Subject: [PATCH 1/3] [llvm] Add managarm OS target --- llvm/include/llvm/ADT/bit.h

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -273,6 +273,9 @@ def FeatureAMXCOMPLEX : SubtargetFeature<"amx-complex", "HasAMXCOMPLEX", "true", def FeatureAMXFP8 : SubtargetFeature<"amx-fp8", "HasAMXFP8", "true", "Support AMX-FP8 instructions", [

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -370,6 +370,71 @@ let Predicates = [HasAMXTRANSPOSE, In64BitMode] in { } } // HasAMXTILE, HasAMXTRANSPOSE +let Predicates = [HasAMXMOVRS, HasAMXTRANSPOSE, In64BitMode], SchedRW = [WriteSystem] in { + def T2RPNTLVWZ0RS : I<0xf8, MRMSrcMemFSIB, (outs TILEPair:$dst), +

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -1880,6 +1880,7 @@ const StringMap sys::getHostCPUFeatures() { !getX86CpuIDAndInfoEx(0x1e, 0x1, &EAX, &EBX, &ECX, &EDX); Features["amx-fp8"] = HasLeaf1E && ((EAX >> 4) & 1) && HasAMXSave; Features["amx-transpose"] = HasLeaf1E && ((EAX >> 5) & 1) && Has

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -370,6 +370,71 @@ let Predicates = [HasAMXTRANSPOSE, In64BitMode] in { } } // HasAMXTILE, HasAMXTRANSPOSE +let Predicates = [HasAMXMOVRS, HasAMXTRANSPOSE, In64BitMode], SchedRW = [WriteSystem] in { + def T2RPNTLVWZ0RS : I<0xf8, MRMSrcMemFSIB, (outs TILEPair:$dst), +

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,201 @@ +/* ===--- amxmovrstransposeintrin.h - AMX_MOVRS_TRANSPOSE intrinsics -*- C++ + * -*-=== phoebewang wrote: Adjust for 1 line. https://github.com/llvm/llvm-project/pull/115151 ___ cfe-commits m

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -656,6 +656,11 @@ _storebe_i64(void * __P, long long __D) { #include #endif +#if !defined(__SCE__) || __has_feature(modules) || defined(__AMX_MOVRS__) +#include +#include phoebewang wrote: This needs to be guarded with ``` #if !defined(__SCE__) || __has

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -370,6 +370,71 @@ let Predicates = [HasAMXTRANSPOSE, In64BitMode] in { } } // HasAMXTILE, HasAMXTRANSPOSE +let Predicates = [HasAMXMOVRS, HasAMXTRANSPOSE, In64BitMode], SchedRW = [WriteSystem] in { + def T2RPNTLVWZ0RS : I<0xf8, MRMSrcMemFSIB, (outs TILEPair:$dst), +

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,14 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown \ +// RUN: -target-feature +amx-int8 -target-feature +amx-bf16 \ +// RUN: -target-feature +am

[clang] [llvm] [X86][AMX] Support AMX-MOVRS (PR #115151)

2024-11-11 Thread Phoebe Wang via cfe-commits
@@ -5305,6 +5339,13 @@ void X86DAGToDAGISel::Select(SDNode *Node) { ReplaceNode(Node, CNode); return; } +case Intrinsic::x86_t2rpntlvwz0rs: +case Intrinsic::x86_t2rpntlvwz0rst1: +case Intrinsic::x86_t2rpntlvwz1rs: +case Intrinsic::x86_t2rpntlvwz1

[clang] [llvm] Emit constrained atan2 intrinsic for clang builtin (PR #113636)

2024-11-11 Thread Tex Riddell via cfe-commits
https://github.com/tex3d updated https://github.com/llvm/llvm-project/pull/113636 >From a6776121bb118fe4083ccb94fa582cca1aef7f9b Mon Sep 17 00:00:00 2001 From: Tex Riddell Date: Tue, 15 Oct 2024 16:18:44 -0700 Subject: [PATCH 1/4] Emit constrained atan2 intrinsic for clang builtin This change

[clang] [codegen] Fix crash in codegan caused by pointer calculation overflow (PR #115791)

2024-11-11 Thread via cfe-commits
vabridgers wrote: I know the diagnostic could probably be better, just trying to get the code review party started. https://github.com/llvm/llvm-project/pull/115791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [llvm] [RISCV] Add TT-Ascalon-d8 processor (PR #115100)

2024-11-11 Thread Petr Penzin via cfe-commits
@@ -104,6 +104,62 @@ // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=syntacore-scr1-max | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR1-MAX %s // MTUNE-SYNTACORE-SCR1-MAX: "-tune-cpu" "syntacore-scr1-max" +// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=tt-ascalo

[clang] da032a6 - [Wunsafe-buffer-usage] Fix false positives in handling string literals. (#115552)

2024-11-11 Thread via cfe-commits
Author: Malavika Samak Date: 2024-11-11T16:47:28-08:00 New Revision: da032a609c1bde6f6775cf1650e08a205920d920 URL: https://github.com/llvm/llvm-project/commit/da032a609c1bde6f6775cf1650e08a205920d920 DIFF: https://github.com/llvm/llvm-project/commit/da032a609c1bde6f6775cf1650e08a205920d920.diff

[clang] [Wunsafe-buffer-usage] Fix false positives in handling string literals. (PR #115552)

2024-11-11 Thread Malavika Samak via cfe-commits
https://github.com/malavikasamak closed https://github.com/llvm/llvm-project/pull/115552 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Artem Belevich via cfe-commits
Artem-B wrote: I think I generally agree with @AlexVlx argument. While the patch may solve you immediate issue, I think it's not going to give you a usable compilation model for AS-qualified pointers. If you are defining your own C++ extension along the lines of CUDA/HIP/OpenCL, you would hav

[clang] [llvm] [RISCV] Add TT-Ascalon-d8 processor (PR #115100)

2024-11-11 Thread Petr Penzin via cfe-commits
https://github.com/ppenzin updated https://github.com/llvm/llvm-project/pull/115100 >From 246f1374b31ac11041deffe2f4afc35ee93cc66f Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Tue, 5 Nov 2024 13:11:48 -0600 Subject: [PATCH 1/4] [RISCV] Add TT-Ascalon-d8 processor Ascalon is an out-of-order

[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)

2024-11-11 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I think I generally agree with @AlexVlx argument. While the patch may solve > you immediate issue, I think it's not going to give you a usable compilation > model for AS-qualified pointers. > > If you are defining your own C++ extension along the lines of > CUDA/HIP/OpenCL, y

[clang] [-Wunsafe-buffer-usage] Fix false positives in warning againt 2-parameter std::span constructor (PR #115797)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Malavika Samak (malavikasamak) Changes Do not warn when two parameter constructor receives pointer address from a std::addressof method and the span size is set to 1. (rdar://139298119) --- Full diff: https://github.com/llvm/llvm-project

[clang] [-Wunsafe-buffer-usage] Fix false positives in warning againt 2-parameter std::span constructor (PR #115797)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Malavika Samak (malavikasamak) Changes Do not warn when two parameter constructor receives pointer address from a std::addressof method and the span size is set to 1. (rdar://139298119) --- Full diff: https://github.com/llvm/llv

[clang] [-Wunsafe-buffer-usage] Fix false positives in warning againt 2-parameter std::span constructor (PR #115797)

2024-11-11 Thread Malavika Samak via cfe-commits
https://github.com/malavikasamak created https://github.com/llvm/llvm-project/pull/115797 Do not warn when two parameter constructor receives pointer address from a std::addressof method and the span size is set to 1. (rdar://139298119) >From a60c18973c0ea5b59c7c5f38813083e862f70e6e Mon Sep 1

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore trivial functions and [[clang::noescape]]. (PR #114897)

2024-11-11 Thread Ryosuke Niwa via cfe-commits
@@ -45,32 +52,118 @@ class UncountedLambdaCapturesChecker bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitImplicitCode() const { return false; } - bool VisitLambdaExpr(LambdaExpr *L) { -Checker->visitLambdaExpr(L); +

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore trivial functions and [[clang::noescape]]. (PR #114897)

2024-11-11 Thread Ryosuke Niwa via cfe-commits
@@ -89,7 +182,25 @@ class UncountedLambdaCapturesChecker } printQuotedQualifiedName(Os, Capture.getCapturedVar()); -Os << " to uncounted type is unsafe."; +Os << " to ref-counted / CheckedPtr capable type is unsafe."; + +PathDiagnosticLocation BSLoc(Capture

[clang] [Clang][Driver] Ensure clang can construct toolchain target names (PR #115798)

2024-11-11 Thread Matthew Mirvish via cfe-commits
https://github.com/mincrmatt12 created https://github.com/llvm/llvm-project/pull/115798 This adds an extra validation step to `ToolChain::getTargetAndModeFromProgramName` to actually try constructing the target info for the triple it deduces, instead of just relying on the LLVM target registr

[clang] [-Wunsafe-buffer-usage] Fix false positives in warning againt 2-parameter std::span constructor (PR #115797)

2024-11-11 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 b816c2628919de9a978132347f039ad23794837d a60c18973c0ea5b59c7c5f38813083e862f70e6e --e

[clang] [Clang][Driver] Ensure clang can construct toolchain target names (PR #115798)

2024-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Matthew Mirvish (mincrmatt12) Changes This adds an extra validation step to `ToolChain::getTargetAndModeFromProgramName` to actually try constructing the target info for the triple it deduces, instead of just relying on the LLVM t

[clang] [Clang] Fix dependent expression handling for assumptions (PR #115646)

2024-11-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/115646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

2024-11-11 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/111499 >From a0f866bd9072a7334a3209a5dc668b39154093c1 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Sun, 10 Nov 2024 07:42:49 + Subject: [PATCH] Introduce [[clang::lifetime_capture_by]] --- clang/docs/Release

[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

2024-11-11 Thread Haojian Wu via cfe-commits
@@ -3967,6 +3967,69 @@ Attribute ``trivial_abi`` has no effect in the following cases: }]; } + +def LifetimeCaptureByDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``lifetime_capture_by(X)`` attribute on a function parameter or implic

[clang] [clang] Set FPOptions at the beginning of CompoundStmt (PR #111654)

2024-11-11 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/111654 >From a47216330a0e14025ba2c29a884d6a96d472dd73 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 9 Oct 2024 12:55:22 +0700 Subject: [PATCH 1/2] [clang] Set FPOptions at the beginning of CompoundStmt Compo

  1   2   3   4   >