[clang] [flang] [flang][RISCV] Add target-abi ModuleFlag. (PR #126188)

2025-02-12 Thread Roger Ferrer Ibáñez via cfe-commits
rofirrim wrote: LGTM. Thanks @topperc ! https://github.com/llvm/llvm-project/pull/126188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-02-12 Thread Zixu Wang via cfe-commits
zixu-w wrote: Hi @mpark ! Unfortunately with this change we hit a crash in our bootstrap build with modules on macOS: ``` Assertion failed: (D && "missing definition for pattern of instantiated definition"), function hasAcceptableDefinition, file SemaType.cpp, line 9203. ``` Do you mind taking

[clang] [clang][ASTDump] Dump value of structural TemplateArguments (PR #126937)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Michael Buch (Michael137) Changes `TemplateArgument::ArgKind::StructuralValue` was introduced in https://github.com/llvm/llvm-project/pull/78041 The AST dump for such template arguments would yield the following: ``` |-ClassTemplateSpecia

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread Orlando Cazalet-Hyams via cfe-commits
@@ -1686,7 +1686,8 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore( DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare( unwrap(Storage), unwrap(VarInfo), unwrap(Expr), unwrap(DL), - unwrap(Instr)); + Instr ? InsertPosition(unwrap(Instr)->getI

[clang] [clang][ASTDump] Dump value of structural TemplateArguments (PR #126937)

2025-02-12 Thread Younan Zhang via cfe-commits
zyn0217 wrote: FYI https://github.com/llvm/llvm-project/pull/126341 is doing exactly the same thing https://github.com/llvm/llvm-project/pull/126937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
@@ -1592,6 +1592,7 @@ llvm::Value *ItaniumCXXABI::EmitTypeid(CodeGenFunction &CGF, cast(SrcRecordTy->castAs()->getDecl()); llvm::Value *Value = CGF.GetVTablePtr(ThisPtr, CGM.GlobalsInt8PtrTy, ClassDecl); + CGF.EmitTypeMetadataCo

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
@@ -1920,6 +1924,18 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache, ThinLTO.CombinedIndex, WholeProgramVisibilityEnabledInLTO, DynamicExportSymbols, VisibleToRegularObjSymbols); + Triple TT(getTargetTriple()); + DeadRTTIElimIndex(ThinLTO.Combine

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
@@ -1187,8 +1191,10 @@ Error LTO::run(AddStreamFn AddStream, FileCache Cache) { return PrevailingType::Unknown; return It->second; }; - computeDeadSymbolsWithConstProp(ThinLTO.CombinedIndex, GUIDPreservedSymbols, - isPrevailing, Con

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
@@ -911,6 +916,63 @@ static void setLiveRoot(ModuleSummaryIndex &Index, StringRef Name) { Summary->setLive(true); } +// Return true if the User U is reachable from a non-vtable user +// through the use-def chain. +static bool hasNonVTableUsers(const User *U, CXXABI *ABI

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
@@ -911,6 +916,61 @@ static void setLiveRoot(ModuleSummaryIndex &Index, StringRef Name) { Summary->setLive(true); } +static bool hasNonVTableUsers(const User *U, CXXABI *ABI) { + LLVM_DEBUG(dbgs() << "Check if " << *U << "has vtable users\n"); + if (isa(U)) { +//

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
@@ -50,6 +51,42 @@ findCallsAtConstantOffset(SmallVectorImpl &DevirtCalls, } } +static bool hasTypeIdLoadAtConstantOffset(const Module *M, Value *VPtr, + int64_t Offset, const CallInst *CI, +

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
https://github.com/teresajohnson edited https://github.com/llvm/llvm-project/pull/126336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Teresa Johnson via cfe-commits
@@ -1920,6 +1924,18 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache, ThinLTO.CombinedIndex, WholeProgramVisibilityEnabledInLTO, DynamicExportSymbols, VisibleToRegularObjSymbols); + Triple TT(getTargetTriple()); + DeadRTTIElimIndex(ThinLTO.Combine

[clang] [llvm] [LLVM][Triple][NFCI] Add function to test for GPU offloading triples (PR #126956)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/126956 running ci >From 967dec47f3d369effa0defdc0d39547a173aca67 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 12 Feb 2025 11:03:34 -0800 Subject: [PATCH] [LLVM][Triple][NFCI] Add function to test for GPU of

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-nvptx-nvidia-ubuntu` running on `as-builder-7` while building `clang,llvm` at step 6 "test-build-unified-tree-check-llvm". Full details are available at: https://lab.llvm.org/buildbot/#/builders/180/builds/12902 Here i

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

2025-02-12 Thread via cfe-commits
SunilKuravinakop wrote: >#if dispatch transformed to > >#pragma omp taskwait depend(out:x) >#pragma omp dispatch nocontext(c2) >foo(); --> with traits call to foo_variant_dispatch(i,j) > >you should have 2 captured regions - one for taskwait and one for dispatch. It >does not mean, >you need to

[clang] [clang] run clang-format on some CGObjC files (PR #126644)

2025-02-12 Thread Peter Rong via cfe-commits
https://github.com/DataCorrupted closed https://github.com/llvm/llvm-project/pull/126644 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman requested changes to this pull request. Marking as requesting changes so we don't accidentally land, because I've got questions about whether we want to go down this route. 1) GCC has `__has_builtin`, so how do they handle offloading targets? Do they have the sa

[clang] [clang] run clang-format on some CGObjC files (PR #126644)

2025-02-12 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. Thank you; LGTM. https://github.com/llvm/llvm-project/pull/126644 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Marking as requesting changes so we don't accidentally land, because I've got > questions about whether we want to go down this route. > > 1. GCC has `__has_builtin`, so how do they handle offloading targets? Do > they have the same odd behavior where `__has_builtin` retur

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2025-02-12 Thread John McCall via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -163,6 +163,7 @@ Bug Fixes to C++ Support Bug Fixes to AST Handling ^ +- F

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2025-02-12 Thread John McCall via cfe-commits
Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?= Message-ID: In-Reply-To: @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -9,20 +9,20 @@ typedef int (*T)[2]; restrict T x; typedef int *S[2]; -restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}} - - +restrict S y; // expected-warning {{'restrict' qualifier on an array of pointers is a

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -1593,35 +1593,40 @@ QualType Sema::BuildQualifiedType(QualType T, SourceLocation Loc, // object or incomplete types shall not be restrict-qualified." if (Qs.hasRestrict()) { unsigned DiagID = 0; -QualType ProblemTy; - -if (T->isAnyPointerType() || T->isRefe

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -1593,35 +1593,40 @@ QualType Sema::BuildQualifiedType(QualType T, SourceLocation Loc, // object or incomplete types shall not be restrict-qualified." if (Qs.hasRestrict()) { unsigned DiagID = 0; -QualType ProblemTy; - -if (T->isAnyPointerType() || T->isRefe

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -std=c23 -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=c17 -fsyntax-only -pedantic -verify=pedantic %s +// RUN: %clang_cc1 -std=c2x -fsyntax-only -Wpre-c2x-compat -verify=c2x-compat %s AaronBallman wrote: ```suggestion //

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

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

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -std=c23 -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=c17 -fsyntax-only -pedantic -verify=pedantic %s +// RUN: %clang_cc1 -std=c2x -fsyntax-only -Wpre-c2x-compat -verify=c2x-compat %s + +typedef int (*T1)[2]; +restrict T1 t1; + +typedef i

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -std=c23 -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=c17 -fsyntax-only -pedantic -verify=pedantic %s +// RUN: %clang_cc1 -std=c2x -fsyntax-only -Wpre-c2x-compat -verify=c2x-compat %s + +typedef int (*T1)[2]; +restrict T1 t1; + +typedef i

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > That's what the initial proposal / patch was, but that got reverted because > it broke some CUDA on Arm sources. See #121839. Yeah, but I'm suggesting that seems like a bug with CUDA on Arm sources. (But it also depends on how GCC behaves with offload targets; if they hav

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

2025-02-12 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: > > #if dispatch transformed to > > #pragma omp taskwait depend(out:x) > > #pragma omp dispatch nocontext(c2) > > foo(); --> with traits call to foo_variant_dispatch(i,j) > > you should have 2 captured regions - one for taskwait and one for dispatch. > > It does not mean, >y

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > That's what the initial proposal / patch was, but that got reverted because > > it broke some CUDA on Arm sources. See #121839. > > Yeah, but I'm suggesting that seems like a bug with CUDA on Arm sources. (But > it also depends on how GCC behaves with offload targets; if the

[clang] [llvm] [llvm][fatlto] Add FatLTOCleanup pass (PR #125911)

2025-02-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/125911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][fatlto] Add FatLTOCleanup pass (PR #125911)

2025-02-12 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,123 @@ +//===- FatLtoCleanup.cpp - clean up IR for the FatLTO pipeline --*- 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: Ap

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I think this is pretty close, mostly just nits from me. https://github.com/llvm/llvm-project/pull/120896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [llvm] [llvm][fatlto] Add FatLTOCleanup pass (PR #125911)

2025-02-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/125911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `mlir-rocm-mi200` running on `mi200-buildbot` while building `clang,llvm` at step 7 "test-build-check-mlir-build-only-check-mlir". Full details are available at: https://lab.llvm.org/buildbot/#/builders/177/builds/12901 Here

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `mlir-nvidia-gcc7` running on `mlir-nvidia` while building `clang,llvm` at step 7 "test-build-check-mlir-build-only-check-mlir". Full details are available at: https://lab.llvm.org/buildbot/#/builders/116/builds/10165 Here i

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/17

[clang] [HLSL] Implement HLSL intialization list support (PR #123141)

2025-02-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. https://github.com/llvm/llvm-project/pull/123141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `ppc64le-mlir-rhel-clang` running on `ppc64le-mlir-rhel-test` while building `clang,llvm` at step 6 "test-build-check-mlir-build-only-check-mlir". Full details are available at: https://lab.llvm.org/buildbot/#/builders/129/bui

[clang] 23209eb - Revert "[DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)"

2025-02-12 Thread Harald van Dijk via cfe-commits
Author: Harald van Dijk Date: 2025-02-12T17:50:39Z New Revision: 23209eb1d9df57ca3419f5abc6b2edcdc0d1dead URL: https://github.com/llvm/llvm-project/commit/23209eb1d9df57ca3419f5abc6b2edcdc0d1dead DIFF: https://github.com/llvm/llvm-project/commit/23209eb1d9df57ca3419f5abc6b2edcdc0d1dead.diff LO

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `ml-opt-devrel-x86-64` running on `ml-opt-devrel-x86-64-b1` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/13112

[clang] [clang] run clang-format on some CGObjC files (PR #126644)

2025-02-12 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 c7995a6905f2320f280013454676f992a8c6f89f 754f34dcab55685f12993fdfbd5a6c7cafdb1885 --e

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

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

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: > I believe this fixes #113297, right? Yes. https://github.com/llvm/llvm-project/pull/126945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-armv8-quick` running on `linaro-clang-armv8-quick` while building `clang,llvm` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/154/builds/11762 Here is the relevant p

[clang] [llvm] [llvm][fatlto] Add FatLTOCleanup pass (PR #125911)

2025-02-12 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/125911 >From f0c397ed6a1d85fe2830ebd84033e51516d57d07 Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Thu, 30 Jan 2025 16:44:15 + Subject: [PATCH] [llvm][fatlto] Add FatLTOCleanup pass When using FatLTO, it is com

[libclc] [libclc] Stop installing CLC headers (PR #126908)

2025-02-12 Thread Karol Herbst via cfe-commits
karolherbst wrote: Forgot to drop a link to the lines in question: https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/opencl-c-base.h#L16 https://github.com/llvm/llvm-project/pull/126908 ___ cfe-commits mailing list cfe-commits@lists.llv

[libclc] [libclc] Stop installing CLC headers (PR #126908)

2025-02-12 Thread Karol Herbst via cfe-commits
karolherbst wrote: The base header enables a bunch of extensions when `__SPIRV__` or `__SPIR__` is found, and that define is set automatically when a SPIRV or SPIR tripple is used. Maybe there is a better tripple to be used in this case? However we do want to compile to SPIR-V (with the nativ

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `ml-opt-dev-x86-64` running on `ml-opt-dev-x86-64-b2` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/13269 Here i

[clang] [HLSL] Make memory representation of boolean vectors in HLSL, vectors of i32. Add support for boolean swizzling. (PR #123977)

2025-02-12 Thread Tex Riddell via cfe-commits
@@ -110,6 +131,24 @@ float2 HowManyFloats(float V) { return V.rr.rr; } +// CHECK-LABEL: HowManyBools +// CHECK: [[VAddr:%.*]] = alloca i32, align 4 +// CHECK-NEXT: [[Vec2Ptr:%.*]] = alloca <2 x i32>, align 8 +// CHECK-NEXT: [[Tmp:%.*]] = zext i1 {{.*}} to i32 +// CHECK-NEXT:

[clang] [HLSL] Make memory representation of boolean vectors in HLSL, vectors of i32. Add support for boolean swizzling. (PR #123977)

2025-02-12 Thread Sarah Spall via cfe-commits
@@ -110,6 +131,24 @@ float2 HowManyFloats(float V) { return V.rr.rr; } +// CHECK-LABEL: HowManyBools +// CHECK: [[VAddr:%.*]] = alloca i32, align 4 +// CHECK-NEXT: [[Vec2Ptr:%.*]] = alloca <2 x i32>, align 8 +// CHECK-NEXT: [[Tmp:%.*]] = zext i1 {{.*}} to i32 +// CHECK-NEXT:

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120896 >From 295df258043ef5a87ae603eedd308b863bad7b59 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 22 Dec 2024 15:14:30 +0200 Subject: [PATCH 01/13] [Clang] allow restrict qualifier for array types with po

[clang] [llvm] [reland][DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126967)

2025-02-12 Thread Harald van Dijk via cfe-commits
hvdijk wrote: This is a reland of #126059 with `insertDeclare`'s overload taking `BasicBlock *` restored, and the changes to calls to that overload reverted. We previously had nothing that relied on its peculiar behavior, therefore the change in its behavior passed testing, but it crossed path

[clang] [llvm] [reland][DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126967)

2025-02-12 Thread Harald van Dijk via cfe-commits
https://github.com/hvdijk created https://github.com/llvm/llvm-project/pull/126967 After #124287 updated several functions to return iterators rather than Instruction *, it was no longer straightforward to pass their result to DIBuilder. This commit updates DIBuilder methods to accept an Inser

[clang] [llvm] [reland][DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126967)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-transforms Author: Harald van Dijk (hvdijk) Changes After #124287 updated several functions to return iterators rather than Instruction *, it was no longer straightforward to pass their result to DIBuilder. This commit updates DIBuilder methods to

[clang] [llvm] [reland][DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126967)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines @llvm/pr-subscribers-llvm-ir Author: Harald van Dijk (hvdijk) Changes After #124287 updated several functions to return iterators rather than Instruction *, it was no longer straightforward to pass their result to DIBuilder. This commit upda

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-12 Thread Oleksandr T. via cfe-commits
@@ -9,20 +9,20 @@ typedef int (*T)[2]; restrict T x; typedef int *S[2]; -restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}} - - +restrict S y; // expected-warning {{'restrict' qualifier on an array of pointers is a

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: That's pretty much how I imagined it too, so I'm happy, but let's see what others think. https://github.com/llvm/llvm-project/pull/126945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-02-12 Thread Ilia Kuklin via cfe-commits
https://github.com/kuilpd updated https://github.com/llvm/llvm-project/pull/115005 >From dd65babbf4c73a0b2fc2e4aa47a9a346bd5a9adf Mon Sep 17 00:00:00 2001 From: Ilia Kuklin Date: Mon, 4 Nov 2024 14:33:45 +0500 Subject: [PATCH 01/14] [lldb] Analyze enum promotion type during parsing --- clang/

[clang] f8c7457 - [NFC] Avoid potential null dereference. (#126872)

2025-02-12 Thread via cfe-commits
Author: schittir Date: 2025-02-12T09:36:02-08:00 New Revision: f8c7457c79eece1bd1b7f15e7679517c7c63ad89 URL: https://github.com/llvm/llvm-project/commit/f8c7457c79eece1bd1b7f15e7679517c7c63ad89 DIFF: https://github.com/llvm/llvm-project/commit/f8c7457c79eece1bd1b7f15e7679517c7c63ad89.diff LOG:

[clang] [NFC] Avoid potential null dereference. (PR #126872)

2025-02-12 Thread via cfe-commits
https://github.com/schittir closed https://github.com/llvm/llvm-project/pull/126872 ___ 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)

2025-02-12 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: @jansvoboda11 No worries at all, thanks for getting back to me. https://github.com/llvm/llvm-project/pull/116374 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3ec9f74 - [DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)

2025-02-12 Thread via cfe-commits
Author: Harald van Dijk Date: 2025-02-12T17:38:59Z New Revision: 3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6 URL: https://github.com/llvm/llvm-project/commit/3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6 DIFF: https://github.com/llvm/llvm-project/commit/3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6.diff LO

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread Harald van Dijk via cfe-commits
https://github.com/hvdijk closed https://github.com/llvm/llvm-project/pull/126059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread Harald van Dijk via cfe-commits
@@ -1686,7 +1686,8 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore( DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare( unwrap(Storage), unwrap(VarInfo), unwrap(Expr), unwrap(DL), - unwrap(Instr)); + Instr ? InsertPosition(unwrap(Instr)->getI

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Tomas Matheson (tmatheson-arm) Changes The AAPCS64 adds a number of vector types to the C unconditionally: https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#11appendix-support-for-advan

[clang] [flang] [flang][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

2025-02-12 Thread Kiran Chandramohan via cfe-commits
@@ -6919,6 +6919,10 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri def fhermetic_module_files : Flag<["-"], "fhermetic-module-files">, Group, HelpText<"Emit hermetic module files (no nested USE association)">; + +def do_concurrent_to_op

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread Dmitry Nechitaev via cfe-commits
https://github.com/Nechda updated https://github.com/llvm/llvm-project/pull/126897 >From 8baebe758b4f07933294b88bf2390fbb14ddeed0 Mon Sep 17 00:00:00 2001 From: Dmitry Nechitaev Date: Wed, 12 Feb 2025 14:30:47 +0300 Subject: [PATCH 1/4] Add AllowFalseEvaluated to clang-tidy noexcept-move-const

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -201,6 +205,39 @@ SVE_OPAQUE_TYPE(__SVCount_t, __SVCount_t, SveCount, SveCountTy) SVE_SCALAR_TYPE(__mfp8, __mfp8, MFloat8, MFloat8Ty, 8) +#ifndef NEON_VECTOR_TYPE momchil-velikov wrote: Maybe leave comment these should not end up as `BuiltinType` (unlike

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -1440,11 +1440,19 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, if (Target.hasAArch64SVETypes() || (AuxTarget && AuxTarget->hasAArch64SVETypes())) { -#define SVE_TYPE(Name, Id, SingletonId) \ + #define SVE_VECTOR_TYPE(Name, MangledName, Id, Single

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -203,6 +203,11 @@ void LangOptions::setLangDefaults(LangOptions &Opts, Language Lang, Opts.setDefaultFPContractMode(LangOptions::FPM_Fast); } + if (T.isARM() || T.isAArch64()) { momchil-velikov wrote: extra `{` and empty line https://github.com/ll

[clang] [llvm] [DirectX] Set Shader Flag DisableOptimizations (PR #126813)

2025-02-12 Thread S. Bharadwaj Yadavalli via cfe-commits
@@ -212,20 +230,24 @@ PreservedAnalyses ShaderFlagsAnalysisPrinter::run(Module &M, bool ShaderFlagsAnalysisWrapper::runOnModule(Module &M) { DXILResourceTypeMap &DRTM = getAnalysis().getResourceTypeMap(); + const ModuleMetadataInfo MMDI = + getAnalysis().getModul

[clang] [llvm] [DirectX] Set Shader Flag DisableOptimizations (PR #126813)

2025-02-12 Thread S. Bharadwaj Yadavalli via cfe-commits
https://github.com/bharadwajy edited https://github.com/llvm/llvm-project/pull/126813 ___ 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 AllowedTypes option to misc-const-correctness (PR #122951)

2025-02-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/122951 ___ 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 AllowedTypes option to misc-const-correctness (PR #122951)

2025-02-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: @HerrCai0907, I rebased on main, so no more conflicts. I think this PR can also be merged, could you help please? https://github.com/llvm/llvm-project/pull/122951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [flang] [flang][RISCV] Add target-abi ModuleFlag. (PR #126188)

2025-02-12 Thread Craig Topper via cfe-commits
https://github.com/topperc edited https://github.com/llvm/llvm-project/pull/126188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][RISCV][WIP] Add target-abi ModuleFlag. (PR #126188)

2025-02-12 Thread Craig Topper via cfe-commits
https://github.com/topperc ready_for_review https://github.com/llvm/llvm-project/pull/126188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread via cfe-commits
@@ -11,3 +11,16 @@ evaluates to ``false`` (but is not a ``false`` literal itself). Move constructors of all the types used with STL containers, for example, need to be declared ``noexcept``. Otherwise STL will choose copy constructors instead. The same is valid for move assign

[clang] [flang] [flang][RISCV] Add target-abi ModuleFlag. (PR #126188)

2025-02-12 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 c3b7894fb82cabfd36005e9de018625d81ad89e1 302fecc2be9cd2c3d275a0404ae01a6585ae53b6 --e

[clang] [flang] [flang][RISCV] Add target-abi ModuleFlag. (PR #126188)

2025-02-12 Thread Craig Topper via cfe-commits
https://github.com/topperc edited https://github.com/llvm/llvm-project/pull/126188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -110,6 +110,11 @@ Changes in existing checks ` check by providing additional examples and fixing some macro related false positives. +- Improved :doc:`performance-noexcept-move-constructor + `. Check allows vbvictor wrote: ```suggestion ` check to a

[clang] [llvm] [DirectX] Set Shader Flag DisableOptimizations (PR #126813)

2025-02-12 Thread S. Bharadwaj Yadavalli via cfe-commits
https://github.com/bharadwajy updated https://github.com/llvm/llvm-project/pull/126813 >From 216c451521eaacb1f2116dca3671ecedff1f8e70 Mon Sep 17 00:00:00 2001 From: "S. Bharadwaj Yadavalli" Date: Tue, 11 Feb 2025 14:40:25 -0500 Subject: [PATCH 1/2] [DirectX] Set Shader Flag DisableOptimizations

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -11,3 +11,16 @@ evaluates to ``false`` (but is not a ``false`` literal itself). Move constructors of all the types used with STL containers, for example, need to be declared ``noexcept``. Otherwise STL will choose copy constructors instead. The same is valid for move assign

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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: Ap

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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: Ap

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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: Ap

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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: Ap

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -91,6 +91,12 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`use-scoped-lock vbvictor wrote: Done https://github.com/llvm/llvm-project/pull/126434 ___ cfe-commits mailing list cfe-commits@lists.

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,81 @@ +.. title:: clang-tidy - modernize-use-scoped-lock + +modernize-use-scoped-lock += + +Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more +flexible and safer alternative ``std::scoped_lock``. The check will +auto

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/126434 >From 92588a7eb3f87e74887e94f88d3402ec25c6ee53 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 9 Feb 2025 22:34:26 +0300 Subject: [PATCH 1/6] [clang-tidy] add modernize-use-scoped-lock check --- .../

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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: Ap

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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: Ap

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Arthur Eubanks via cfe-commits
@@ -2949,15 +2950,34 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } } +static bool isValidCodeModelAttr(Sema &S, StringRef Str) { + if (S.Context.getTargetInfo().getTriple().isLoongArch()) { +return Str == "normal" || Str == "medium" || St

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/126434 >From 92588a7eb3f87e74887e94f88d3402ec25c6ee53 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 9 Feb 2025 22:34:26 +0300 Subject: [PATCH 1/5] [clang-tidy] add modernize-use-scoped-lock check --- .../

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Reid Kleckner via cfe-commits
@@ -2964,20 +2963,36 @@ static bool isValidCodeModelAttr(Sema &S, StringRef Str) { static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) { StringRef Str; SourceLocation LiteralLoc; + auto IsTripleSupported = [](const llvm::Triple Triple) { +return Tr

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Reid Kleckner via cfe-commits
@@ -2950,12 +2950,11 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } } -static bool isValidCodeModelAttr(Sema &S, StringRef Str) { - if (S.Context.getTargetInfo().getTriple().isLoongArch()) { +static bool isValidCodeModelAttr(llvm::Triple Tripl

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks edited https://github.com/llvm/llvm-project/pull/124834 ___ 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 new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,81 @@ +.. title:: clang-tidy - modernize-use-scoped-lock + +modernize-use-scoped-lock += + +Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more +flexible and safer alternative ``std::scoped_lock``. The check will -

<    1   2   3   4   5   6   >