[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-29 Thread Sander de Smalen via cfe-commits
@@ -3532,6 +3533,72 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum class AAPCSBitmaskSME : unsigned { + ArmStreamingBit = 1 << 0, + ArmStreamingCompatibleBit = 1 << 1, + ArmAgnosticSMEZAStateBit = 1 << 2, + ZA_Shift = 3

[clang] [clang-format][CMake] Generate formatting options docs during build (PR #113739)

2024-11-29 Thread via cfe-commits
mydeveloperday wrote: > > I'd personally like a solution that doesn't remove the > > ClangFormatStyleOptions.rst from the review > > Could we just test that the output looks as expected? I think it would be > pretty easy to write a lit test that asserts all of the output is as > expected. Tha

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-11-29 Thread Malek Ben Slimane via cfe-commits
https://github.com/malek203 updated https://github.com/llvm/llvm-project/pull/110523 >From 70b03bd0532f55f25f51adda0604b10d4b2150e0 Mon Sep 17 00:00:00 2001 From: Malek Ben Slimane Date: Wed, 11 Sep 2024 22:07:45 +0200 Subject: [PATCH] Thread Safety Analysis: Support passing scoped locks betwee

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: Some minor test comments, otherwise looking good, https://github.com/llvm/llvm-project/pull/118026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,30 @@ +/// Check that we generate fake uses only when -fextend-lifetimes is set and we +/// are not setting optnone, or when we have optimizations set to -Og and we have +/// not passed -fno-extend-lifetimes. +// RUN: %clang_cc1 -emit-llvm -disable-llvm-passes -O0 -fex

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -441,6 +441,10 @@ Modified Compiler Flags ``memset`` and similar functions for which it is a documented undefined behavior. It is implied by ``-Wnontrivial-memaccess`` +- The ``-Og`` optimization flag now sets ``-fextend-lifetimes``, a new compiler + flag, resulting in

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/118026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -1834,6 +1834,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } + // If we have specified -Og and have not set any explicit -fextend-lifetimes + // value, then default to -fexten

[clang-tools-extra] [clangd] Support symbolTags for document symbol (PR #113669)

2024-11-29 Thread Dietrich Travkin via cfe-commits
travkin79 wrote: Hi @chouzz, I found out that I get symbol tags if the LSP method [textDocument/publishDiagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics) is used. Could you please check your implementation if

[clang] [analyzer] Never create Regions wrapping reference TypedValueRegions (NFCI) (PR #118096)

2024-11-29 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun approved this pull request. The change itself looks good to me, but I wonder what is the reason that we only want to do this canonicalization when we access fields? https://github.com/llvm/llvm-project/pull/118096 ___ cfe-

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2024-11-29 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: tbaederr wrote: This is the best version I could come up with. Other than that, the code as it is seems to do what is advertised, i.e. the new output is the desired output. https://github.com/llvm/llvm-project/pull/117671 __

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-11-29 Thread Malek Ben Slimane via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-29 Thread Jeremy Morse via cfe-commits
jmorse wrote: The additions here look fine; however I think there's generally precedent that anything we add needs to have /some/ kind of test, or be covered by something already existing, otherwise we're vulnerable to: * Patch lands, * Someone refactors clang switch handling, * Other patche

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2024-11-29 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/118102 Apart from fixing the linked issue, this is also necessary for supporting LSP's LocationLink feature and for finding proper insertion locations in the DefineOutline tweak. Memory consumption of the background

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Christian Kandeler (ckandeler) Changes Apart from fixing the linked issue, this is also necessary for supporting LSP's LocationLink feature and for finding proper insertion locations in the DefineOutline tweak. Memory consumpt

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd Author: Christian Kandeler (ckandeler) Changes Apart from fixing the linked issue, this is also necessary for supporting LSP's LocationLink feature and for finding proper insertion locations in the DefineOutline tweak. Memory consumption of the

[clang] [llvm] [SPIR-V] Fixup storage class for global private (PR #116636)

2024-11-29 Thread Steven Perron via cfe-commits
@@ -0,0 +1,17 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +@PrivInternal = internal addrspace(10) global i32 456 +; CHE

[clang] [llvm] [SPIR-V] Fixup storage class for global private (PR #116636)

2024-11-29 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/116636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIR-V] Fixup storage class for global private (PR #116636)

2024-11-29 Thread Steven Perron via cfe-commits
https://github.com/s-perron commented: The implementation looks good to me. I just wonder about one of the tests. I'd like to know why we need to handle that case, and how prevalent the `addrspacecast`s will be. https://github.com/llvm/llvm-project/pull/116636 _

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -0,0 +1,110 @@ +//===--- UseSpanFirstLastCheck.cpp - clang-tidy-*- C++ -*-===// EugeneZelenko wrote: ```suggestion //===--- UseSpanFirstLastCheck.cpp - clang-tidy -*- C++ -*-===// ``` https://github.com/llvm/llvm-project/pull/1

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -0,0 +1,23 @@ +.. title:: clang-tidy - readability-use-span-first-last + +readability-use-span-first-last +=== + +Checks for uses of ``std::span::subspan()`` that can be replaced with clearer +``first()`` or ``last()`` member functions. These dedicat

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %check_clang_tidy -std=c++20 %s readability-use-span-first-last %t + +namespace std { +template +class span { + T* ptr; + __SIZE_TYPE__ len; + +public: + span(T* p, __SIZE_TYPE__ l) : ptr(p), len(l) {} + + span subspan(__SIZE_TYPE__ offset) const {

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -0,0 +1,110 @@ +//===--- UseSpanFirstLastCheck.cpp - clang-tidy-*- 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: Apac

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -0,0 +1,44 @@ +//===--- UseSpanFirstLastCheck.h - clang-tidy---*- 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-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -0,0 +1,44 @@ +//===--- UseSpanFirstLastCheck.h - clang-tidy---*- 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-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -145,6 +145,10 @@ New checks New check aliases ^ +- New check `readability-use-span-first-last` has been added that suggests using EugeneZelenko wrote: Wrong section and format. See `New checks` section for examples. https://github.com/ll

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -0,0 +1,44 @@ +//===--- UseSpanFirstLastCheck.h - clang-tidy---*- C++ -*-===// EugeneZelenko wrote: ```suggestion //===--- UseSpanFirstLastCheck.h - clang-tidy ---*- C++ -*-===// ``` https://github.com/llvm/llvm-project/pull/11

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-29 Thread Ilya Biryukov via cfe-commits
@@ -184,14 +184,30 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { const SourceManager &SM = PP.getSourceManager(); const ModuleMap &MM = HS.getModuleMap(); - llvm::DenseSet ModuleMaps; - - llvm::DenseSet ProcessedModules; - auto CollectModuleMa

[clang] [analyzer] Never create Regions wrapping reference TypedValueRegions (NFCI) (PR #118096)

2024-11-29 Thread Balazs Benics via cfe-commits
steakhal wrote: > The change itself looks good to me, but I wonder what is the reason that we > only want to do this canonicalization when we access fields? It took me a while to unwrap your question. Actually, think of it as an invariant. We should never have reference typed value regions wra

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118076)

2024-11-29 Thread Sudharsan Veeravalli via cfe-commits
https://github.com/svs-quic updated https://github.com/llvm/llvm-project/pull/118076 >From f1031947890501ba543ee9c937110f75379f2069 Mon Sep 17 00:00:00 2001 From: Sudharsan Veeravalli Date: Fri, 29 Nov 2024 14:25:31 +0530 Subject: [PATCH] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension Th

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-29 Thread Kerry McLaughlin via cfe-commits
https://github.com/kmclaughlin-arm updated https://github.com/llvm/llvm-project/pull/114209 >From c62f48766cf24636045286449e98705a6a5bd76c Mon Sep 17 00:00:00 2001 From: Kerry McLaughlin Date: Tue, 15 Oct 2024 15:22:56 + Subject: [PATCH 1/6] [Clang][AArch64] Include SME attributes in the na

[clang] [llvm] [SPIR-V] Fixup storage class for global private (PR #116636)

2024-11-29 Thread Steven Perron via cfe-commits
@@ -3388,6 +3398,13 @@ bool SPIRVInstructionSelector::selectGlobalValue( GVType, MIRBuilder, SPIRV::AccessQualifier::ReadWrite, false); } + const unsigned AddrSpace = GV->getAddressSpace(); + SPIRV::StorageClass::StorageClass StorageClass = + addressSpaceToSto

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-29 Thread Ilya Biryukov via cfe-commits
@@ -184,14 +184,30 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { const SourceManager &SM = PP.getSourceManager(); const ModuleMap &MM = HS.getModuleMap(); - llvm::DenseSet ModuleMaps; - - llvm::DenseSet ProcessedModules; - auto CollectModuleMa

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118076)

2024-11-29 Thread Sudharsan Veeravalli via cfe-commits
https://github.com/svs-quic closed https://github.com/llvm/llvm-project/pull/118076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-29 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/116374 >From ff328f256824e30b2c3c8db184a0fcafaef32637 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Fri, 15 Nov 2024 11:18:21 +0100 Subject: [PATCH 1/5] [ASTWriter] Do not allocate source location space for

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118076)

2024-11-29 Thread Sudharsan Veeravalli via cfe-commits
svs-quic wrote: Don't think force push was the right thing to do here. I'll put up another PR. Closing this. https://github.com/llvm/llvm-project/pull/118076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-29 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: Finally got to it, there is already a test that checks this, see: https://github.com/llvm/llvm-project/blob/ef86a31a593a023946a2dc805948360efdad3930/clang/test/Modules/preprocess-decluse.cpp#L1 and it passes successfully. I've confirmed why it works too. The module map file

[clang] [analyzer] Never create Regions wrapping reference TypedValueRegions (NFCI) (PR #118096)

2024-11-29 Thread Gábor Horváth via cfe-commits
Xazax-hun wrote: Sorry, I might have been a bit unclear. > We should never have reference typed value regions wrapped by subregions. I think my question is what makes the "wrapped by subregions" part special? Why not just "never have reference typed value regions"? https://github.com/llvm/llv

[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-11-29 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 created https://github.com/llvm/llvm-project/pull/118107 While running clang-repl in the browser, we would be interested in this cc1 command ` "" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -dis

[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Anutosh Bhat (anutosh491) Changes While running clang-repl in the browser, we would be interested in this cc1 command ` "" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -

[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-11-29 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 edited https://github.com/llvm/llvm-project/pull/118107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][SME] Fix bug on SMELd1St1 (PR #118109)

2024-11-29 Thread via cfe-commits
https://github.com/wwwatermiao created https://github.com/llvm/llvm-project/pull/118109 Patch[1] has update intrinsic interface for ld1/st1, while based on ARM's document, "If the intrinsic also has a vnum argument, the ZA slice number is calculated by adding vnum to slice.". But the "vnum" di

[clang] [AArch64][SME] Fix bug on SMELd1St1 (PR #118109)

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

[clang] [AArch64][SME] Fix bug on SMELd1St1 (PR #118109)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: None (wwwatermiao) Changes Patch[1] has update intrinsic interface for ld1/st1, while based on ARM's document, "If the intrinsic also has a vnum argument, the ZA slice number is calculated by adding vnum to slice.". But the "vnum"

[clang] [analyzer] Never create Regions wrapping reference TypedValueRegions (NFCI) (PR #118096)

2024-11-29 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > The second is, how can we end up with such subregions. I think the only way > is by field regions. If we had something that I missed, the assert would > catch it. Quick guesses: can we form a base or derived object subregion from them? Is there some hacky pathway where we c

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
@@ -58,6 +58,7 @@ add_clang_library(clangTidyReadabilityModule STATIC UppercaseLiteralSuffixCheck.cpp UseAnyOfAllOfCheck.cpp UseStdMinMaxCheck.cpp + UseSpanFirstLastCheck.cpp EugeneZelenko wrote: Please keep alphabetical order. https://github.com/llvm/

[clang] [llvm] [SPIR-V] Fixup storage class for global private (PR #116636)

2024-11-29 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,17 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +@PrivInternal = internal addrspace(10) global i32 456 +; CHE

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118113)

2024-11-29 Thread Sudharsan Veeravalli via cfe-commits
https://github.com/svs-quic created https://github.com/llvm/llvm-project/pull/118113 This extension adds 11 instructions that perform integer arithmetic. The current spec can be found at: https://github.com/quic/riscv-unified-db/releases/latest This patch adds assembler only support. >From 32

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118113)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Sudharsan Veeravalli (svs-quic) Changes This extension adds 11 instructions that perform integer arithmetic. The current spec can be found at: https://github.com/quic/riscv-unified-db/releases/latest This patch adds assembler only support

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118113)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mc Author: Sudharsan Veeravalli (svs-quic) Changes This extension adds 11 instructions that perform integer arithmetic. The current spec can be found at: https://github.com/quic/riscv-unified-db/releases/latest This patch adds assembler only support.

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118113)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Sudharsan Veeravalli (svs-quic) Changes This extension adds 11 instructions that perform integer arithmetic. The current spec can be found at: https://github.com/quic/riscv-unified-db/releases/latest This patch adds assembler onl

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: Tests are looking better (and github has helpfully thrown away most of my comments). I'll look at the code too now. https://github.com/llvm/llvm-project/pull/110102 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/110102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,61 @@ +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-lifetimes -fsanitize=null -fsanitize-trap=null -o - | FileCheck --check-prefixes=CHECK,NULL --implicit-check-not=ubsantrap %s +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-li

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang %s -S -emit-llvm -fextend-lifetimes -O2 -o - -fno-discard-value-names | FileCheck %s +// +// Check we can correctly produce fake uses for function-level variables even +// when we have a return in a nested conditional and there is no code at the

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,50 @@ +// RUN: %clang_cc1 %s -O0 -emit-llvm -fextend-this-ptr -o - | FileCheck %s \ +// RUN: --implicit-check-not="call void (...) @llvm.fake.use" +// RUN: %clang_cc1 %s -O0 -emit-llvm -fextend-lifetimes -o - | FileCheck %s \ +// RUN: --implicit-check-not="ca

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. https://github.com/llvm/llvm-project/pull/114209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

2024-11-29 Thread via cfe-commits
pkasting wrote: FWIW I agree that `last(size() - n)` is worse than `subspan(n)`, and that the reverse transform (`subspan(size() - n)` -> `last(n)`) is better. https://github.com/llvm/llvm-project/pull/118074 ___ cfe-commits mailing list cfe-commits@l

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -1834,6 +1834,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } + // If we have specified -Og and have not set any explicit -fextend-lifetimes + // value, then default to -fexten

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,30 @@ +/// Check that we generate fake uses only when -fextend-lifetimes is set and we +/// are not setting optnone, or when we have optimizations set to -Og and we have +/// not passed -fno-extend-lifetimes. +// RUN: %clang_cc1 -emit-llvm -disable-llvm-passes -O0 -fex

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/118026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,61 @@ +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-lifetimes -fsanitize=null -fsanitize-trap=null -o - | FileCheck --check-prefixes=CHECK,NULL --implicit-check-not=ubsantrap %s +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-li

[clang] [llvm] [AArch64] Implement intrinsics for SME FP8 FMOPA (PR #118115)

2024-11-29 Thread via cfe-commits
https://github.com/SpencerAbson created https://github.com/llvm/llvm-project/pull/118115 This patch implements the following intrinsics: 8-bit floating-point sum of outer products and accumulate. ``` c // Only if __ARM_FEATURE_SME_F8F16 != 0 void svmopa_za16[_mf8]_m_fpm(uint64_t tile, svb

[clang] [llvm] [AArch64] Implement intrinsics for SME FP8 FMOPA (PR #118115)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (SpencerAbson) Changes This patch implements the following intrinsics: 8-bit floating-point sum of outer products and accumulate. ``` c // Only if __ARM_FEATURE_SME_F8F16 != 0 void svmopa_za16[_mf8]_m_fpm(uint64_t tile, svbool_t

[clang] [llvm] [AArch64] Implement intrinsics for SME FP8 FMOPA (PR #118115)

2024-11-29 Thread via cfe-commits
@@ -587,7 +587,6 @@ void SVEType::applyTypespec(StringRef TS) { ElementBitwidth = 16; SpencerAbson wrote: This is exactly what my refactoring work will help us avoid - so don't fear! https://github.com/llvm/llvm-project/pull/118115 ___

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-29 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > As far as I understand it, these are driver options that will be passed > through to cc1? In that case we can at least test the passthrough, i.e. that > `-fextend-lifetimes` appears in the output of `-###`. I think my preferred approach would be to merge both patches simultane

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/118026 >From 7e42a82d73e3be98aab8e523b16a2e43d31b0552 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Thu, 28 Nov 2024 13:53:20 + Subject: [PATCH 1/2] Enable -fextend-lifetimes at -Og --- clang/docs/CommandGui

[clang] [compiler-rt] [libcxx] [libcxxabi] [llvm] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends by a new LIBCXX_CXX_ABI choice (PR #112978)

2024-11-29 Thread Louis Dionne via cfe-commits
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/112978 >From 7c156ea8545fd9b5211c488ba5c4386c368d5f82 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 13 May 2022 09:26:01 -0400 Subject: [PATCH 1/5] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/110102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -1412,6 +1425,39 @@ void CodeGenFunction::EmitAndRegisterVariableArrayDimensions( } } +/// Return the maximum size of an aggregate for which we generate a fake use +/// intrinsic when -fextend-lifetimes is in effect. +static uint64_t maxFakeUseAggregateSize(const ASTCont

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: Looking good, some comments and questions. Having to fiddle with `findDominatingStoreToReturnValue` to make it skip fake-uses is slightly worrying, but it also says it's a heuristic and thus probably not fundamental for correctness? https://github.com/llvm

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -1664,6 +1710,17 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { emission.getOriginalAllocatedAddress(), emission.getSizeForLifetimeMarkers()); + // Analogous to lifetime markers,

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -1664,6 +1710,17 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { emission.getOriginalAllocatedAddress(), emission.getSizeForLifetimeMarkers()); + // Analogous to lifetime markers,

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -1353,6 +1353,19 @@ void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr) { C->setDoesNotThrow(); } +void CodeGenFunction::EmitFakeUse(Address Addr) { + // We do not emit a fake use if we want to apply optnone to this function, + // even if we mig

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Jeremy Morse via cfe-commits
@@ -112,11 +112,11 @@ void EHScopeStack::deallocate(size_t Size) { StartOfData += llvm::alignTo(Size, ScopeStackAlignment); } -bool EHScopeStack::containsOnlyLifetimeMarkers( +bool EHScopeStack::containsOnlyNoopCleanups( EHScopeStack::stable_iterator Old) const { for

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (PR #118113)

2024-11-29 Thread Craig Topper via cfe-commits
@@ -72,3 +84,27 @@ let Predicates = [HasVendorXqcisls, IsRV32], DecoderNamespace = "Xqcisls" in { def QC_SRH : QCIStore_ScaleIdx<0b1110, "qc.srh">; def QC_SRW : QCIStore_ScaleIdx<0b, "qc.srw">; } // Predicates = [HasVendorXqcisls, IsRV32], DecoderNamespace = "Xqcis

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -1353,6 +1353,19 @@ void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr) { C->setDoesNotThrow(); } +void CodeGenFunction::EmitFakeUse(Address Addr) { + // We do not emit a fake use if we want to apply optnone to this function, + // even if we mig

[clang-tools-extra] [clang-tidy] Add modernize-make-direct check (PR #118120)

2024-11-29 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 056153f36eca184f81969f5cd5c8cd967c935f96 2bcf868d023b5be2f3c88f1d68dd2084b7db4604 --e

[clang-tools-extra] [clang-tidy] Add modernize-make-direct check (PR #118120)

2024-11-29 Thread Helmut Januschka via cfe-commits
https://github.com/hjanuschka created https://github.com/llvm/llvm-project/pull/118120 Adds a new check that converts std::make_* function calls to direct constructor calls using CTAD. Transforms make_optional, make_unique, make_shared and make_pair into their equivalent direct constructor cal

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -1664,6 +1710,17 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { emission.getOriginalAllocatedAddress(), emission.getSizeForLifetimeMarkers()); + // Analogous to lifetime markers,

[clang] [Driver] Do not add gno-column-info when using sampling PGO (PR #117954)

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

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/110102 >From fdfa695bc74847f5cc366bfcbf142bd5c2e3937f Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 16:55:39 +0100 Subject: [PATCH 1/3] [Clang] Add fake use emission to Clang with -fextend-lifeti

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-11-29 Thread Malek Ben Slimane via cfe-commits
@@ -3984,6 +3984,10 @@ def warn_thread_attribute_decl_not_lockable : Warning< def warn_thread_attribute_decl_not_pointer : Warning< "%0 only applies to pointer types; type here is %1">, InGroup, DefaultIgnore; +def warn_thread_attribute_not_on_scoped_lockable_param : Warnin

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/110102 >From fdfa695bc74847f5cc366bfcbf142bd5c2e3937f Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 16:55:39 +0100 Subject: [PATCH 1/4] [Clang] Add fake use emission to Clang with -fextend-lifeti

[clang] be75a14 - [Clang] fix crash due to incorrect argument position in merging deduced template arguments (#118041)

2024-11-29 Thread via cfe-commits
Author: Oleksandr T. Date: 2024-11-29T21:26:59+02:00 New Revision: be75a14207ab0dac6ad9f9097957f14a918ac611 URL: https://github.com/llvm/llvm-project/commit/be75a14207ab0dac6ad9f9097957f14a918ac611 DIFF: https://github.com/llvm/llvm-project/commit/be75a14207ab0dac6ad9f9097957f14a918ac611.diff

[clang] [Clang] fix crash due to incorrect argument position in merging deduced template arguments (PR #118041)

2024-11-29 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/118041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix crash due to incorrect argument position in merging deduced template arguments (PR #118041)

2024-11-29 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-quick` running on `linaro-clang-aarch64-quick` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/8581 Here is the relevant piec

[clang] 820403c - [analyzer] Never create Regions wrapping reference TypedValueRegions (NFCI) (#118096)

2024-11-29 Thread via cfe-commits
Author: Balazs Benics Date: 2024-11-29T20:36:24+01:00 New Revision: 820403c4e04db1f4adc8528bec33d393a5be3856 URL: https://github.com/llvm/llvm-project/commit/820403c4e04db1f4adc8528bec33d393a5be3856 DIFF: https://github.com/llvm/llvm-project/commit/820403c4e04db1f4adc8528bec33d393a5be3856.diff

[clang] [analyzer] Never create Regions wrapping reference TypedValueRegions (NFCI) (PR #118096)

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

[clang] [llvm] [AArch64] Implement FP8 SVE Intrinsics for narrowing conversions (PR #118124)

2024-11-29 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/118124 None >From 3a9643e6c2d61eae2e23df42c19b1410d4a5fcc5 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Thu, 21 Nov 2024 11:21:29 + Subject: [PATCH 1/2] FP8 CVT/CVTL --- clang/include/clang/Basic

[clang-tools-extra] [clang-tidy] Add modernize-make-direct check (PR #118120)

2024-11-29 Thread Oliver Stöneberg via cfe-commits
firewave wrote: This will conflict with `modernize-make-shared` and `modernize-make-unique`. I also very sure having `new` any modern C++ code is very much to be avoided. Having no insight on the differences of the inner workings - but just based on https://en.cppreference.com/w/cpp/memory/sha

[clang] [llvm] [AArch64] Implements FP8 SVE intrinsics for dot-product (PR #118125)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Momchil Velikov (momchil-velikov) Changes --- Patch is 56.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/118125.diff 14 Files Affected: - (modified) clang/include/clang/Basic/arm

[clang] [llvm] [AArch64] Implement FP8 SVE intrinsics for fused multiply-add (PR #118126)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: Momchil Velikov (momchil-velikov) Changes --- Patch is 105.50 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/118126.diff 16 Files Affected: - (modified) clang/include/clang/Basic/arm_sve.

[clang] [llvm] [AArch64] Implement FP8 SVE intrinsics for fused multiply-add (PR #118126)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Momchil Velikov (momchil-velikov) Changes --- Patch is 105.50 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/118126.diff 16 Files Affected: - (modified) clang/include/clang/Basic/arm_sve.td

[clang] [llvm] [AArch64] Implements FP8 SVE intrinsics for dot-product (PR #118125)

2024-11-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: Momchil Velikov (momchil-velikov) Changes --- Patch is 56.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/118125.diff 14 Files Affected: - (modified) clang/include/clang/Basic/arm_sve.t

[clang] [Clang][Driver] report unsupported option error when link + compile in same process (PR #116476)

2024-11-29 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/116476 >From 49a748517c19adc10e9c65b548642a468de2d65e Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 16 Nov 2024 05:57:40 + Subject: [PATCH] [Clang][Driver] report unsupported option error regardless of arg

[clang] [Clang][Driver] report unsupported option error when link + compile in same process (PR #116476)

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

[clang] [Clang][Driver] report unsupported option error when link + compile in same process (PR #116476)

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

[clang] [compiler-rt] [libcxx] [libcxxabi] [llvm] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends by a new LIBCXX_CXX_ABI choice (PR #112978)

2024-11-29 Thread Louis Dionne via cfe-commits
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/112978 >From 7c156ea8545fd9b5211c488ba5c4386c368d5f82 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 13 May 2022 09:26:01 -0400 Subject: [PATCH 1/6] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends

[clang] cbf495f - [Clang][Driver] report unsupported option error when link + compile in same process (#116476)

2024-11-29 Thread via cfe-commits
Author: Reno Dakota Date: 2024-11-29T12:16:04-08:00 New Revision: cbf495fd12ba08c3a8e10dbcd482df1bf80736ed URL: https://github.com/llvm/llvm-project/commit/cbf495fd12ba08c3a8e10dbcd482df1bf80736ed DIFF: https://github.com/llvm/llvm-project/commit/cbf495fd12ba08c3a8e10dbcd482df1bf80736ed.diff L

<    1   2   3   >