[clang] [clang-format] Handle C++ Core Guidelines suppression tags (PR #86458)

2024-03-26 Thread Owen Pan via cfe-commits
@@ -4827,6 +4827,10 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine , Right.is(TT_TemplateOpener)) { return true; } +if (Left.is(tok::identifier) && Right.is(tok::numeric_constant) && +Right.TokenText[0] == '.') {

[clang] [llvm] [InstallAPI] Add *umbrella-header options (PR #86587)

2024-03-26 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida updated https://github.com/llvm/llvm-project/pull/86587 >From 9b25b0486d8f3c8409ee199a9f4695da7780e6cb Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Mon, 25 Mar 2024 17:12:14 -0400 Subject: [PATCH 1/3] [InstallAPI] Add *umbrella-header options Umbrella

[clang] [HLSL] enforce unsigned types for reversebits (PR #86720)

2024-03-26 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl updated https://github.com/llvm/llvm-project/pull/86720 >From 0535f804c10c2c1a089a4c3c061d39b01f0ac0ee Mon Sep 17 00:00:00 2001 From: Farzon Lotfi Date: Tue, 26 Mar 2024 15:15:03 -0400 Subject: [PATCH] [HLSL] enforce unsigned types for reversebits fixes #86719

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-26 Thread Ian Anderson via cfe-commits
ian-twilightcoder wrote: > I'm checking with the C and C++ Compatibility study group (SG22) for what's > expected here. Prior to adding `__need_unreachable` in LLVM 18, clang would never declare `unreachable()` in C++ mode, but would defer to the C++ library to do that. I think we should

[clang] [Clang][Sema] Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-26 Thread Kees Cook via cfe-commits
@@ -271,6 +271,9 @@ Improvements to Clang's diagnostics - Clang now correctly diagnoses no arguments to a variadic macro parameter as a C23/C++20 extension. Fixes #GH84495. +- ``-Wmicrosoft`` or ``-Wgnu`` is now required to diagnose C99 flexible + array members in a union

[clang] [NFC][CLANG] Fix null pointer dereferences (PR #86760)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (smanna12) Changes This patch replaces getAs with castAs to resolve potential static analyzer bugs for 1. Dereferencing Proto1-param_type_begin(), which is known to be nullptr 2. Dereferencing Proto2-param_type_begin(), which is

[clang] [NFC][CLANG] Fix null pointer dereferences (PR #86760)

2024-03-26 Thread via cfe-commits
https://github.com/smanna12 created https://github.com/llvm/llvm-project/pull/86760 This patch replaces getAs<> with castAs<> to resolve potential static analyzer bugs for 1. Dereferencing Proto1->param_type_begin(), which is known to be nullptr 2. Dereferencing Proto2->param_type_begin(),

[clang] [clang][ExtractAPI] improve template argument name deduction (PR #77716)

2024-03-26 Thread Erick Velez via cfe-commits
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/77716 >From f0f25f2eb4f654c9a9f04c92deea9df2da6fc64c Mon Sep 17 00:00:00 2001 From: Erick Velez Date: Wed, 10 Jan 2024 18:28:19 -0800 Subject: [PATCH] [clang][ExtractAPI] improve template argument name deduction The

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > ah I see. I feel like this should be a more principled approach that other > sanitizers also share, as you've mentioned as an alternative. do people not > care about other sanitizers in production? Actually Asan should not exhibit this behavior, by some lack it does not

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #86759)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-powerpc Author: None (smanna12) Changes This patch replaces dyn_cast with cast to resolve potential static analyzer bugs for 1. Dereferencing a pointer issue with nullptr GVar when calling addAttribute() in

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #86759)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: None (smanna12) Changes This patch replaces dyn_cast with cast to resolve potential static analyzer bugs for 1. Dereferencing a pointer issue with nullptr GVar when calling addAttribute() in

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #86759)

2024-03-26 Thread via cfe-commits
https://github.com/smanna12 created https://github.com/llvm/llvm-project/pull/86759 This patch replaces dyn_cast<> with cast<> to resolve potential static analyzer bugs for 1. Dereferencing a pointer issue with nullptr GVar when calling addAttribute() in

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + (void)__builtin_clzg(0U, increment(x)); overmighty wrote:

[clang] [Clang][Sema] Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-26 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM The one thing I'm worried about here is the possibility that a future C standard version standardizes a similar extension, but with different semantics (since we're not using any reserved keywords here). Like I mentioned

[clang] clang: __builtin_VARIABLE_NAME (PR #86756)

2024-03-26 Thread Jon Roelofs via cfe-commits
jroelofs wrote: Here's an example of the awkward lengths Halide has to go through to do this without compiler support: https://github.com/halide/Halide/blob/a132246ced07adc59c7b3631009464e5a14e0abb/src/Introspection.h#L19-L23 https://github.com/llvm/llvm-project/pull/86756

[clang] clang: __builtin_VARIABLE_NAME (PR #86756)

2024-03-26 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 1949f7d6c9bd59172c01c7933e1c558797c47eac dc4a313b793b4215c8a68bea0b4b8e70f8a7806b --

[clang] clang: __builtin_VARIABLE_NAME (PR #86756)

2024-03-26 Thread Jon Roelofs via cfe-commits
@@ -2305,6 +2308,36 @@ APValue SourceLocExpr::EvaluateInContext(const ASTContext , }; switch (getIdentKind()) { + case SourceLocIdentKind::VariableName: { +// __builtin_VARIABLE_NAME() is a Clang-specific extension that expands to +// the name of the variable

[clang] clang: __builtin_VARIABLE_NAME (PR #86756)

2024-03-26 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs created https://github.com/llvm/llvm-project/pull/86756 Some C++ Embedded DSLs make use of `std::source_location` as a form of crude reflection. Until now, they didn't have a great way to reflect variable names into their IRs. With `__buitlin_SOURCE_LOCATION()`,

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/86742 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] Add numerical sanitizer (PR #85916)

2024-03-26 Thread Alexander Shaposhnikov via cfe-commits
alexander-shaposhnikov wrote: @vitalybuka , @arsenm - thanks a lot, yeah, sure, I can split the patch. P.S. will update/address comments soon. https://github.com/llvm/llvm-project/pull/85916 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [InstallAPI] Add *umbrella-header options (PR #86587)

2024-03-26 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida edited https://github.com/llvm/llvm-project/pull/86587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Introduce -fmodules-reduced-bmi (PR #85050)

2024-03-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > @iains @dwblaikie Understood. And I thought the major problem is that > > > > there are a lot flags from clang modules. And it is indeed confusing. > > > > But given we have to introduce new flags in this case, probably we can > > > > only try to make it more clear

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-26 Thread Chuanqi Xu via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [HLSL] Add validation for the -enable-16bit-types option (PR #85340)

2024-03-26 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/85340 >From 74a869a282d532ec426dbc1c954779ec2972aa5c Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 14 Mar 2024 17:04:12 -0700 Subject: [PATCH 01/20] add test --- .../clang/Basic/DiagnosticDriverKinds.td

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: ah I see. I feel like this should be a more principled approach that other sanitizers also share, as you've mentioned as an alternative. do people not care about other sanitizers in production? (I'm going to be OOO for a week, so someone else will need to review)

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka converted_to_draft https://github.com/llvm/llvm-project/pull/86739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Looked into IR and HWASAN instrument stuff which it should not https://godbolt.org/z/MnYs75Meq Should be easy to fix. https://github.com/llvm/llvm-project/pull/86739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [RISCV] Disallow target attribute use in multiversioning (PR #85899)

2024-03-26 Thread Kito Cheng via cfe-commits
kito-cheng wrote: Add a testcase like AArch64 https://reviews.llvm.org/D150867 ? https://github.com/llvm/llvm-project/pull/85899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] AMDGPU: Simplify EmitAMDGPUBuiltinExpr for load transposes, NFC (PR #86707)

2024-03-26 Thread Changpeng Fang via cfe-commits
https://github.com/changpeng closed https://github.com/llvm/llvm-project/pull/86707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] d023995 - AMDGPU: Simplify EmitAMDGPUBuiltinExpr for load transposes, NFC (#86707)

2024-03-26 Thread via cfe-commits
Author: Changpeng Fang Date: 2024-03-26T17:51:03-07:00 New Revision: d023995ae2cc6ab968ec305ea7b6f11b6ac2e78f URL: https://github.com/llvm/llvm-project/commit/d023995ae2cc6ab968ec305ea7b6f11b6ac2e78f DIFF:

[clang] [RISCV] Disallow target attribute use in multiversioning (PR #85899)

2024-03-26 Thread Piyou Chen via cfe-commits
BeMg wrote: The proposal could be found here https://github.com/riscv-non-isa/riscv-c-api-doc/pull/48. https://github.com/llvm/llvm-project/pull/85899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [RISCV] Disallow target attribute use in multiversioning (PR #85899)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Piyou Chen (BeMg) Changes For RISC-V target only `target_clones` and `target_version` can enable function multiversion(FMV). This patch make target attribute trigger redefinition instead of emit FMV. --- Full diff:

[clang] [RISCV] Disallow target attribute use in multiversioning (PR #85899)

2024-03-26 Thread Piyou Chen via cfe-commits
https://github.com/BeMg ready_for_review https://github.com/llvm/llvm-project/pull/85899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi][CodeGen] Call SetLLVMFunctionAttributes{, ForDefinition} on __cf… (PR #78253)

2024-03-26 Thread Pavel Kosov via cfe-commits
kpdev wrote: > LGTM, do you need someone to land this on your behalf? Thank you, Aaron. Commit landed https://github.com/llvm/llvm-project/pull/78253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-26 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder updated https://github.com/llvm/llvm-project/pull/86748 >From e67c757c7cdd1837008e573295e87e3ebec5382d Mon Sep 17 00:00:00 2001 From: Ian Anderson Date: Tue, 26 Mar 2024 16:19:38 -0700 Subject: [PATCH] [Headers] Don't declare unreachable() from stddef.h in

[clang] [cfi][CodeGen] Call SetLLVMFunctionAttributes{, ForDefinition} on __cf… (PR #78253)

2024-03-26 Thread Pavel Kosov via cfe-commits
https://github.com/kpdev closed https://github.com/llvm/llvm-project/pull/78253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 373d875 - [cfi][CodeGen] Call SetLLVMFunctionAttributes{,ForDefinition} on __cf… (#78253)

2024-03-26 Thread via cfe-commits
Author: Pavel Kosov Date: 2024-03-27T03:25:33+03:00 New Revision: 373d8755140df0c760e9c292c5f88479cdda6f4c URL: https://github.com/llvm/llvm-project/commit/373d8755140df0c760e9c292c5f88479cdda6f4c DIFF: https://github.com/llvm/llvm-project/commit/373d8755140df0c760e9c292c5f88479cdda6f4c.diff

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-26 Thread Michael Spencer via cfe-commits
Bigcheese wrote: I'm checking with the C and C++ Compatibility study group (SG22) for what's expected here. https://github.com/llvm/llvm-project/pull/86748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

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

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-03-26 Thread Jun Wang via cfe-commits
@@ -2326,6 +2326,20 @@ bool SIInsertWaitcnts::insertWaitcntInBlock(MachineFunction , } #endif +if (ST->isPreciseMemoryEnabled() && Inst.mayLoadOrStore()) { + AMDGPU::Waitcnt Wait; + if (ST->hasExtendedWaitCounts()) +Wait = AMDGPU::Waitcnt(0, 0, 0,

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-03-26 Thread Jun Wang via cfe-commits
@@ -2326,6 +2326,20 @@ bool SIInsertWaitcnts::insertWaitcntInBlock(MachineFunction , } #endif +if (ST->isPreciseMemoryEnabled()) { + AMDGPU::Waitcnt Wait; + if (WCG == ) +Wait = AMDGPU::Waitcnt(0, 0, 0, 0); jwanggit86 wrote: The

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-03-26 Thread Jun Wang via cfe-commits
@@ -0,0 +1,577 @@ +; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX9 +; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX90A +; RUN: llc -mtriple=amdgcn -mcpu=gfx1010

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-03-26 Thread Jun Wang via cfe-commits
@@ -0,0 +1,577 @@ +; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX9 +; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX90A +; RUN: llc -mtriple=amdgcn -mcpu=gfx1010

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-03-26 Thread Jun Wang via cfe-commits
@@ -0,0 +1,577 @@ +; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX9 +; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX90A +; RUN: llc -mtriple=amdgcn -mcpu=gfx1010

[clang] [HLSL] Add validation for the -enable-16bit-types option (PR #85340)

2024-03-26 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/85340 >From 74a869a282d532ec426dbc1c954779ec2972aa5c Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 14 Mar 2024 17:04:12 -0700 Subject: [PATCH 01/19] add test --- .../clang/Basic/DiagnosticDriverKinds.td

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > I think I'm still confused on exactly what the use case is and why we can't > just ask the user to not specify hwasan in the PGO instrumented build. Just > for user convenience? Or does clang change the emitted IR when hwasan is > enabled? And that's what will lead to

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-26 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder edited https://github.com/llvm/llvm-project/pull/86748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add validation for the -enable-16bit-types option (PR #85340)

2024-03-26 Thread Chris B via cfe-commits
@@ -753,7 +753,10 @@ def err_drv_hlsl_unsupported_target : Error< "HLSL code generation is unsupported for target '%0'">; def err_drv_hlsl_bad_shader_required_in_target : Error< "%select{shader model|Vulkan environment|shader stage}0 is required as

[clang] [HLSL] Add validation for the -enable-16bit-types option (PR #85340)

2024-03-26 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/85340 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add validation for the -enable-16bit-types option (PR #85340)

2024-03-26 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: One nit, but otherwise looks good. https://github.com/llvm/llvm-project/pull/85340 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-clang Author: Ian Anderson (ian-twilightcoder) Changes Even if __need_unreachable is set, stddef.h should not declare unreachable() in C++ because it conflicts with the declaration in utility. --- Full diff:

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-26 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder created https://github.com/llvm/llvm-project/pull/86748 Even if __need_unreachable is set, stddef.h should not declare unreachable() in C++ because it conflicts with the declaration in . >From bfa16401ee26425492ce52daabe4144ea70da973 Mon Sep 17 00:00:00

[clang] [clang][ExtractAPI] improve template argument name deduction (PR #77716)

2024-03-26 Thread Erick Velez via cfe-commits
@@ -1127,7 +1096,7 @@ DeclarationFragmentsBuilder::getFragmentsForVarTemplatePartialSpecialization( .append("<", DeclarationFragments::FragmentKind::Text) .append(getFragmentsForTemplateArguments( Decl->getTemplateArgs().asArray(), Decl->getASTContext(),

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-26 Thread Ameer J via cfe-commits
https://github.com/ameerj updated https://github.com/llvm/llvm-project/pull/84988 >From 0d0868ddffe1b0668a57c10cc89614ab7c840634 Mon Sep 17 00:00:00 2001 From: ameerj Date: Sat, 16 Mar 2024 17:03:47 -0400 Subject: [PATCH 1/3] [clang-format] Add BreakFunctionDefinitionParameters option ---

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: > We already have similar stuff: > > ``` > if (PGOOpt && Phase != ThinOrFullLTOPhase::ThinLTOPostLink && > !PGOOpt->MemoryProfile.empty()) > MPM.addPass(MemProfUsePass(PGOOpt->MemoryProfile, PGOOpt->FS)); > ``` checking for ThinLTO pre/post link is a correctness thing

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread via cfe-commits
https://github.com/overmighty updated https://github.com/llvm/llvm-project/pull/86742 >From c615f656153fcb1d4158548660f87d1d69960864 Mon Sep 17 00:00:00 2001 From: OverMighty Date: Tue, 26 Mar 2024 21:25:59 + Subject: [PATCH 1/2] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg}

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x)); + return x; +}

[clang] [clang] require template arg list after template kw (PR #80801)

2024-03-26 Thread Erick Velez via cfe-commits
evelez7 wrote: ping https://github.com/llvm/llvm-project/pull/80801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] AMDGPU: Simplify EmitAMDGPUBuiltinExpr for load transposes, NFC (PR #86707)

2024-03-26 Thread Sirish Pande via cfe-commits
https://github.com/srpande approved this pull request. It's a good change. https://github.com/llvm/llvm-project/pull/86707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x)); + return x; +}

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread Richard Smith via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x)); + return x; +}

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-26 Thread Yuxuan Chen via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Alternative is we need a new clang fronted flag to control this behavior. Assuming that this is rather strange use case, I'd prefer to land the patch and introduce new flag only when we have request for that case. https://github.com/llvm/llvm-project/pull/86739

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: We already have similar stuff: ``` if (PGOOpt && Phase != ThinOrFullLTOPhase::ThinLTOPostLink && !PGOOpt->MemoryProfile.empty()) MPM.addPass(MemProfUsePass(PGOOpt->MemoryProfile, PGOOpt->FS)); ``` https://github.com/llvm/llvm-project/pull/86739

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > > why can't hwasan and PGO instrumentation coexist? > > > > > > They can, but binary is like 5x times slower, on top of 10x slowdown of PGO > > instrumentation. (don't quote me on these numbers, they are from large but > > single benchmark, still it's very slow) > > If

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x)); + return x; +}

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread Nick Desaulniers via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +constexpr int increment(int& x) { + x++; + return x; +} + +constexpr int test_clzg_0() { + int x = 0; + [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x)); + return x; +}

[clang] [compiler-rt] [llvm] [InstrFDO][TypeProf] Implement binary instrumentation and profile read/write (PR #66825)

2024-03-26 Thread Snehasish Kumar via cfe-commits
https://github.com/snehasish edited https://github.com/llvm/llvm-project/pull/66825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [InstrFDO][TypeProf] Implement binary instrumentation and profile read/write (PR #66825)

2024-03-26 Thread Snehasish Kumar via cfe-commits
@@ -560,6 +602,28 @@ Error InstrProfSymtab::addFuncWithName(Function , StringRef PGOFuncName) { return Error::success(); } +uint64_t InstrProfSymtab::getVTableHashFromAddress(uint64_t Address) { + finalizeSymtab(); snehasish wrote: Summarizing offline

[clang] [compiler-rt] [llvm] [InstrFDO][TypeProf] Implement binary instrumentation and profile read/write (PR #66825)

2024-03-26 Thread Snehasish Kumar via cfe-commits
https://github.com/snehasish commented: Responses to a couple of other comments - > * For LLVM IR test coverage, store textual profiles in the repo, and run > `llvm-profdata merge` to convert it to indexed profiles. > * To have test coverage on raw profiles (generate raw profiles or convert

[clang] [Clang][Sema] Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-26 Thread Harald van Dijk via cfe-commits
@@ -271,6 +271,9 @@ Improvements to Clang's diagnostics - Clang now correctly diagnoses no arguments to a variadic macro parameter as a C23/C++20 extension. Fixes #GH84495. +- ``-Wmicrosoft`` or ``-Wgnu`` is now required to diagnose C99 flexible + array members in a union

[clang] [Clang][Sema] Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-26 Thread Harald van Dijk via cfe-commits
https://github.com/hvdijk approved this pull request. Looks good to me, thanks, aside from one typo in the release notes. Let me pre-emptively mark this as approved. Just to confirm, the warnings are also enabled by `-pedantic`? Is that worth mentioning in the release notes too? I'm fine if

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: > > why can't hwasan and PGO instrumentation coexist? > > They can, but binary is like 5x times slower, on top of 10x slowdown of PGO > instrumentation. (don't quote me on these numbers, they are from large but > single benchmark, still it's very slow) > If it's usable as a

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread via cfe-commits
@@ -12425,12 +12430,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, if (!EvaluateInteger(E->getArg(0), Val, Info)) return false; +std::optional Fallback; +if (BuiltinOp == Builtin::BI__builtin_ctzg && E->getNumArgs() > 1) { +

[clang] Fix buildbot failure. (PR #86741)

2024-03-26 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata approved this pull request. LGTM. Thanks! https://github.com/llvm/llvm-project/pull/86741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: OverMighty (overmighty) Changes See https://github.com/llvm/llvm-project/pull/86577#discussion_r1540069558. cc @efriedma-quic @nickdesaulniers --- Full diff: https://github.com/llvm/llvm-project/pull/86742.diff 2 Files Affected: -

[clang] [clang][ExprConst] Fix second arg of __builtin_{clzg,ctzg} not always being evaluated (PR #86742)

2024-03-26 Thread via cfe-commits
https://github.com/overmighty created https://github.com/llvm/llvm-project/pull/86742 See https://github.com/llvm/llvm-project/pull/86577#discussion_r1540069558. cc @efriedma-quic @nickdesaulniers >From c615f656153fcb1d4158548660f87d1d69960864 Mon Sep 17 00:00:00 2001 From: OverMighty Date:

[clang] Fix buildbot failure. (PR #86741)

2024-03-26 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: Tagging @amy-kwan and @kazutakahirata . Hopefully this will fix the issue. https://github.com/llvm/llvm-project/pull/86741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Fix buildbot failure. (PR #86741)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Zahira Ammarguellat (zahiraam) Changes https://lab.llvm.org/buildbot/#/builders/36/builds/43998/steps/12/logs/stdio --- Full diff: https://github.com/llvm/llvm-project/pull/86741.diff 1 Files Affected: - (modified)

[clang] Fix buildbot failure. (PR #86741)

2024-03-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/86741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix buildbot failure. (PR #86741)

2024-03-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/86741 https://lab.llvm.org/buildbot/#/builders/36/builds/43998/steps/12/logs/stdio >From 8d113344d0742f80bc967019131c9111a0db78ff Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 26 Mar 2024 14:21:16

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > why can't hwasan and PGO instrumentation coexist? They can, but binary is like 5x times slower, on top of 10x slowdown of PGO instrumentation. > > and this seems like it should be an error at the clang driver level, instead > of silently turning off one of the requested

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/86739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] AMDGPU: Simplify EmitAMDGPUBuiltinExpr for load transposes, NFC (PR #86707)

2024-03-26 Thread Changpeng Fang via cfe-commits
https://github.com/changpeng updated https://github.com/llvm/llvm-project/pull/86707 >From 485dff66813104ad73d8eada7cd7d43edf9d093d Mon Sep 17 00:00:00 2001 From: Changpeng Fang Date: Tue, 26 Mar 2024 11:06:48 -0700 Subject: [PATCH 1/3] AMDGPU: Simplify EmitAMDGPUBuiltinExpr for load

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: why can't hwasan and PGO instrumentation coexist? and this seems like it should be an error at the clang driver level, instead of silently turning off one of the requested features https://github.com/llvm/llvm-project/pull/86739 ___

[clang-tools-extra] 80487e1 - [clang-tidy][NFC] Reorder entrys in release notes

2024-03-26 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-03-26T21:10:06Z New Revision: 80487e1c622d51f4c0df12b64cca8a0b346e9b85 URL: https://github.com/llvm/llvm-project/commit/80487e1c622d51f4c0df12b64cca8a0b346e9b85 DIFF: https://github.com/llvm/llvm-project/commit/80487e1c622d51f4c0df12b64cca8a0b346e9b85.diff LOG:

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/86739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Vitaly Buka (vitalybuka) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/86739.diff 3 Files Affected: - (modified) clang/lib/CodeGen/BackendUtil.cpp (+10-4) - (modified) clang/test/CodeGen/asan-new-pm.ll

[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

2024-03-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/86739 None >From 7e20d811d86854d4bea6282245c9aca51c8968c5 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 26 Mar 2024 14:07:07 -0700 Subject: [PATCH]

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-26 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/85684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-26 Thread Yuxuan Chen via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-26 Thread Yuxuan Chen via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [clang-repl] Add call to 'InitializeAllAsmParsers' (PR #86727)

2024-03-26 Thread Andrew V. Teylu via cfe-commits
aytey wrote: ```avj@host /tmp/clang_build$ ./bin/llvm-lit -v /tmp/llvm-project/clang/test/Interpreter/inline-asm.cpp llvm-lit: /tmp/llvm-project/llvm/utils/lit/lit/llvm/config.py:502: note: using clang: /tmp/clang_build/bin/clang -- Testing: 1 tests, 1 workers -- PASS: Clang ::

[clang] [clang-repl] Add call to 'InitializeAllAsmParsers' (PR #86727)

2024-03-26 Thread Andrew V. Teylu via cfe-commits
https://github.com/aytey updated https://github.com/llvm/llvm-project/pull/86727 >From 784dd45324566775439b3c06674ab7d70b292d0b Mon Sep 17 00:00:00 2001 From: "Andrew V. Teylu" Date: Tue, 26 Mar 2024 20:10:24 + Subject: [PATCH 1/2] [clang-repl] Add call to 'InitializeAllAsmParsers'

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-26 Thread via cfe-commits
@@ -12354,21 +12354,31 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, case Builtin::BI__builtin_clzl: case Builtin::BI__builtin_clzll: case Builtin::BI__builtin_clzs: + case Builtin::BI__builtin_clzg: case Builtin::BI__lzcnt16: // Microsoft

[clang] [clang-repl] Add call to 'InitializeAllAsmParsers' (PR #86727)

2024-03-26 Thread Andrew V. Teylu via cfe-commits
aytey wrote: > This my first PR against LLVM; does something like this need tests? I'm 100% > happy to add tests for this, but are there some examples of "good" > `clang-repl` tests I can learn from/extend from? Maybe this is reasonable: ```cpp // REQUIRES: host-supports-jit, x86_64-linux //

[clang] [clang] Implement constexpr support for __builtin_{clzg, ctzg} (PR #86577)

2024-03-26 Thread Eli Friedman via cfe-commits
@@ -12354,21 +12354,31 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, case Builtin::BI__builtin_clzl: case Builtin::BI__builtin_clzll: case Builtin::BI__builtin_clzs: + case Builtin::BI__builtin_clzg: case Builtin::BI__lzcnt16: // Microsoft

[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

2024-03-26 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Adding attributes to types as type sugar (not part of the canonical type) is generally problematic: non-canonical types are not reliably preserved throughout the compiler, particularly in cases involving templates. Can we use a type qualifier here?

[clang] [HLSL] enforce unsigned types for reversebits (PR #86720)

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

[clang] Fix printing of templated records. (PR #86339)

2024-03-26 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: oh! I think I know what the issue is. I have a fix for it. PR following up. https://github.com/llvm/llvm-project/pull/86339 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

  1   2   3   4   5   >