[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-03-06 Thread Jun Wang via cfe-commits
https://github.com/jwanggit86 edited https://github.com/llvm/llvm-project/pull/79035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-03-06 Thread Jun Wang via cfe-commits
@@ -137,6 +137,12 @@ Removed Compiler Flags Attribute Changes in Clang -- +- Introduced a new function attribute ``__attribute__((amdgpu_max_num_work_groups(x, y, z)))`` or jwanggit86 wrote: In the case of flat workgroup size, the

[clang] a331937 - [MC] Move CompressDebugSections/RelaxELFRelocations from TargetOptions/MCAsmInfo to MCTargetOptions

2024-03-06 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-03-06T23:19:59-08:00 New Revision: a3319371970b599ef65ef1567c440fbdc3a330f4 URL: https://github.com/llvm/llvm-project/commit/a3319371970b599ef65ef1567c440fbdc3a330f4 DIFF: https://github.com/llvm/llvm-project/commit/a3319371970b599ef65ef1567c440fbdc3a330f4.diff

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-03-06 Thread Matt Arsenault via cfe-commits
@@ -137,6 +137,12 @@ Removed Compiler Flags Attribute Changes in Clang -- +- Introduced a new function attribute ``__attribute__((amdgpu_max_num_work_groups(x, y, z)))`` or arsenm wrote: The backend facing parts seem more

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-03-06 Thread Matt Arsenault via cfe-commits
@@ -137,6 +137,12 @@ Removed Compiler Flags Attribute Changes in Clang -- +- Introduced a new function attribute ``__attribute__((amdgpu_max_num_work_groups(x, y, z)))`` or arsenm wrote: Ugh. The ISA manuals usually use "workgroup".

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM with the adding the comments. https://github.com/llvm/llvm-project/pull/84193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/84193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Can you resolve merge conflicts, so that I can review changes to `Sema.h`? https://github.com/llvm/llvm-project/pull/78000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Andreas Fertig via cfe-commits
@@ -1434,13 +1434,18 @@ ExprResult Sema::ActOnCXXThis(SourceLocation Loc) { return Diag(Loc, diag::err_invalid_this_use) << 0; } - return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false); + return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false, +

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Andreas Fertig via cfe-commits
@@ -0,0 +1,54 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -I%S/Inputs -std=c++20 %s + +// expected-no-diagnostics + +#include "std-coroutine.h" + +using size_t = decltype(sizeof(0)); + +struct Generator { + struct promise_type { +int _val{}; + +Generator

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Andreas Fertig via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [clang] Upstream visionOS Availability & DarwinSDKInfo APIs (PR #84279)

2024-03-06 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida updated https://github.com/llvm/llvm-project/pull/84279 >From 777edd2803f87308a6eb4119aacca792a8c62672 Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Wed, 6 Mar 2024 20:29:30 -0800 Subject: [PATCH 1/2] [clang] Support availability annotations for visionOS

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/82229 >From 234e301ab2721ddb2f4b43589785015a7d0aa304 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 19 Feb 2024 01:07:13 -0800 Subject: [PATCH 1/9] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Ryosuke Niwa via cfe-commits
@@ -305,19 +337,21 @@ class TrivialFunctionAnalysisVisitor } bool VisitDeclRefExpr(const DeclRefExpr *DRE) { -if (auto *decl = DRE->getDecl()) { - if (isa(decl)) -return true; - if (isa(decl)) -return true; - if (auto *VD =

[clang] [clang] Upstream visionOS Availability & DarwinSDKInfo APIs (PR #84279)

2024-03-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Cyndy Ishida (cyndyishida) Changes Admittedly a bit awkward, `visionos` is the correct and accepted spelling for annotating availability for xrOS target triples. This patch detects errors and handles cases when `xros` is mistakenly

[clang] [clang] Upstream visionOS Availability & DarwinSDKInfo APIs (PR #84279)

2024-03-06 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida created https://github.com/llvm/llvm-project/pull/84279 Admittedly a bit awkward, `visionos` is the correct and accepted spelling for annotating availability for xrOS target triples. This patch detects errors and handles cases when `xros` is mistakenly passed.

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Shafik Yaghmour via cfe-commits
@@ -1434,13 +1434,18 @@ ExprResult Sema::ActOnCXXThis(SourceLocation Loc) { return Diag(Loc, diag::err_invalid_this_use) << 0; } - return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false); + return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false, +

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,54 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -I%S/Inputs -std=c++20 %s + +// expected-no-diagnostics + +#include "std-coroutine.h" + +using size_t = decltype(sizeof(0)); + +struct Generator { + struct promise_type { +int _val{}; + +Generator

[clang] [clang] Add some CodeGen tests for CWG 4xx issues (PR #83715)

2024-03-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Late review but LGTM https://github.com/llvm/llvm-project/pull/83715 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][Clang] Added builtin support for experimental Zimop extension (PR #79971)

2024-03-06 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: Surely we should instead be defining intrinsics with actual names for the operations we know about? What's the actual use case for needing an arbitrary unnamed one? https://github.com/llvm/llvm-project/pull/79971 ___ cfe-commits

[clang] [RISCV][Clang] Added builtin support for experimental Zimop extension (PR #79971)

2024-03-06 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp commented: The code is OK I think. One question: how will these builtins be used? Are their semantics bound to specific extensions that extend MOPs? https://github.com/llvm/llvm-project/pull/79971 ___ cfe-commits mailing

[clang] [llvm] [X86] Add Support for X86 TLSDESC Relocations (PR #83136)

2024-03-06 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,165 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 +; RUN: llc < %s -mtriple=i686-unknown-unknown --relocation-model=pic -enable-tlsdesc | FileCheck %s --check-prefix=X86 +; RUN: llc < %s

[clang] [llvm] [X86] Add Support for X86 TLSDESC Relocations (PR #83136)

2024-03-06 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang updated https://github.com/llvm/llvm-project/pull/83136 >From cdc9ee6c322af0ceed162f3f714bcd0a22e020c3 Mon Sep 17 00:00:00 2001 From: Phoebe Wang Date: Tue, 27 Feb 2024 22:16:38 +0800 Subject: [PATCH 1/7] [X86] Add Support for X86 TLSDESC Relocations ---

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-06 Thread Victor Chernyakin via cfe-commits
LocalSpook wrote: @erichkeane @AaronBallman https://github.com/llvm/llvm-project/pull/84272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Add Support for X86 TLSDESC Relocations (PR #83136)

2024-03-06 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > I assume that's what you're doing in the place I asked for a comment is > trying to avoid redundantly generating TLSDESC accesses for > _TLS_MODULE_BASE_. I see that we don't generate multiple accesses for > _TLS_MODULE_BASE_ in the test cases, but I thought that was only

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
FreddyLeaf wrote: > > > Still not understand. Shouldn't the target feature of the caller be > > > passed to the intrinsic when checking the argument of the intrinsic? > > > > > > The target features passing from option can be passed to Semachecking. It's > > special for attribute_target,

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Shengchen Kan via cfe-commits
KanRobert wrote: > > Still not understand. Shouldn't the target feature of the caller be passed > > to the intrinsic when checking the argument of the intrinsic? > > The target features passing from option can be passed to Semachecking. It's > special for attribute_target, which is handled in

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. LGTM! I think we have to look at the `DeclRefExpr` case more closely - something seems fishy about it, but also this isn't this patch's fault. https://github.com/llvm/llvm-project/pull/82229 ___

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
@@ -305,19 +337,21 @@ class TrivialFunctionAnalysisVisitor } bool VisitDeclRefExpr(const DeclRefExpr *DRE) { -if (auto *decl = DRE->getDecl()) { - if (isa(decl)) -return true; - if (isa(decl)) -return true; - if (auto *VD =

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-06 Thread Виктор Чернякин via cfe-commits
https://github.com/LocalSpook edited https://github.com/llvm/llvm-project/pull/84272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Виктор Чернякин (LocalSpook) Changes This PR adds checks to make sure the ABI tag given in `[[gnu::abi_tag("")]]` attribute is valid. Example errors: ```text stdin:1:16: error: ABI tag cannot be empty 1 | [[gnu::abi_tag("")]] void

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-06 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,

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-06 Thread Виктор Чернякин via cfe-commits
https://github.com/LocalSpook created https://github.com/llvm/llvm-project/pull/84272 This PR adds checks to make sure the ABI tag given in `[[gnu::abi_tag("")]]` attribute is valid. Example errors: ```text :1:16: error: ABI tag cannot be empty 1 | [[gnu::abi_tag("")]] void f(); |

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
FreddyLeaf wrote: > Still not understand. Shouldn't the target feature of the caller be passed to > the intrinsic when checking the argument of the intrinsic? The target features passing from option can be passed to Semachecking. It's special for attribute_target, which is handled in

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Shengchen Kan via cfe-commits
KanRobert wrote: Still not understand. Shouldn't the target feature of the caller be passed to the intrinsic when checking the argument of the intrinsic? https://github.com/llvm/llvm-project/pull/84136 ___ cfe-commits mailing list

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [clang][Sema] Skip the RequiresExprBodyDecls for lambda dependencies (PR #83997)

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

[clang] 9fe5aa3 - [clang][Sema] Skip the RequiresExprBodyDecls for lambda dependencies (#83997)

2024-03-06 Thread via cfe-commits
Author: Younan Zhang Date: 2024-03-07T09:49:02+08:00 New Revision: 9fe5aa31eccff49632e40bcdad6e64fc00190889 URL: https://github.com/llvm/llvm-project/commit/9fe5aa31eccff49632e40bcdad6e64fc00190889 DIFF: https://github.com/llvm/llvm-project/commit/9fe5aa31eccff49632e40bcdad6e64fc00190889.diff

[clang] [clang][Sema] Skip the RequiresExprBodyDecls for lambda dependencies (PR #83997)

2024-03-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/83997 >From 69414d7352b170f6fcff22c6f5dfa91cc76b0b58 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 5 Mar 2024 19:56:59 +0800 Subject: [PATCH 1/3] gh56556 --- clang/lib/Sema/TreeTransform.h | 6 -- 1

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
@@ -2613,6 +2614,24 @@ void CGBuilderInserter::InsertHelper( // called function. void CodeGenFunction::checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl) { + // SemaCheking cannot handle below x86 builtins because

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf edited https://github.com/llvm/llvm-project/pull/84136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Artem Dergachev via cfe-commits
@@ -189,18 +202,16 @@ class UncountedLocalVarsChecker dyn_cast_or_null(Ref->getFoundDecl())) { const auto *MaybeGuardianArgType = MaybeGuardian->getType().getTypePtr(); - if (!MaybeGuardianArgType) -return; -

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
@@ -4745,6 +4745,127 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_castsi128_pd(__m128i __a) { return (__m128d)__a; } +/// Compares each of the corresponding double-precision values of two +///128-bit vectors of [2 x double], using the operation specified by the

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
@@ -2940,6 +2940,134 @@ _mm_movemask_ps(__m128 __a) return __builtin_ia32_movmskps((__v4sf)__a); } +/* Compare */ +#define _CMP_EQ_OQ0x00 /* Equal (ordered, non-signaling) */ +#define _CMP_LT_OS0x01 /* Less-than (ordered, signaling) */ +#define _CMP_LE_OS0x02

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf updated https://github.com/llvm/llvm-project/pull/84136 >From 2ba698b222fa1dc963d21850d5931562aa65533d Mon Sep 17 00:00:00 2001 From: Freddy Ye Date: Tue, 26 Sep 2023 16:44:01 +0800 Subject: [PATCH 1/5] [X86] Change target of __builtin_ia32_cmp[p|s][s|d] from avx

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/84095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 84842f4 - [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (#84095)

2024-03-06 Thread via cfe-commits
Author: Congcong Cai Date: 2024-03-07T09:39:29+08:00 New Revision: 84842f4b3ba175d744c03d40baa8e371522615e8 URL: https://github.com/llvm/llvm-project/commit/84842f4b3ba175d744c03d40baa8e371522615e8 DIFF: https://github.com/llvm/llvm-project/commit/84842f4b3ba175d744c03d40baa8e371522615e8.diff

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/84095 >From 160add4d95f34608a3d423482ad50fb45f6db522 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 6 Mar 2024 06:55:30 +0800 Subject: [PATCH 1/4] [clang-tidy][NFC]refactor AssertSideEffectCheck logic ---

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
https://github.com/rapidsna updated https://github.com/llvm/llvm-project/pull/78000 >From c39871ed2ec642ab00360f2c3a18fba7c915f82d Mon Sep 17 00:00:00 2001 From: Yeoul Na Date: Mon, 18 Dec 2023 10:58:16 +0900 Subject: [PATCH 1/8] [BoundsSafety] Introduce CountAttributedType

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
rapidsna wrote: @AaronBallman thanks for the review! I addressed your comments. https://github.com/llvm/llvm-project/pull/78000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
@@ -34,6 +34,60 @@ __m128 test_mm_andnot_ps(__m128 A, __m128 B) { return _mm_andnot_ps(A, B); } +__m128 test_mm_cmp_ps_eq_oq(__m128 a, __m128 b) { + // CHECK-LABEL: test_mm_cmp_ps_eq_oq + // CHECK: fcmp oeq <4 x float> %{{.*}}, %{{.*}} + return _mm_cmp_ps(a, b,

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
@@ -2000,6 +2001,21 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { unsigned NumExpansions; }; + class CountAttributedTypeBitfields { +friend class CountAttributedType; + +LLVM_PREFERRED_TYPE(TypeBitfields) +unsigned : NumTypeBits; +

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
@@ -1117,6 +1117,32 @@ class ObjCInterfaceTypeLoc : public ConcreteTypeLoc { +public: + TypeLoc getInnerLoc() const { return this->getInnerTypeLoc(); } + QualType getInnerType() const { return this->getTypePtr()->desugar(); } + void initializeLocal(ASTContext , SourceLocation

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
@@ -4259,7 +4240,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, if (const auto *ME = dyn_cast(Array); ME && ME->isFlexibleArrayMemberLike(getContext(), StrictFlexArraysLevel) && -

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
@@ -13233,6 +13262,32 @@ static QualType getCommonSugarTypeNode(ASTContext , const Type *X, return QualType(); return Ctx.getUsingType(CD, Ctx.getQualifiedType(Underlying)); } + case Type::CountAttributed: { +const auto *DX = cast(X), + *DY =

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
@@ -7239,6 +7239,13 @@ QualType TreeTransform::TransformAttributedType(TypeLocBuilder , }); } +template +QualType TreeTransform::TransformCountAttributedType( +TypeLocBuilder , CountAttributedTypeLoc TL) { + // TODO + llvm_unreachable("Unexpected TreeTransform

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-06 Thread Ben Shi via cfe-commits
@@ -880,6 +883,24 @@ void StreamChecker::preReadWrite(const FnDescription *Desc, } } +void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent , benshi001 wrote: Why  we need a separated `preWrite` ? The original `preReadWrite` also works.

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Shengchen Kan via cfe-commits
@@ -2613,6 +2614,24 @@ void CGBuilderInserter::InsertHelper( // called function. void CodeGenFunction::checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl) { + // SemaCheking cannot handle below x86 builtins because

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/82229 >From 234e301ab2721ddb2f4b43589785015a7d0aa304 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 19 Feb 2024 01:07:13 -0800 Subject: [PATCH 1/8] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object

[clang] [Clang] Update value for __cpp_implicit_move (#84216) (PR #84228)

2024-03-06 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: [This page](https://clang.llvm.org/cxx_status.html) still refers to [P2266R1](https://wg21.link/p2266r1) but the approved revision is [P2266R3](https://wg21.link/p2266r3). Should we fix the citation in this PR or another? https://github.com/llvm/llvm-project/pull/84228

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-06 Thread Yeoul Na via cfe-commits
https://github.com/rapidsna updated https://github.com/llvm/llvm-project/pull/78000 >From c39871ed2ec642ab00360f2c3a18fba7c915f82d Mon Sep 17 00:00:00 2001 From: Yeoul Na Date: Mon, 18 Dec 2023 10:58:16 +0900 Subject: [PATCH 1/7] [BoundsSafety] Introduce CountAttributedType

[clang] [alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object references within trivial statements (PR #82229)

2024-03-06 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Actually, we need to cache the results for `VisitDeclRefExpr` as well to avoid infinite recursion. https://github.com/llvm/llvm-project/pull/82229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
@@ -2613,6 +2614,24 @@ void CGBuilderInserter::InsertHelper( // called function. void CodeGenFunction::checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl) { + // SemaCheking cannot handle below x86 builtins because

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-06 Thread via cfe-commits
Sirraide wrote: > Change __attribute__((assume)) (and [[clang::assume]] if we care enough about > that one) to be synonyms for [[assume]]. Actually, I think we could do that immediately because OpenMP’s `assume` isn’t valid as a statement attribute anyway iirc. I’d still deprecate all

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Shengchen Kan via cfe-commits
@@ -2613,6 +2614,24 @@ void CGBuilderInserter::InsertHelper( // called function. void CodeGenFunction::checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl) { + // SemaCheking cannot handle below x86 builtins because

[clang] [Clang][OpenMP] throw compilation error instead of crash in Stmt::OMPScopeDirectiveClass case (#77535) (PR #84135)

2024-03-06 Thread via cfe-commits
https://github.com/Puellaquae updated https://github.com/llvm/llvm-project/pull/84135 >From a2c88b0b615875d625b49e596886a0f5b32cf159 Mon Sep 17 00:00:00 2001 From: Puellaquae Date: Wed, 6 Mar 2024 05:22:08 + Subject: [PATCH 1/3] [Clang][OpenMP] throw compilation error instead of crash in

[clang] [clang][Sema] Skip the RequiresExprBodyDecls for lambda dependencies (PR #83997)

2024-03-06 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 approved this pull request. Thank you so much! This looks good. https://github.com/llvm/llvm-project/pull/83997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][StaticAnalyzer] Adding getentropy to CStringChecker. (PR #83675)

2024-03-06 Thread David CARLIER via cfe-commits
https://github.com/devnexen updated https://github.com/llvm/llvm-project/pull/83675 >From 1b2fec2c9a41be4ad216d7032189f561eed3f751 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 2 Mar 2024 14:56:15 + Subject: [PATCH 1/2] [clang][StaticAnalyzer] Adding getentropy to

[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

2024-03-06 Thread Freddy Ye via cfe-commits
@@ -34,6 +34,60 @@ __m128 test_mm_andnot_ps(__m128 A, __m128 B) { return _mm_andnot_ps(A, B); } +__m128 test_mm_cmp_ps_eq_oq(__m128 a, __m128 b) { + // CHECK-LABEL: test_mm_cmp_ps_eq_oq + // CHECK: fcmp oeq <4 x float> %{{.*}}, %{{.*}} + return _mm_cmp_ps(a, b,

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-06 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81014 >From 5ba669011752b6ea6e6fe5f6141c4af66ca7ccbf Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 7 Feb 2024 17:25:10 +0100 Subject: [PATCH 01/22] [Clang] Parsing and Sema for C++23's `assume` attribute ---

[clang] [Clang][OpenMP] throw compilation error instead of crash in Stmt::OMPScopeDirectiveClass case (#77535) (PR #84135)

2024-03-06 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -emit-obj -verify -fopenmp %s shiltian wrote: You can use `-emit-llvm` instead. https://github.com/llvm/llvm-project/pull/84135 ___ cfe-commits mailing list

[clang] [Clang][OpenMP] throw compilation error instead of crash in Stmt::OMPScopeDirectiveClass case (#77535) (PR #84135)

2024-03-06 Thread via cfe-commits
@@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -emit-obj -verify -fopenmp %s Puellaquae wrote: during testing, I found it can't produce this error without `-emit-obj` https://github.com/llvm/llvm-project/pull/84135 ___

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-06 Thread via cfe-commits
Sirraide wrote: I’ve implemented what we’ve decided on as a result of the RFC and also renamed the attribute to `CXXAssumeAttr` and the OpenMP one to `OMPAssumeAttr` so we don’t confuse the two. > > But it sounds like my idea doesn't have legs because of OpenMP > > specification

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-06 Thread via cfe-commits
Sirraide wrote: It requests a review automatically if one of the files has a code owner, interesting. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.cpp - clang-tidy --===// +// +// 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:

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-06 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81014 >From 5ba669011752b6ea6e6fe5f6141c4af66ca7ccbf Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 7 Feb 2024 17:25:10 +0100 Subject: [PATCH 01/21] [Clang] Parsing and Sema for C++23's `assume` attribute ---

[clang] [llvm] [Clang] CGCoroutine: Skip moving parameters if the allocation decision is false (PR #81195)

2024-03-06 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 dcd08daed5fb9928fedb09c2a84d1e9d2ab59630 1e03c2ec24c7bc6a303266a7023a56d6449a46e5 --

[clang-tools-extra] [clang-tidy] Add bugprone-suspicious-stringview-data-usage check (PR #83716)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,100 @@ +//===--- SuspiciousStringviewDataUsageCheck.cpp - clang-tidy --===// +// +// 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:

[clang] [llvm] [Clang] CGCoroutine: Skip moving parameters if the allocation decision is false (PR #81195)

2024-03-06 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/81195 >From 1e03c2ec24c7bc6a303266a7023a56d6449a46e5 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Wed, 7 Feb 2024 16:05:42 -0800 Subject: [PATCH] Skip moving parameters if the allocation decision is false

[clang] Revert "[clang-repl] Pass triple to IncrementalCompilerBuilder as explicit argument" (PR #84261)

2024-03-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Stefan Gränitz (weliveindetail) Changes Reverts llvm/llvm-project#84174 due too sanitizer memory leak detection --- Full diff: https://github.com/llvm/llvm-project/pull/84261.diff 4 Files Affected: - (modified)

[clang] Revert "[clang-repl] Pass triple to IncrementalCompilerBuilder as explicit argument" (PR #84261)

2024-03-06 Thread Stefan Gränitz via cfe-commits
https://github.com/weliveindetail closed https://github.com/llvm/llvm-project/pull/84261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6a39a71 - Revert "[clang-repl] Pass triple to IncrementalCompilerBuilder as explicit argument" (#84261)

2024-03-06 Thread via cfe-commits
Author: Stefan Gränitz Date: 2024-03-07T01:01:07+01:00 New Revision: 6a39a714423ba5675b9e211a80c1dae1ff0e6eac URL: https://github.com/llvm/llvm-project/commit/6a39a714423ba5675b9e211a80c1dae1ff0e6eac DIFF:

[clang] Revert "[clang-repl] Pass triple to IncrementalCompilerBuilder as explicit argument" (PR #84261)

2024-03-06 Thread Stefan Gränitz via cfe-commits
https://github.com/weliveindetail created https://github.com/llvm/llvm-project/pull/84261 Reverts llvm/llvm-project#84174 due too sanitizer memory leak detection From efe6097aad69aba7d2421880305198bf09226db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Thu, 7 Mar

[clang] [clang-repl] Pass triple to IncrementalCompilerBuilder as explicit argument (PR #84174)

2024-03-06 Thread Stefan Gränitz via cfe-commits
weliveindetail wrote: Interesting, thanks for reporting! It's this code: ``` llvm::MemoryBuffer *MB = llvm::MemoryBuffer::getMemBuffer("").release(); Clang->getPreprocessorOpts().addRemappedFile("<<< inputs >>>", MB); ``` Apparently, it is related to releasing the MemBuffer and passing the

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -60,16 +60,27 @@ AST_MATCHER_P2(Expr, hasSideEffect, bool, CheckFunctionCalls, } if (const auto *CExpr = dyn_cast(E)) { -bool Result = CheckFunctionCalls; +if (!CheckFunctionCalls) + return false; if (const auto *FuncDecl = CExpr->getDirectCallee())

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/84095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -122,6 +122,10 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`bugprone-assert-side-effect + ` check by detection side 5chmidti wrote: `... detecting side effects from calling a method ...`

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect can detect side effect from non-const reference parameters (PR #84095)

2024-03-06 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/84095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Update value for __cpp_implicit_move (#84216) (PR #84228)

2024-03-06 Thread via cfe-commits
https://github.com/aniplcc updated https://github.com/llvm/llvm-project/pull/84228 >From 5de5eacdbd0ddf91f060edb003414b576365f2e0 Mon Sep 17 00:00:00 2001 From: aniplcc Date: Thu, 7 Mar 2024 01:39:30 +0530 Subject: [PATCH] [Clang] Update value for __cpp_implicit_move (#84216) ---

[clang] [clang][CUDA] Disable float128 diagnostics for device compilation (PR #83918)

2024-03-06 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. https://github.com/llvm/llvm-project/pull/83918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Remove '--' separator in the linker wrapper usage (PR #84253)

2024-03-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-backend-amdgpu Author: Joseph Huber (jhuber6) Changes Summary: The very first version of the `clang-linker-wrapper` used `--` as a separator for the host and device arguments. I moved away

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-06 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: I think manually checking if `TrivialAutoVarInit` is set (to `Pattern`?) may be a better fix, as there was only [one codepath](https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGDecl.cpp#L1972-L1974) in which we were not checking this.

[clang] [Clang][NFC] Remove '--' separator in the linker wrapper usage (PR #84253)

2024-03-06 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/84253 Summary: The very first version of the `clang-linker-wrapper` used `--` as a separator for the host and device arguments. I moved away from this towards a commandline parsing implementation years ago but never

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-06 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[clang] Avoid memcopy for small structure with padding under … (PR #84230)

2024-03-06 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From 91ca7b2e5c98a7caa8a97f05f57e84f68d861fa3 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 6 Mar 2024 23:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow memcpy replace with trivial

[clang-tools-extra] [clang-tidy] Fix handling --driver-mode= (PR #66553)

2024-03-06 Thread Julian Schmidt via cfe-commits
@@ -550,9 +555,91 @@ static llvm::IntrusiveRefCntPtr createBaseFS() { return BaseFS; } +static void recreateOptionsParserIfNeeded( +llvm::Expected , +llvm::ArrayRef Args, +const ClangTidyOptions ) { + + auto DoubleDashIt = std::find(Args.begin(), Args.end(),

  1   2   3   4   5   6   >