[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-16 Thread via cfe-commits
@@ -319,6 +319,29 @@ static cl::opt PGOFunctionCriticalEdgeThreshold( cl::desc("Do not instrument functions with the number of critical edges " " greater than this threshold.")); +static cl::opt ColdFuncCoverageMaxEntryCount( +"cold-function-coverage-max-e

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-16 Thread via cfe-commits
@@ -319,6 +319,29 @@ static cl::opt PGOFunctionCriticalEdgeThreshold( cl::desc("Do not instrument functions with the number of critical edges " " greater than this threshold.")); +static cl::opt ColdFuncCoverageMaxEntryCount( +"cold-function-coverage-max-e

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-16 Thread via cfe-commits
@@ -649,6 +649,24 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C, } } + if (auto *ColdFuncCoverageArg = Args.getLastArg( + options::OPT_fprofile_generate_cold_function_coverage, + options::OPT_fprofile_generate_cold_function

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-16 Thread via cfe-commits
@@ -1784,6 +1784,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling", PosFlag, NegFlag>; +def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, +Group, Visibility<[ClangOption, CLOption]>, +

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-16 Thread via cfe-commits
@@ -1784,6 +1784,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling", PosFlag, NegFlag>; +def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, WenleiHe wrote: +1 on single driver

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-16 Thread via cfe-commits
@@ -319,6 +319,29 @@ static cl::opt PGOFunctionCriticalEdgeThreshold( cl::desc("Do not instrument functions with the number of critical edges " " greater than this threshold.")); +static cl::opt ColdFuncCoverageMaxEntryCount( +"cold-function-coverage-max-e

[clang] [Clang] Disable use of the counted_by attribute for whole struct pointers (PR #112636)

2024-10-16 Thread Jan Hendrik Farr via cfe-commits
https://github.com/Cydox approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/112636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Jessica Clarke via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [clang][CodeGen] Zero init unspecified fields in initializers in C (PR #97121)

2024-10-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: (For reference, this was reapplied in #110051.) I'm not anticipating significant performance regressions here in normal usage: all the bits that are getting initialized are padding adjacent to initialized fields, so I expect the additional initialization will usually be fr

[clang] [clang][OpenCL][CodeGen][AMDGPU] Do not use `private` as the default AS for when `generic` is available (PR #112442)

2024-10-16 Thread Alex Voicu via cfe-commits
@@ -1,9 +1,10 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -ffake-address-space-map -triple i686-pc-darwin | FileCheck -enable-var-scope -check-prefixes=ALL,X86 %s -// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -triple amdgcn | FileCheck -enable-var-scope -check-prefixes=ALL,AMDGCN

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread via cfe-commits
@@ -3182,11 +3182,12 @@ class CallExpr : public Expr { /// Returns the WarnUnusedResultAttr that is either declared on the called /// function, or its return type declaration. Sirraide wrote: The comment should be expanded to also explain what the `NamedD

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread via cfe-commits
https://github.com/Sirraide commented: This still needs a release note, but apart from that I think it’s fine. I definitely prefer this over the other approach. https://github.com/llvm/llvm-project/pull/112521 ___ cfe-commits mailing list cfe-commits@

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/112521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread via cfe-commits
@@ -115,20 +115,20 @@ void usage() { S('A'); // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute: Don't let that S-Char go!}} S(1); S(2.2); - Y(); // expected-warning {{ignoring temporary created by a constructor declar

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread via cfe-commits
@@ -290,9 +296,10 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) { if (E->getType()->isVoidType()) return; -if (DiagnoseNoDiscard(*this, cast_or_null( - CE->getUnusedResultAttr(Context)), -

[libunwind] [libunwind][AIX] Remove weak declaration "__xlcxx_personality_v0" (PR #112436)

2024-10-16 Thread Xing Xue via cfe-commits
@@ -2126,42 +2125,34 @@ bool UnwindCursor::getInfoFromTBTable(pint_t pc, R ®isters) { // function __xlcxx_personality_v0(), which is the personality for the state // table and is exported from libc++abi, is directly assigned as the // handler here. When a legacy X

[libunwind] [libunwind][AIX] Remove weak declaration "__xlcxx_personality_v0" (PR #112436)

2024-10-16 Thread Xing Xue via cfe-commits
@@ -2126,42 +2125,34 @@ bool UnwindCursor::getInfoFromTBTable(pint_t pc, R ®isters) { // function __xlcxx_personality_v0(), which is the personality for the state // table and is exported from libc++abi, is directly assigned as the // handler here. When a legacy X

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-16 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111082 >From 62af64102d96405d9a572a054ad4c2fa87ba8867 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Mon, 23 Sep 2024 22:10:59 + Subject: [PATCH 1/6] implement firstbithigh hlsl builtin --- clang/include/clang/Ba

[clang] [-Wunsafe-buffer-usage] Add user documentation. (PR #111624)

2024-10-16 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-ubuntu` running on `linaro-lldb-aarch64-ubuntu` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/6684 Here is the relevant piece of the b

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-16 Thread via cfe-commits
goldsteinn wrote: Think root cause is a bug in InstCombine where we narrow type but don't update the type of the `range` attr: https://godbolt.org/z/PKa9355Ej https://github.com/llvm/llvm-project/pull/91101 ___ cfe-commits mailing list cfe-commits@lis

[clang] 2ce0a90 - [NFC][HLSL] Fix test function names (#112602)

2024-10-16 Thread via cfe-commits
Author: Tim Gymnich Date: 2024-10-16T16:31:38-07:00 New Revision: 2ce0a90d5c026ee4ec4e7e38e7939ca60236e127 URL: https://github.com/llvm/llvm-project/commit/2ce0a90d5c026ee4ec4e7e38e7939ca60236e127 DIFF: https://github.com/llvm/llvm-project/commit/2ce0a90d5c026ee4ec4e7e38e7939ca60236e127.diff L

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/112602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] afc6da4 - [clang][dataflow] Silence unused variable warning. NFCI

2024-10-16 Thread Benjamin Kramer via cfe-commits
Author: Benjamin Kramer Date: 2024-10-17T01:36:15+02:00 New Revision: afc6da43d5ae068d041728d96b6b6590f94afbb0 URL: https://github.com/llvm/llvm-project/commit/afc6da43d5ae068d041728d96b6b6590f94afbb0 DIFF: https://github.com/llvm/llvm-project/commit/afc6da43d5ae068d041728d96b6b6590f94afbb0.dif

[clang] [Clang][SYCL] Introduce clang-sycl-link-wrapper to link SYCL offloading device code (Part 1 of many) (PR #112245)

2024-10-16 Thread Arvind Sudarsanam via cfe-commits
https://github.com/asudarsa updated https://github.com/llvm/llvm-project/pull/112245 >From eff4a0300336c4c106e1d293b19e795f5ccbabc1 Mon Sep 17 00:00:00 2001 From: Arvind Sudarsanam Date: Fri, 27 Sep 2024 13:03:12 -0700 Subject: [PATCH 1/9] [Clang][SYCL] Introduce clang-sycl-link-wrapper to link

[clang] [lld] [llvm] [WebAssembly] Enable nontrapping-fptoint and bulk-memory by default. (PR #112049)

2024-10-16 Thread Heejin Ahn via cfe-commits
aheejin wrote: > I've now added a patch which fixes #63755. Can you split this patch into a separate PR? https://github.com/llvm/llvm-project/pull/112049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [clang][CodeGen] Zero init unspecified fields in initializers in C (PR #97121)

2024-10-16 Thread via cfe-commits
yabinc wrote: According to the C23 standard, initializing a union variable with empty braces {} only guarantees the initialization of the first member and any padding after all members. This behavior deviates from common intuition and caused a bug when compiling the Linux kernel. Based on the

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread Yihe Li via cfe-commits
https://github.com/Mick235711 updated https://github.com/llvm/llvm-project/pull/112521 >From 10f7bb8cd7d6eef26065d20437dc126cd4e7138c Mon Sep 17 00:00:00 2001 From: Yihe Li Date: Wed, 16 Oct 2024 18:53:04 +0800 Subject: [PATCH] [clang] Improve diagnostic on [[nodiscard]] attribute --- clang/d

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread Tim Gymnich via cfe-commits
https://github.com/tgymnich edited https://github.com/llvm/llvm-project/pull/112602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Zero init unspecified fields in initializers in C (PR #97121)

2024-10-16 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: Handling for local variables (not initialized with `{}`). The performance impact of guaranteeing the extension is artificially reduced because the baseline code generation uses `memset` over the entire union when the size is large, but initializing the bytes after

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread Yihe Li via cfe-commits
@@ -115,20 +115,20 @@ void usage() { S('A'); // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute: Don't let that S-Char go!}} S(1); S(2.2); - Y(); // expected-warning {{ignoring temporary created by a constructor declar

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread Yihe Li via cfe-commits
https://github.com/Mick235711 updated https://github.com/llvm/llvm-project/pull/112521 >From 59f7dbdd8eed456b76e93f6260bf0e361242e9fd Mon Sep 17 00:00:00 2001 From: Yihe Li Date: Wed, 16 Oct 2024 18:53:04 +0800 Subject: [PATCH] [clang] Improve diagnostic on [[nodiscard]] attribute --- clang/d

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Tim Gymnich (tgymnich) Changes Fix test names changing `int` to `uint`. @bob80905 --- Full diff: https://github.com/llvm/llvm-project/pull/112602.diff 1 Files Affected: - (modified) clang/test/CodeGenHLSL/builtins/sign.hlsl (+4-4) ``

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Tim Gymnich (tgymnich) Changes Fix test names changing `int` to `uint`. @bob80905 --- Full diff: https://github.com/llvm/llvm-project/pull/112602.diff 1 Files Affected: - (modified) clang/test/CodeGenHLSL/builtins/sign.hlsl (+4-4) `

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread Tim Gymnich via cfe-commits
https://github.com/tgymnich created https://github.com/llvm/llvm-project/pull/112602 Fix test names changing `int` to `uint`. @bob80905 >From 68c7d969fcda4422c08132860478257849d9b587 Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Wed, 16 Oct 2024 20:56:54 +0200 Subject: [PATCH] Fix function

[clang] [clang][HLSL] Add sign intrinsic part 4 (PR #108396)

2024-10-16 Thread Tim Gymnich via cfe-commits
@@ -155,3 +197,24 @@ int3 test_sign_int64_t3(int64_t3 p0) { return sign(p0); } // CHECK: %hlsl.sign = call <4 x i32> @llvm.[[TARGET]].sign.v4i64( // CHECK: ret <4 x i32> %hlsl.sign int4 test_sign_int64_t4(int64_t4 p0) { return sign(p0); } + + +// CHECK: define [[FNATTRS]] i32 @

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread Yihe Li via cfe-commits
https://github.com/Mick235711 updated https://github.com/llvm/llvm-project/pull/112521 >From e69fcc089b8a0cb2d6c420f829ad74bd26a8ad21 Mon Sep 17 00:00:00 2001 From: Yihe Li Date: Wed, 16 Oct 2024 18:53:04 +0800 Subject: [PATCH] [clang] Improve diagnostic on [[nodiscard]] attribute --- clang/d

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread Tim Gymnich via cfe-commits
https://github.com/tgymnich edited https://github.com/llvm/llvm-project/pull/112602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread Yihe Li via cfe-commits
https://github.com/Mick235711 updated https://github.com/llvm/llvm-project/pull/112521 >From 35be44832bdc81ddbdeaa98500e65ec1de0cc049 Mon Sep 17 00:00:00 2001 From: Yihe Li Date: Wed, 16 Oct 2024 18:53:04 +0800 Subject: [PATCH] [clang] Improve diagnostic on [[nodiscard]] attribute --- clang/d

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/112602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make -fveclib={ArmPL, SLEEF} imply -fno-math-errno (PR #112580)

2024-10-16 Thread Maciej Gabka via cfe-commits
@@ -3125,6 +3129,10 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, TrappingMathPresent = true; FPExceptionBehavior = "strict"; break; +case options::OPT_fveclib: + if (llvm::is_contained(VecLibImpliesNoMathErrno, A->g

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-16 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,138 @@ +; Tests if the __llvm_gcov_ctr section contains a .ref pseudo-op +; referring to the __llvm_covinit section. +; RUN: llc < %s | FileCheck --check-prefixes=CHECK,CHECK-RW %s +; RUN: llc -mxcoff-roptr < %s | FileCheck --check-prefixes=CHECK,CHECK-RO %s + +target d

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-16 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast approved this pull request. LGTM with minor comment; thanks! https://github.com/llvm/llvm-project/pull/108570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-16 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/108570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [llvm] [DirectX] Remove trivially dead functions at linkage finalize (PR #106146)

2024-10-16 Thread Greg Roth via cfe-commits
https://github.com/pow2clk updated https://github.com/llvm/llvm-project/pull/106146 >From 40224473a7b43bc4ffe2024ab51196c2130bedc7 Mon Sep 17 00:00:00 2001 From: Greg Roth Date: Sun, 25 Aug 2024 12:00:03 -0600 Subject: [PATCH 1/6] [DirectX] Remove trivially dead functions at linkage finalize

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov/update_dpp (PR #112447)

2024-10-16 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec updated https://github.com/llvm/llvm-project/pull/112447 >From 761b3e21748dd3a7b53cd0ead745943213317eb4 Mon Sep 17 00:00:00 2001 From: Stanislav Mekhanoshin Date: Tue, 15 Oct 2024 15:23:28 -0700 Subject: [PATCH 1/4] [AMDGPU] Allow overload of __builtin_amdgcn_mov/up

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/7] [HLSL] Collect explicit resource binding information (part 1)

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

2024-10-16 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/112600 >From 0739f6da81d7c1edd9578ae4ff9dd699e5c828c6 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 10 Oct 2024 14:31:25 -0700 Subject: [PATCH 01/10] ConceptSpecializationExpr shows up in AST!!! --- .../c

[clang] [Clang] prevent assertion failure in value-dependent initializer expressions (PR #112612)

2024-10-16 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/112612 Fixes #112140 >From 6112d12f757cce0214132e9201dc2a434e40e0c7 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Wed, 16 Oct 2024 23:42:05 +0300 Subject: [PATCH] [Clang] prevent assertion failure in value-depen

[clang] [Clang] prevent assertion failure in value-dependent initializer expressions (PR #112612)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Oleksandr T. (a-tarasyuk) Changes Fixes #112140 --- Full diff: https://github.com/llvm/llvm-project/pull/112612.diff 3 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+1) - (modified) clang/lib/AST/ExprConstant.cpp (+3) - (m

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-16 Thread Peilin Ye via cfe-commits
peilin-ye wrote: Back on this; rebased and pushed patchset v6 to make `acquire-release.ll` also cover `-march=bpfeb` as suggested by Eduard. Basically: ``` ; CHECK-LE: w0 = load_acquire((u8 *)(r1 + 0)) # encoding: [0xd3,0x10,0x00,0x00,0x10,0x00,0x00,0x00] ; CHECK-BE: w0 = load_acquire((u8 *)(r

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-16 Thread David Truby via cfe-commits
DavidTruby wrote: I don’t personally think that the flang driver should ever attempt to link a C++ library of any kind. FWIW while there’s no stdlib option to consider in their case, g++ will never auto link the gfortran runtimes and gfortran will never auto link libstdc++ Mixed C++/Fortran p

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-16 Thread Peilin Ye via cfe-commits
https://github.com/peilin-ye edited https://github.com/llvm/llvm-project/pull/108636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread A. Wilcox via cfe-commits
awilfox wrote: > Btw, if you submit a fix, it would be great if it could be backported to the > 18 and 19 branches. I think the 18 branch may already be closed. This is what we are shipping in Adélie for 18: [big-endian-32.patch](https://github.com/user-attachments/files/17404400/big-endian-

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Jessica Clarke via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-16 Thread Peilin Ye via cfe-commits
https://github.com/peilin-ye updated https://github.com/llvm/llvm-project/pull/108636 >From 32cc1b238ddd67a96627a1cc57c1b9ca5c6be938 Mon Sep 17 00:00:00 2001 From: Peilin Ye Date: Sat, 5 Oct 2024 06:44:21 + Subject: [PATCH 1/3] [BPF] Rename isST*() and isLD*() functions in BPFMISimplifyPat

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Richard Smith via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
hekota wrote: > If there's no test coverage that exercises this case then it might be better > to remove the if guard so that it doesn't accidentally mask some other > problem we weren't expecting. The `if (!DBI)` case gets hit when parsing line 112 here where the user defined type `Eg12` has

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/111995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/111995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Chuanqi Xu via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread John McCall via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [Clang][SYCL] Introduce clang-sycl-linker to link SYCL offloading device code (Part 1 of many) (PR #112245)

2024-10-16 Thread Arvind Sudarsanam via cfe-commits
https://github.com/asudarsa edited https://github.com/llvm/llvm-project/pull/112245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/111995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Jessica Clarke via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Chuanqi Xu via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [llvm] [ARM] Fix -mno-omit-leaf-frame-pointer flag doesn't works on 32-bit ARM (PR #109628)

2024-10-16 Thread via cfe-commits
@@ -125,6 +125,11 @@ Changes to the ARM Backend the required alignment space with a sequence of `0x0` bytes (the requested fill value) rather than NOPs. +* The default behavior for frame pointers in leaf functions has been updated. When + `-fno-omit-frame-pointer` is spe

[clang] [llvm] [ARM] Fix -mno-omit-leaf-frame-pointer flag doesn't works on 32-bit ARM (PR #109628)

2024-10-16 Thread via cfe-commits
@@ -548,6 +548,11 @@ Miscellaneous Clang Crashes Fixed - Fixed internal assertion firing when a declaration in the implicit global module is found through ADL. (GH#109879) +Leaf Functions Do Not Retain FP Bug Fixed +^ + +- Fixed ``-fno

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > Can we remove `getAddressOfPointer` instead?. Where is it being used? > > > > > > It is used in `VarDecl::getInitAddress()` in Decl.cpp. It looks like it is > > used indirectly by the StmtIterator > > And that in turn is used in `StmtIterator`, and indeed we can end up

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Richard Smith via cfe-commits
zygoloid wrote: > > Can we remove `getAddressOfPointer` instead?. Where is it being used? > > It is used in `VarDecl::getInitAddress()` in Decl.cpp. It looks like it is > used indirectly by the StmtIterator And that in turn is used in `StmtIterator`, and indeed we can end up *storing through*

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-10-16 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > @dmpolukhin I am still confusing about the problem. I mean, why your > > previous patch will break the reproducer and why this patch can "fix" it? I > > feel the current patch is somewhat workaround. It's not your fault. The > > original codes are somewhat tricky already.

[clang] [clang-format] convert path to Windows path if user is using a MSYS2 shell (PR #111526)

2024-10-16 Thread Gary Wang via cfe-commits
BLumia wrote: @mydeveloperday any update on this? Do I still need to create a new issue in this repo or provide any additional information? https://github.com/llvm/llvm-project/pull/111526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

2024-10-16 Thread Phoebe Wang via cfe-commits
@@ -6,13 +6,23 @@ #include +#if defined(__cplusplus) && (__cplusplus >= 201103L) +constexpr bool match_m128(__m128 v, float x, float y, float z, float w) { + return v[0] == x && v[1] == y && v[2] == z && v[3] == w; phoebewang wrote: Can we templatize it to

[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

2024-10-16 Thread Phoebe Wang via cfe-commits
@@ -6,13 +6,23 @@ #include +#if defined(__cplusplus) && (__cplusplus >= 201103L) +constexpr bool match_m128(__m128 v, float x, float y, float z, float w) { + return v[0] == x && v[1] == y && v[2] == z && v[3] == w; +} +#define TEST_CONSTEXPR(...) static_assert(__VA_ARGS__)

[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

2024-10-16 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang edited https://github.com/llvm/llvm-project/pull/112578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

2024-10-16 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. I like the idea to put them together, but I'm not expert in C++. It'd be good if someone familiar with C++ takes another look. https://github.com/llvm/llvm-project/pull/112578 ___ cfe-commits m

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Jan Voung (jvoung) Changes Treat calls to zero-param const methods as having stable return values (with a cache) to address issue #58510. The cache is invalidated when non-const methods are called. This uses the infrastructure from PR

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Voung (jvoung) Changes Treat calls to zero-param const methods as having stable return values (with a cache) to address issue #58510. The cache is invalidated when non-const methods are called. This uses the infrastructure from PR #1110

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Jan Voung (jvoung) Changes Treat calls to zero-param const methods as having stable return values (with a cache) to address issue #58510. The cache is invalidated when non-const methods are called. This uses the infrastructure from

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung updated https://github.com/llvm/llvm-project/pull/112605 >From 57a913c8870b338fa127f323be65fda972d65a96 Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Wed, 16 Oct 2024 19:38:45 + Subject: [PATCH 1/2] [clang][dataflow] Cache accessors for bugprone-unchecked-optiona

[clang] [clang-tools-extra] [clang][dataflow] Cache accessors for bugprone-unchecked-optional-access (PR #112605)

2024-10-16 Thread Jan Voung via cfe-commits
https://github.com/jvoung ready_for_review https://github.com/llvm/llvm-project/pull/112605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-10-16 Thread Yihe Li via cfe-commits
Mick235711 wrote: Release note added. Incidentally, this also fixes an inconsistency for Clang compared to GCC/MSVC: In the following program ```cpp struct [[nodiscard("Reason 1")]] S {}; [[nodiscard("Reason 2")]] S getS(); int main() { getS(); } ``` My opinion is that the function's attri

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-16 Thread Michael Kruse via cfe-commits
Meinersbur wrote: @DavidTruby So CMake adds `-lFortranRuntime -lFortranDecimal` itself? I did not expect that, usually the flang-new driver would be responsible for that. I found how CMake does it: https://github.com/Kitware/CMake/blob/ee2eadb252708b2401da99b8ccc69d6501c7143f/Modules/CMakeDet

[clang] [NFC][HLSL] Fix test function names (PR #112602)

2024-10-16 Thread Tim Gymnich via cfe-commits
tgymnich wrote: @bob80905 feel free to merge this for me. https://github.com/llvm/llvm-project/pull/112602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread A. Wilcox via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-16 Thread Peilin Ye via cfe-commits
@@ -1205,10 +1298,19 @@ class LOAD32 : LOAD32; +class LOAD_ACQUIREi32 +: LOAD_ACQUIRE; + let Predicates = [BPFHasALU32], DecoderNamespace = "BPFALU32" in { def LDW32 : LOADi32; def LDH32 : LOADi32; def LDB32 : LOADi32; + + let Predicates = [BPFHasLoadAcquire]

[clang] [WIP][Wunsafe-buffer-usage] False positives for & expression indexing constant size array (arr[anything & 0]) (PR #112284)

2024-10-16 Thread Artem Dergachev via cfe-commits
@@ -427,6 +427,48 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { //- e. g. "Try harder to find a NamedDecl to point at in the note." //already duplicated // - call both from Sema and from here + std::function + SafeMaskedAccess; + unsigned int

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-16 Thread Peilin Ye via cfe-commits
https://github.com/peilin-ye updated https://github.com/llvm/llvm-project/pull/108636 >From fda5dadf6af584fab9eef9fa588efe5454a9d1d1 Mon Sep 17 00:00:00 2001 From: Peilin Ye Date: Sat, 5 Oct 2024 06:44:21 + Subject: [PATCH 1/3] [BPF] Rename isST*() and isLD*() functions in BPFMISimplifyPat

[clang] [Clang] Disable use of the counted_by attribute for whole struct pointers (PR #112636)

2024-10-16 Thread Bill Wendling via cfe-commits
https://github.com/bwendling created https://github.com/llvm/llvm-project/pull/112636 The whole struct is specificed in the __bdos. The calculation of the whole size of the structure can be done in two ways: 1) sizeof(struct S) + count * sizeof(typeof(fam)) 2) offsetof(struct S, fam) +

[clang] [Clang] Disable use of the counted_by attribute for whole struct pointers (PR #112636)

2024-10-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Bill Wendling (bwendling) Changes The whole struct is specificed in the __bdos. The calculation of the whole size of the structure can be done in two ways: 1) sizeof(struct S) + count * sizeof(typeof(fam)) 2) offsetof(stru

[clang] [Clang] Disable use of the counted_by attribute for whole struct pointers (PR #112636)

2024-10-16 Thread Bill Wendling via cfe-commits
https://github.com/bwendling edited https://github.com/llvm/llvm-project/pull/112636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -1121,6 +1121,11 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Decls[i]) EmitRuntimeCall(Decls[i]); +if (getLangOpts().HLSL) + if (llvm::Function *ResInitFn = + CGM.getHLSLRuntime().createResourceBindingInitFn())

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

2024-10-16 Thread via cfe-commits
@@ -483,10 +554,109 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, .addDefaultHandleConstructor(S, RC); } +BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context, + SourceLocation NameLoc, +

[clang] [AArch64][Clang][NEON] Remove undefined vcmla intrinsics (PR #112575)

2024-10-16 Thread via cfe-commits
https://github.com/SpencerAbson edited https://github.com/llvm/llvm-project/pull/112575 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   >