[clang] [SYCL] change sycl version accrodnig to standard (PR #114790)

2024-11-22 Thread Ronan Keryell via cfe-commits
keryell wrote: That sounds good. Could you fix the typos in the PR title and the commit messages. Please write SYCL in uppercase everywhere since it is a standard name. https://github.com/llvm/llvm-project/pull/114790 ___ cfe-commits mailing list cfe-c

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
scottconstable wrote: > > Second, this scheme reduces the expected number of hash collisions within > > each arity, compared against the expected number of collisions (0.01383765) > > for the 32-bit hashing scheme that includes all arities. The table below > > shows the expected number of coll

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
https://github.com/scottconstable edited https://github.com/llvm/llvm-project/pull/117121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
https://github.com/scottconstable updated https://github.com/llvm/llvm-project/pull/117121 >From 4f21a0c817d221398bb93e25452518d265794265 Mon Sep 17 00:00:00 2001 From: Scott D Constable Date: Tue, 19 Nov 2024 15:51:05 -0800 Subject: [PATCH] Enhance KCFI type IDs with a 3-bit arity indicator.

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
@@ -208,10 +209,34 @@ void llvm::setKCFIType(Module &M, Function &F, StringRef MangledType) { std::string Type = MangledType.str(); if (M.getModuleFlag("cfi-normalize-integers")) Type += ".normalized"; + + uint32_t OutHash = static_cast(llvm::xxHash64(Type)); + auto

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
https://github.com/scottconstable edited https://github.com/llvm/llvm-project/pull/117121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
https://github.com/scottconstable edited https://github.com/llvm/llvm-project/pull/117121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-22 Thread Helena Kotas via cfe-commits
@@ -67,6 +67,7 @@ struct BuiltinTypeDeclBuilder { Record = CXXRecordDecl::Create(AST, TagDecl::TagKind::Class, HLSLNamespace, SourceLocation(), SourceLocation(), &II, PrevDecl, true); +Record->startDe

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
@@ -208,10 +209,34 @@ void llvm::setKCFIType(Module &M, Function &F, StringRef MangledType) { std::string Type = MangledType.str(); if (M.getModuleFlag("cfi-normalize-integers")) Type += ".normalized"; + + uint32_t OutHash = static_cast(llvm::xxHash64(Type)); + auto

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
https://github.com/scottconstable updated https://github.com/llvm/llvm-project/pull/117121 >From ccb50df487043cde9414943f08988bc9e6ee Mon Sep 17 00:00:00 2001 From: Scott D Constable Date: Tue, 19 Nov 2024 15:51:05 -0800 Subject: [PATCH] Enhance KCFI type IDs with a 3-bit arity indicator.

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
scottconstable wrote: > > @phoebewang and @lvwr I also noticed that there is this code in LLVM: > > https://github.com/llvm/llvm-project/blob/9ba6672b9f0e82a1f6d4100dc832c84447ea545c/llvm/lib/Transforms/Utils/ModuleUtils.cpp#L202-L214 > > > > . As far as I can tell, this code is not triggered wh

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-22 Thread Helena Kotas via cfe-commits
@@ -1474,6 +1474,11 @@ DeclContext *DeclContext::getPrimaryContext() { case Decl::ObjCCategoryImpl: return this; + case Decl::CXXRecord: +if (auto *OPD = dyn_cast(this)) + if (auto *Def = OPD->getDefinition()) +return Def; +return this; default:

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 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 53a6a11e0d51229d341b8906252645cd8a5de796 d5ec228a1d3e059e2a64ac1a150bec6f65d573e7 --e

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/115180 >From 428283c7b61ca50d40ffd3ddc5c08aca39f39533 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 7 Nov 2024 00:35:47 +0800 Subject: [PATCH 1/4] [clang-tidy] fix false positive when detecting templated

[clang] [llvm] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-22 Thread Scott Constable via cfe-commits
https://github.com/scottconstable updated https://github.com/llvm/llvm-project/pull/117121 >From d5ec228a1d3e059e2a64ac1a150bec6f65d573e7 Mon Sep 17 00:00:00 2001 From: Scott D Constable Date: Tue, 19 Nov 2024 15:51:05 -0800 Subject: [PATCH] Enhance KCFI type IDs with a 3-bit arity indicator.

[clang] [clang][AArch64] Avoid a crash when a non-reserved register is used (PR #117419)

2024-11-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Igor Kudrin (igorkudrin) Changes Fixes #76426 The previous patch for this issue, #94271, generated an error message if a register and a global variable did not have the same size. This patch checks if the register is actually reserved.

[clang] [clang][AArch64] Avoid a crash when a non-reserved register is used (PR #117419)

2024-11-22 Thread Igor Kudrin via cfe-commits
https://github.com/igorkudrin created https://github.com/llvm/llvm-project/pull/117419 Fixes #76426 The previous patch for this issue, #94271, generated an error message if a register and a global variable did not have the same size. This patch checks if the register is actually reserved. >F

[clang] [llvm] AMDGPU: Handle gfx950 change in mfma_f64_16x16x4 + valu hazard (PR #117262)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Pass `--no-cuda-version-check` to test (PR #117415)

2024-11-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Kai Luo (bzEq) Changes My local build, on Debian GNU/Linux 12 (bookworm), complains ``` clang: error: GPU arch sm_20 is supported by CUDA versions between 7.0 and 8.0 (inclusive), but installation at /usr/lib/cuda is 11.8; use '--cu

[clang] [Driver] Pass `--no-cuda-version-check` to test (PR #117415)

2024-11-22 Thread Kai Luo via cfe-commits
https://github.com/bzEq created https://github.com/llvm/llvm-project/pull/117415 My local build, on Debian GNU/Linux 12 (bookworm), complains ``` clang: error: GPU arch sm_20 is supported by CUDA versions between 7.0 and 8.0 (inclusive), but installation at /usr/lib/cuda is 11.8; use '--cuda-pat

[clang] [Wunsafe-buffer-usage] Fix false positives in handling array indices that are decidably correct (PR #117370)

2024-11-22 Thread via cfe-commits
https://github.com/mxms0 updated https://github.com/llvm/llvm-project/pull/117370 >From 8fed333cf4221dbf1826351da80164db5d209c21 Mon Sep 17 00:00:00 2001 From: mxms Date: Fri, 22 Nov 2024 15:09:07 -0500 Subject: [PATCH 1/3] [Wunsafe-buffer-usage] Fix false positives in handling enums Do not w

[clang] [Wunsafe-buffer-usage] Fix false positives in handling array indices that are decidably correct (PR #117370)

2024-11-22 Thread via cfe-commits
https://github.com/mxms0 edited https://github.com/llvm/llvm-project/pull/117370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread via cfe-commits
https://github.com/mxms0 edited https://github.com/llvm/llvm-project/pull/117370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread via cfe-commits
@@ -463,6 +463,13 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return true; } + // Array index wasn't an integer literal, let's see if it was an enum or + // something similar + const auto IntConst = Node.getIdx()->getIntegerConstantExpr(Finder->getAS

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread via cfe-commits
https://github.com/mxms0 updated https://github.com/llvm/llvm-project/pull/117370 >From 8fed333cf4221dbf1826351da80164db5d209c21 Mon Sep 17 00:00:00 2001 From: mxms Date: Fri, 22 Nov 2024 15:09:07 -0500 Subject: [PATCH 1/2] [Wunsafe-buffer-usage] Fix false positives in handling enums Do not w

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread via cfe-commits
@@ -39,6 +39,23 @@ void constant_idx_unsafe(unsigned idx) { buffer[10] = 0; // expected-note{{used in buffer access here}} } +enum FooEnum { + A = 0, + B = 1, + C = 2, + D +}; + +void constant_enum_safe() { + int buffer[FooEnum::D] = { 0, 1, 2 }; + buffer[C] = 0;

[clang-tools-extra] [clang-tidy] New option `CompilationArgsToRemoveRegex` to remove arguments from the command line (PR #111453)

2024-11-22 Thread Congcong Cai via cfe-commits
=?utf-8?q?FĂ©lix-Antoine?= Constantin Message-ID: In-Reply-To: HerrCai0907 wrote: > I too have the feeling that this feature is a responsibility of the build > system, not of clang-tidy I think clang-tidy should provide a easy-use environment. some project may don't support clang compiler due

[clang] [llvm] AMDGPU: Handle v_mfma_f64_16x16x4_f64 srcc write VGPR hazard change for gfx950 (PR #117283)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Refine gfx950 xdl-write-vgpr hazard cases (PR #117285)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Handle gfx950 XDL-write-overlapped-smfma-src-c wait state change (PR #117263)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Handle v_mfma_f64_16x16x4_f64 write VGPR read srca/srcb hazard change for gfx950 (PR #117284)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (PR #117260)

2024-11-22 Thread Matt Arsenault via cfe-commits
arsenm wrote: ### Merge activity * **Nov 22, 11:08 PM EST**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/117260). https://github.com/llvm/llvm-project/pull/117260

[clang] [llvm] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (PR #117260)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/117260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Define new sched model for gfx950 (PR #117261)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] d1cca31 - AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (#117260)

2024-11-22 Thread via cfe-commits
Author: Matt Arsenault Date: 2024-11-22T20:12:50-08:00 New Revision: d1cca3133a6eea845c312b17379ad93f57aa7dd7 URL: https://github.com/llvm/llvm-project/commit/d1cca3133a6eea845c312b17379ad93f57aa7dd7 DIFF: https://github.com/llvm/llvm-project/commit/d1cca3133a6eea845c312b17379ad93f57aa7dd7.diff

[clang] [llvm] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (PR #117260)

2024-11-22 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/117260 >From 1c77212b8665ebf16b493ce7e79b7bc4ff67fecf Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 22 Jan 2024 12:40:54 +0700 Subject: [PATCH] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for

[clang] [llvm] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (PR #117260)

2024-11-22 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/117260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (PR #117260)

2024-11-22 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/117260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

2024-11-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/116033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][AMDGPU] Fold `llvm.amdgcn.wavefrontsize` early (PR #114481)

2024-11-22 Thread Matt Arsenault via cfe-commits
arsenm wrote: #117410 gives you a way to do this without explicitly looking at the features or CPU https://github.com/llvm/llvm-project/pull/114481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [llvm] [llvm][AMDGPU] Fold `llvm.amdgcn.wavefrontsize` early (PR #114481)

2024-11-22 Thread Joseph Huber via cfe-commits
@@ -1024,6 +1024,15 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const { } break; } + case Intrinsic::amdgcn_wavefrontsize: { +// TODO: this is a workaround for the pseudo-generic target one gets with no +// specified mcpu, which

[clang] [llvm] [llvm][AMDGPU] Fold `llvm.amdgcn.wavefrontsize` early (PR #114481)

2024-11-22 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/114481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-22 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/116699 >From 7210fcc7de181be6cad451ce1e885498c90c55fe Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Sat, 9 Nov 2024 01:34:16 + Subject: [PATCH 01/11] adding definition --- clang/lib/Sema/HLSLExternalSemaS

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

2024-11-22 Thread Nicolas van Kempen via cfe-commits
@@ -183,38 +210,43 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) { const auto *EndsWithFunction = Result.Nodes.getNodeAs("ends_with_fun"); assert(bool(StartsWithFunction) != bool(EndsWithFunction)); + const CXXMethodDecl *Replacemen

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

2024-11-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. LGTM minus 1 nit. Thanks! https://github.com/llvm/llvm-project/pull/116033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Disallow named struct types as parameters in target extension types (PR #115971)

2024-11-22 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 1/8] print struct body within target ext ty context --- .../t

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-11-22 Thread Alex Voicu via cfe-commits
@@ -1350,7 +1350,7 @@ bool ItaniumCXXABI::classifyReturnType(CGFunctionInfo &FI) const { // If C++ prohibits us from making a copy, return by address. if (!RD->canPassInRegisters()) { auto Align = CGM.getContext().getTypeAlignInChars(FI.getReturnType()); -FI.getRet

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-11-22 Thread Alex Voicu via cfe-commits
@@ -296,18 +296,25 @@ void AggExprEmitter::withReturnValueSlot( (RequiresDestruction && Dest.isIgnored()); Address RetAddr = Address::invalid(); - RawAddress RetAllocaAddr = RawAddress::invalid(); EHScopeStack::stable_iterator LifetimeEndBlock; llvm

[clang] dd8d85d - [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (#117394)

2024-11-22 Thread via cfe-commits
Author: Ryosuke Niwa Date: 2024-11-22T16:42:39-08:00 New Revision: dd8d85dba6e8f74a55fb5053107797e21894a0c6 URL: https://github.com/llvm/llvm-project/commit/dd8d85dba6e8f74a55fb5053107797e21894a0c6 DIFF: https://github.com/llvm/llvm-project/commit/dd8d85dba6e8f74a55fb5053107797e21894a0c6.diff

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (PR #117394)

2024-11-22 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/117394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (PR #117394)

2024-11-22 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/117394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-11-22 Thread Alex Voicu via cfe-commits
@@ -5158,14 +5155,17 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, } else if (!ReturnValue.isNull()) { SRetPtr = ReturnValue.getAddress(); } else { - SRetPtr = CreateMemTemp(RetTy, "tmp", &SRetAlloca); + SRetPtr = CreateMemTempWith

[clang] [libcxx] [Clang] Add __builtin_invoke and detect std::invoke as a builtin (PR #116709)

2024-11-22 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > 1. I'm not convinced the library part is true. The reality is that we > > support Clang and GCC, and if they both support the builtins (or provide > > different ones for the same feature) we remove our fallback implementations > > and thus reducing the complexity for libc

[clang] [llvm] [HLSL] Implement elementwise firstbitlow builtin (PR #116858)

2024-11-22 Thread Ashley Coleman via cfe-commits
@@ -0,0 +1,168 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK-DAG: [[glsl_450_ext:%.+]] = OpExtInstImport "GLSL.std.4

[clang] [llvm] [HLSL] Implement elementwise firstbitlow builtin (PR #116858)

2024-11-22 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt updated https://github.com/llvm/llvm-project/pull/116858 >From eeb864972c48625fa56b96e6b018affe04d84e00 Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Thu, 14 Nov 2024 11:53:39 -0700 Subject: [PATCH 1/6] [HLSL] Implement elementwise firstbitlow builtin --- clan

[clang] [llvm] [HLSL] Add implicit resource element type concepts to AST (PR #116413)

2024-11-22 Thread Justin Bogner via cfe-commits
@@ -323,19 +325,117 @@ struct TemplateParameterListBuilder { return *this; } - BuiltinTypeDeclBuilder &finalizeTemplateArgs() { + // The concept specialization expression (CSE) constructed in + // constructConceptSpecializationExpr is constructed so that it + // matc

[clang] [Clang] skip consumed analysis for consteval conditions in control-flow terminators (PR #117403)

2024-11-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Oleksandr T. (a-tarasyuk) Changes Fixes #117385 --- Full diff: https://github.com/llvm/llvm-project/pull/117403.diff 2 Files Affected: - (modified) clang/lib/Analysis/Consumed.cpp (+3) - (modified) clang/test/SemaCXX/constexpr-return-n

[clang] [AIX] Fix AIX BuildBot failure as AIX linker doesn't support version script. (PR #117342)

2024-11-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-ppc64-aix` running on `aix-ppc64` while building `clang` at step 3 "clean-build-dir". Full details are available at: https://lab.llvm.org/buildbot/#/builders/64/builds/1515 Here is the relevant piece of the build log f

[clang] [Clang] skip consumed analysis for consteval conditions in control-flow terminators (PR #117403)

2024-11-22 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/117403 Fixes #117385 >From f76ebd39c7ca9761b7812a85a206b63193702c50 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 23 Nov 2024 01:53:29 +0200 Subject: [PATCH] [Clang] skip consumed analysis for consteval con

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-22 Thread Justin Bogner via cfe-commits
@@ -12,44 +12,51 @@ #include "clang/Sema/HLSLExternalSemaSource.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" +#include "clang/AST/Expr.h" #include "clang/AST/Type.h" #include "clang/Basic/SourceL

[clang] [llvm] [HLSL] Add implicit resource element type concepts to AST (PR #116413)

2024-11-22 Thread Justin Bogner via cfe-commits
@@ -289,8 +289,9 @@ struct BuiltinTypeDeclBuilder { } TemplateParameterListBuilder addTemplateArgumentList(Sema &S); - BuiltinTypeDeclBuilder &addSimpleTemplateParams(Sema &S, - ArrayRef Names); + BuiltinTypeDeclBuilder &

[clang] [llvm] [HLSL] Add implicit resource element type concepts to AST (PR #116413)

2024-11-22 Thread Justin Bogner via cfe-commits
@@ -472,10 +571,73 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, .addDefaultHandleConstructor(S); } +Expr *constructTypedBufferConstraintExpr(Sema &S, SourceLocation NameLoc, + TemplateTypeParmDecl

[clang] [llvm] [HLSL] Add implicit resource element type concepts to AST (PR #116413)

2024-11-22 Thread Justin Bogner via cfe-commits
@@ -5720,8 +5720,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, case UTT_IsTypedResourceElementCompatible: assert(Self.getLangOpts().HLSL && "typed resource element compatible types are an HLSL-only feature"); -if (Self.RequireCompleteT

[clang] [llvm] [HLSL] Add implicit resource element type concepts to AST (PR #116413)

2024-11-22 Thread Justin Bogner via cfe-commits
@@ -472,10 +571,73 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, .addDefaultHandleConstructor(S); } +Expr *constructTypedBufferConstraintExpr(Sema &S, SourceLocation NameLoc, + TemplateTypeParmDecl

[clang] [flang] [flang][Driver] Support -print-supported-extensions (PR #117402)

2024-11-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-driver Author: Tarun Prabhu (tarunprabhu) Changes The implementation is pretty straightforward. The tests mirror those in clang. --- Patch is 40.87 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/117402

[clang] [flang] [flang][Driver] Support -print-supported-extensions (PR #117402)

2024-11-22 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu created https://github.com/llvm/llvm-project/pull/117402 The implementation is pretty straightforward. The tests mirror those in clang. >From cd8f7f1cd265b38e5854f42e6141cd0e6160201f Mon Sep 17 00:00:00 2001 From: Tarun Prabhu Date: Thu, 21 Nov 2024 11:42:46 -070

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread Reid Kleckner via cfe-commits
@@ -463,6 +463,13 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return true; } + // Array index wasn't an integer literal, let's see if it was an enum or + // something similar + const auto IntConst = Node.getIdx()->getIntegerConstantExpr(Finder->getAS

[clang] [Wunsafe-buffer-usage] Fix false positives in handling enums (PR #117370)

2024-11-22 Thread Reid Kleckner via cfe-commits
@@ -39,6 +39,23 @@ void constant_idx_unsafe(unsigned idx) { buffer[10] = 0; // expected-note{{used in buffer access here}} } +enum FooEnum { + A = 0, + B = 1, + C = 2, + D +}; + +void constant_enum_safe() { + int buffer[FooEnum::D] = { 0, 1, 2 }; + buffer[C] = 0;

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-11-22 Thread Matt Arsenault via cfe-commits
@@ -5158,14 +5155,17 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, } else if (!ReturnValue.isNull()) { SRetPtr = ReturnValue.getAddress(); } else { - SRetPtr = CreateMemTemp(RetTy, "tmp", &SRetAlloca); + SRetPtr = CreateMemTempWith

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-11-22 Thread Matt Arsenault via cfe-commits
@@ -5389,11 +5389,22 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, V->getType()->isIntegerTy()) V = Builder.CreateZExt(V, ArgInfo.getCoerceToType()); -// If the argument doesn't match, perform a bitcast to coerce it. This -

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-11-22 Thread Matt Arsenault via cfe-commits
@@ -1350,7 +1350,7 @@ bool ItaniumCXXABI::classifyReturnType(CGFunctionInfo &FI) const { // If C++ prohibits us from making a copy, return by address. if (!RD->canPassInRegisters()) { auto Align = CGM.getContext().getTypeAlignInChars(FI.getReturnType()); -FI.getRet

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-11-22 Thread Matt Arsenault via cfe-commits
@@ -296,18 +296,25 @@ void AggExprEmitter::withReturnValueSlot( (RequiresDestruction && Dest.isIgnored()); Address RetAddr = Address::invalid(); - RawAddress RetAllocaAddr = RawAddress::invalid(); EHScopeStack::stable_iterator LifetimeEndBlock; llvm

[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -0,0 +1,296 @@ +//===-- xray_riscv.cpp *- C++ -*-===// +// +// 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: Apach

[clang] [compiler-rt] [libunwind] [llvm] [clang] recognize any *-ld.lld variant (PR #117338)

2024-11-22 Thread Brian Cain via cfe-commits
@@ -294,9 +294,11 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA, bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles); bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs); bool UseG0 = false; - const char *Exec = Args.MakeArgString(HTC.G

[clang] [compiler-rt] [libunwind] [llvm] [clang] recognize any *-ld.lld variant (PR #117338)

2024-11-22 Thread Brian Cain via cfe-commits
@@ -974,8 +974,11 @@ std::string ToolChain::GetLinkerPath(bool *LinkerIsLLD) const { if (llvm::sys::path::parent_path(Path).empty()) Path = GetProgramPath(A->getValue()); if (llvm::sys::fs::can_execute(Path)) { +SmallString<1024> RealPath; +

[clang] [compiler-rt] [libunwind] [llvm] [clang] recognize any *-ld.lld variant (PR #117338)

2024-11-22 Thread Brian Cain via cfe-commits
https://github.com/androm3da edited https://github.com/llvm/llvm-project/pull/117338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [libunwind] [llvm] [clang] recognize any *-ld.lld variant (PR #117338)

2024-11-22 Thread Brian Cain via cfe-commits
https://github.com/androm3da updated https://github.com/llvm/llvm-project/pull/117338 >From 40e018ad4a92a20442ad34b0a5b988394e15e609 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Thu, 21 Nov 2024 19:46:04 -0800 Subject: [PATCH 1/4] [clang] recognize any *-ld.lld variant If we create a cross

[clang] [llvm] [llvm][AMDGPU] Fold `llvm.amdgcn.wavefrontsize` early (PR #114481)

2024-11-22 Thread Joseph Huber via cfe-commits
@@ -1024,6 +1024,15 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const { } break; } + case Intrinsic::amdgcn_wavefrontsize: { +// TODO: this is a workaround for the pseudo-generic target one gets with no +// specified mcpu, which

[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -0,0 +1,296 @@ +//===-- xray_riscv.cpp *- C++ -*-===// +// +// 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: Apach

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/7] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [llvm] [SanitizerCoverage] Add gated tracing callbacks support to trace-cmp (PR #113227)

2024-11-22 Thread via cfe-commits
@@ -1013,19 +1051,10 @@ void ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB, ConstantInt::get(IntptrTy, Idx * 4)), PtrTy); if (Options.GatedCallbacks) { - if (!FunctionGateCmp) { -// Create this in the

[clang] [llvm] [SanitizerCoverage] Add gated tracing callbacks support to trace-cmp (PR #113227)

2024-11-22 Thread via cfe-commits
https://github.com/thetruestblue deleted https://github.com/llvm/llvm-project/pull/113227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][AMDGPU] Fold `llvm.amdgcn.wavefrontsize` early (PR #114481)

2024-11-22 Thread Alex Voicu via cfe-commits
@@ -1024,6 +1024,15 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const { } break; } + case Intrinsic::amdgcn_wavefrontsize: { +// TODO: this is a workaround for the pseudo-generic target one gets with no +// specified mcpu, which

[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -0,0 +1,296 @@ +//===-- xray_riscv.cpp *- C++ -*-===// +// +// 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: Apach

[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -453,11 +475,71 @@ bool RISCVAsmPrinter::runOnMachineFunction(MachineFunction &MF) { SetupMachineFunction(MF); emitFunctionBody(); + // Emit the XRay table + emitXRayTable(); + if (EmittedOptionArch) RTS.emitDirectiveOptionPop(); return false; } +void R

[clang] [clang] recognize any *-ld.lld variant (PR #117338)

2024-11-22 Thread Brian Cain via cfe-commits
@@ -294,9 +294,11 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA, bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles); bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs); bool UseG0 = false; - const char *Exec = Args.MakeArgString(HTC.G

[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -0,0 +1,97 @@ +//===-- xray_trampoline_riscv_common.s --*- ASM -*-===// +// +// 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: Apa

[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -0,0 +1,83 @@ +//===-- xray_trampoline_riscv32.s --*- ASM -*-===// +// +// 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] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -0,0 +1,296 @@ +//===-- xray_riscv.cpp *- C++ -*-===// +// +// 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: Apach

[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

2024-11-22 Thread Craig Topper via cfe-commits
@@ -0,0 +1,83 @@ +//===-- xray_trampoline_riscv64.s --*- ASM -*-===// +// +// 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] [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (PR #117394)

2024-11-22 Thread Rashmi Mudduluru via cfe-commits
https://github.com/t-rasmud approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/117394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement SV_GroupID semantic (PR #115911)

2024-11-22 Thread Chris B via cfe-commits
@@ -784,6 +785,17 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) { HLSLSV_DispatchThreadIDAttr(getASTContext(), AL)); } +void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) { + auto *VD = cast(D); + if (!isLega

[clang] [clang] recognize any *-ld.lld variant (PR #117338)

2024-11-22 Thread Fangrui Song via cfe-commits
@@ -294,9 +294,11 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA, bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles); bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs); bool UseG0 = false; - const char *Exec = Args.MakeArgString(HTC.G

[clang] [llvm] [SanitizerCoverage] Add gated tracing callbacks support to trace-cmp (PR #113227)

2024-11-22 Thread via cfe-commits
thetruestblue wrote: Requesting review after addressing feedback. https://github.com/llvm/llvm-project/pull/113227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SanitizerCoverage] Add gated tracing callbacks support to trace-cmp (PR #113227)

2024-11-22 Thread via cfe-commits
https://github.com/thetruestblue updated https://github.com/llvm/llvm-project/pull/113227 >From 5dbb79145b669e2478b61402fa95fed0385c6a95 Mon Sep 17 00:00:00 2001 From: thetruestblue <92476612+thetruestb...@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:57:40 -0800 Subject: [PATCH] [Sanitize

[clang] [HLSL] Implement SV_GroupID semantic (PR #115911)

2024-11-22 Thread Chris B via cfe-commits
@@ -784,6 +785,17 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) { HLSLSV_DispatchThreadIDAttr(getASTContext(), AL)); } +void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) { + auto *VD = cast(D); + if (!isLega

[clang] [clang] recognize any *-ld.lld variant (PR #117338)

2024-11-22 Thread Fangrui Song via cfe-commits
@@ -974,8 +974,11 @@ std::string ToolChain::GetLinkerPath(bool *LinkerIsLLD) const { if (llvm::sys::path::parent_path(Path).empty()) Path = GetProgramPath(A->getValue()); if (llvm::sys::fs::can_execute(Path)) { +SmallString<1024> RealPath; +

[clang] [AIX] Fix AIX BuildBot failure as AIX linker doesn't support version script. (PR #117342)

2024-11-22 Thread Aaron Puchert via cfe-commits
@@ -48,11 +48,13 @@ add_clang_library(clang-cpp ${_OBJECTS} LINK_LIBS ${_DEPS}) +# AIX linker does not support version script +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX") + configure_file(simple_version_script.map.in simple

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (PR #117394)

2024-11-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ryosuke Niwa (rniwa) Changes Fixed a bug that UncountedLambdaCapturesChecker would emit a warning on a lambda capture when the lambda is invoked with arguments. LocalVisitor::VisitCallExpr was not tolerating a lambda inv

[clang] [AIX] Fix AIX BuildBot failure as AIX linker doesn't support version script. (PR #117342)

2024-11-22 Thread Aaron Puchert via cfe-commits
aaronpuchert wrote: Doesn't eaa0a21d21962280dc2c03a09152510f6162a576 already fix this? If `CMAKE_SYSTEM_NAME` is `Linux`, it can probably not be `AIX` at the same time, right? See also the discussion on #116556. Do you mind if I revert this? https://github.com/llvm/llvm-project/pull/117342 __

  1   2   3   4   5   >