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

2024-02-05 Thread Pierre van Houtryve via cfe-commits
@@ -605,12 +606,197 @@ class SIGfx12CacheControl : public SIGfx11CacheControl { bool IsNonTemporal) const override; }; +class SIPreciseMemorySupport { +protected: + const GCNSubtarget + const SIInstrInfo *TII = nullptr; + + IsaVersion

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

2024-02-05 Thread Pierre van Houtryve via cfe-commits
@@ -605,12 +606,197 @@ class SIGfx12CacheControl : public SIGfx11CacheControl { bool IsNonTemporal) const override; }; +class SIPreciseMemorySupport { +protected: + const GCNSubtarget + const SIInstrInfo *TII = nullptr; + + IsaVersion

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

2024-02-05 Thread Pierre van Houtryve via cfe-commits
@@ -167,6 +167,10 @@ def FeatureCuMode : SubtargetFeature<"cumode", "Enable CU wavefront execution mode" >; +def FeaturePreciseMemory Pierre-vh wrote: Understood :) Can you remove the `amdgpu` prefix from the option? All target features are already

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

2024-02-05 Thread Pierre van Houtryve via cfe-commits
@@ -0,0 +1,362 @@ +; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+amdgpu-precise-memory-op < %s | FileCheck %s -check-prefixes=GFX9 +; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -mattr=+amdgpu-precise-memory-op < %s | FileCheck %s -check-prefixes=GFX90A +; RUN: llc -mtriple=amdgcn

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

2024-02-05 Thread Pierre van Houtryve via cfe-commits
@@ -605,12 +606,197 @@ class SIGfx12CacheControl : public SIGfx11CacheControl { bool IsNonTemporal) const override; }; +class SIPreciseMemorySupport { Pierre-vh wrote: Why does it need to be a separate class hierarchy?

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

2024-02-05 Thread Pierre van Houtryve via cfe-commits
https://github.com/Pierre-vh requested changes to this pull request. When you made changes, you can click the "Re-request review" icon next to reviewers to put it back in the review queues :) https://github.com/llvm/llvm-project/pull/79236 ___

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

2024-02-05 Thread Pierre van Houtryve via cfe-commits
https://github.com/Pierre-vh 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] Diagnose invalid fixed point conversion (PR #80763)

2024-02-05 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek approved this pull request. https://github.com/llvm/llvm-project/pull/80763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] forward clang-tidy's readability-identifier-naming fix to textDocument/rename (PR #78454)

2024-02-05 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Looks pretty good! Are there further changes you're planning to make, or is this ready to graduate from "Draft" status? https://github.com/llvm/llvm-project/pull/78454 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang-tools-extra] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-02-05 Thread David Li via cfe-commits
david-xl wrote: > > > > I don't understand, if you're saying the profile is accurate, then > > > > those functions are actually cold, so we should be able to mark them as > > > > optsize? > > > > > > > > > Accurate is not black or white. The current heuristic requires certain > > > level of

[clang] Diagnose invalid fixed point conversion (PR #80763)

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

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

2024-02-05 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/80802 >From 741793c9584753e6e888c9824961501b676b1143 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Tue, 6 Feb 2024 14:06:40 +0800 Subject: [PATCH] [Clang][Sema] fix crash in codegen stage when an lambda expression

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

2024-02-05 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/80802 >From 6dbd0937e8ded4dd8f71afb876bb3930c309 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Tue, 6 Feb 2024 14:06:40 +0800 Subject: [PATCH] [Clang][Sema] fix crash in codegen stage when an lambda expression

[clang] [clang-tools-extra] [llvm] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2024-02-05 Thread via cfe-commits
shaojingzhi wrote: Hi! I wonder that have you conducted any tests to determine the potential performance increase of this pass in the SPEC2017 557xz benchmark? I attempted to apply it to the xz benchmark, but only one copy(--copies=1) demonstrated a significant increase(about 3%), but there

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qizhi Hu (jcsxky) Changes Try to fix [issue](https://github.com/llvm/llvm-project/issues/76674) When transform a lambda expression which is declared in an unevaluated context, `isInstantiationDependentType()` and

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

2024-02-05 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/80802 Try to fix [issue](https://github.com/llvm/llvm-project/issues/76674) When transform a lambda expression which is declared in an unevaluated context, `isInstantiationDependentType()` and

[clang] [clang-tools-extra] [llvm] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2024-02-05 Thread via cfe-commits
WenleiHe wrote: > > > I don't understand, if you're saying the profile is accurate, then those > > > functions are actually cold, so we should be able to mark them as optsize? > > > > > > Accurate is not black or white. The current heuristic requires certain > > level of accuracy to be

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

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erick Velez (evelez7) Changes Require a template argument list after an identifier prefixed by the template keyword. Introduced by [CWG 96](https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96). Current wording of

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

2024-02-05 Thread Erick Velez via cfe-commits
https://github.com/evelez7 created https://github.com/llvm/llvm-project/pull/80801 Require a template argument list after an identifier prefixed by the template keyword. Introduced by [CWG 96](https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96). Current wording of [temp.names]

[clang] [clang] Add zero-initialization for fixed point types (PR #80781)

2024-02-05 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -ffixed-point -S -emit-llvm %s -o - | FileCheck %s + +// CHECK: @_ZL1a = internal constant [2 x i32] zeroinitializer +constexpr _Accum a[2] = {}; MaskRay wrote: Consider a `test/AST/` test like `static_assert(a[0] == 0 && a[0]

[llvm] [clang] [RISCV] Add Ssqosid support to -march. (PR #80747)

2024-02-05 Thread Yingwei Zheng via cfe-commits
@@ -1612,6 +1613,14 @@ // RUN: -o - | FileCheck --check-prefix=CHECK-SUPM-EXT %s // CHECK-SUPM-EXT: __riscv_supm 8000{{$}} +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_ssqosid1p0 -E -dM %s \ +// RUN: -o - | FileCheck

[llvm] [clang] [RISCV] Add Ssqosid support to -march. (PR #80747)

2024-02-05 Thread Craig Topper via cfe-commits
@@ -1612,6 +1613,14 @@ // RUN: -o - | FileCheck --check-prefix=CHECK-SUPM-EXT %s // CHECK-SUPM-EXT: __riscv_supm 8000{{$}} +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_ssqosid1p0 -E -dM %s \ +// RUN: -o - | FileCheck

[llvm] [clang] [RISCV] Add Ssqosid support to -march. (PR #80747)

2024-02-05 Thread Wang Pengcheng via cfe-commits
@@ -1612,6 +1613,14 @@ // RUN: -o - | FileCheck --check-prefix=CHECK-SUPM-EXT %s // CHECK-SUPM-EXT: __riscv_supm 8000{{$}} +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_ssqosid1p0 -E -dM %s \ +// RUN: -o - | FileCheck

[compiler-rt] [clang] [llvm] [X86] Support APXF to enable __builtin_cpu_supports. (PR #80636)

2024-02-05 Thread Freddy Ye via cfe-commits
@@ -248,10 +248,11 @@ X86_FEATURE_COMPAT(AVXVNNIINT16,"avxvnniint16", 0) X86_FEATURE_COMPAT(SM3, "sm3",0) X86_FEATURE_COMPAT(SHA512, "sha512", 0) X86_FEATURE_COMPAT(SM4, "sm4",

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-05 Thread via cfe-commits
@@ -61,6 +61,7 @@ void testArraySubscripts(int *p, int **pp) { ); int a[10]; // expected-warning{{'a' is an unsafe buffer that does not perform bounds checks}} +// expected-note@-1{{change type of 'a' to 'std::array' to harden it}}

[llvm] [clang] [compiler-rt] [X86] Support APXF to enable __builtin_cpu_supports. (PR #80636)

2024-02-05 Thread Shengchen Kan via cfe-commits
@@ -248,10 +248,11 @@ X86_FEATURE_COMPAT(AVXVNNIINT16,"avxvnniint16", 0) X86_FEATURE_COMPAT(SM3, "sm3",0) X86_FEATURE_COMPAT(SHA512, "sha512", 0) X86_FEATURE_COMPAT(SM4, "sm4",

[clang] [-Wunsafe-buffer-usage] Fix debug notes for unclaimed DREs (PR #80787)

2024-02-05 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 8f80df0f52c4294d23d0510b01be6d6491714058 90e7145fe0133828b4abc16730b9786fc68df8b9 --

[clang] [-Wunsafe-buffer-usage] Fix debug notes for unclaimed DREs (PR #80787)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (jkorous-apple) Changes Debug notes for unclaimed DeclRefExpr should report any DRE of an unsafe variable that is not covered by a Fixable (i. e. fixit for the particular AST pattern isn't implemented for whatever reason). Currently

[clang] [-Wunsafe-buffer-usage] Fix debug notes for unclaimed DREs (PR #80787)

2024-02-05 Thread via cfe-commits
https://github.com/jkorous-apple created https://github.com/llvm/llvm-project/pull/80787 Debug notes for unclaimed DeclRefExpr should report any DRE of an unsafe variable that is not covered by a Fixable (i. e. fixit for the particular AST pattern isn't implemented for whatever reason).

[clang] [clang][Darwin] Remove legacy framework search path logic in the frontend (PR #75841)

2024-02-05 Thread Brad Smith via cfe-commits
brad0 wrote: Ping. https://github.com/llvm/llvm-project/pull/75841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: None (ZijunZhaoCCK) Changes Add isWasm() check for here: https://github.com/llvm/llvm-project/pull/78655#issuecomment-1928075569 --- Full diff: https://github.com/llvm/llvm-project/pull/80783.diff 1 Files Affected: - (modified)

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (ZijunZhaoCCK) Changes Add isWasm() check for here: https://github.com/llvm/llvm-project/pull/78655#issuecomment-1928075569 --- Full diff: https://github.com/llvm/llvm-project/pull/80783.diff 1 Files Affected: - (modified)

[clang] [Driver] Check the environment version except wasm case. (PR #80783)

2024-02-05 Thread via cfe-commits
https://github.com/ZijunZhaoCCK created https://github.com/llvm/llvm-project/pull/80783 Add isWasm() check for here: https://github.com/llvm/llvm-project/pull/78655#issuecomment-1928075569 >From 84506beecc20a064a5c895cf5c04135118da6606 Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Tue, 6

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-05 Thread Alex Hoppen via cfe-commits
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl , Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Result); +

[clang] [clang] Add zero-initialization for fixed point types (PR #80781)

2024-02-05 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 cf401f72e1b5aa6be0719ab45c95c10ea06bec9a 916a10f1cebbb339dec98bd18c945b63991190f1 --

[clang] [clang] Match -isysroot behaviour with system compiler on Darwin (PR #80524)

2024-02-05 Thread Daniel Rodríguez Troitiño via cfe-commits
drodriguez wrote: I agree with Dmitry in that it would be preferred to have the system compiler behaviour until the system compiler actually changes. I have tried again with Xcode 14.3.1 (released almost 1 year ago), which includes `include/c++/v1` side by side with the compiler, and for it,

[clang] [clang] Add zero-initialization for fixed point types (PR #80781)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (PiJoules) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/80781.diff 2 Files Affected: - (modified) clang/lib/AST/ExprConstant.cpp (+4) - (added) clang/test/CodeGenCXX/fixed-point-zero-init.cpp (+9)

[clang-tools-extra] [llvm] [clang] [concepts] Extract function template pack arguments from the current instantiation if possible (PR #80594)

2024-02-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/80594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2c2d291 - [concepts] Extract function template pack arguments from the current instantiation if possible (#80594)

2024-02-05 Thread via cfe-commits
Author: Younan Zhang Date: 2024-02-06T09:59:16+08:00 New Revision: 2c2d291b4568381999442e47fc77f949f19be0bc URL: https://github.com/llvm/llvm-project/commit/2c2d291b4568381999442e47fc77f949f19be0bc DIFF: https://github.com/llvm/llvm-project/commit/2c2d291b4568381999442e47fc77f949f19be0bc.diff

[clang] [clang] Add zero-initialization for fixed point types (PR #80781)

2024-02-05 Thread via cfe-commits
https://github.com/PiJoules created https://github.com/llvm/llvm-project/pull/80781 None >From 916a10f1cebbb339dec98bd18c945b63991190f1 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Mon, 5 Feb 2024 17:58:08 -0800 Subject: [PATCH] [clang] Add zero-initialization for fixed point types ---

[clang] [WebAssembly] Add tests for generic CPU config (PR #80775)

2024-02-05 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin updated https://github.com/llvm/llvm-project/pull/80775 >From dbb74ca85ef047260a2820f6d470448279ea44f4 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 6 Feb 2024 00:51:40 + Subject: [PATCH 1/2] [WebAssembly] Add tests for generic CPU config This adds tests

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: My thoughts on this in the past have been: 1. target-abi should really be a target-independent thing we record; its meaning depends on the target, but the ABI exists throughout LLVM as a concept regardless of the target 2. module-level target features in general likely should be

[clang] [WebAssembly] Add tests for generic CPU config (PR #80775)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Heejin Ahn (aheejin) Changes This adds tests for `generic` cpu configuration. We had tests for `mvp` and `bleeding-edge` configs but not `generic`. --- Full diff: https://github.com/llvm/llvm-project/pull/80775.diff 2 Files Affected:

[clang] [WebAssembly] Add tests for generic CPU config (PR #80775)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Heejin Ahn (aheejin) Changes This adds tests for `generic` cpu configuration. We had tests for `mvp` and `bleeding-edge` configs but not `generic`. --- Full diff: https://github.com/llvm/llvm-project/pull/80775.diff 2 Files

[clang] [WebAssembly] Add tests for generic CPU config (PR #80775)

2024-02-05 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin created https://github.com/llvm/llvm-project/pull/80775 This adds tests for `generic` cpu configuration. We had tests for `mvp` and `bleeding-edge` configs but not `generic`. >From dbb74ca85ef047260a2820f6d470448279ea44f4 Mon Sep 17 00:00:00 2001 From: Heejin Ahn

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Craig Topper via cfe-commits
topperc wrote: > I'm surprised only 1 test file needed the metadata updated as a result of > this change. Maybe other tests are better about using regexes to hide the numbers? https://github.com/llvm/llvm-project/pull/80760 ___ cfe-commits mailing

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. Thank you for this. I expect this to be a big help w/ the various target features bugs we've seen in LTO builds. I'm surprised only 1 test file needed the metadata updated as a result of this change.

[lld] [clang] [compiler-rt] [libcxx] [clang-tools-extra] [mlir] [llvm] [openmp] [libc] [flang] [lldb] [Driver] Report invalid target triple versions for all environment types. (PR #78655)

2024-02-05 Thread via cfe-commits
ZijunZhaoCCK wrote: > > > There's apparently also wasm32-wasi-preview2 and wasm32-wasi-pthread, > > > which I suppose are equally broken by this change. > > > > > > Yes, I think so. I think adding these environment types in wasi-libc repo > > could help fix those errors. > > If wasm can

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-02-05 Thread Yeoul Na via cfe-commits
rapidsna wrote: > It's generally not a good idea to use sugar to represent constructs that are > semantically significant: anything that uses the canonical type will throw it > away. We try to avoid throwing away sugar in most cases, but we aren't always > successful. > It's possible there

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 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 820f244aa92f11292e59440c9bc5afbdec395b20 c630eee1f930c87d2c461de92271c02de220b290 --

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/80519 >From 6ab5ba3f970eaaea542fbed09cae17d3666df6b3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 3 Feb 2024 00:18:42 + Subject: [PATCH 1/3] wip --- clang/lib/AST/Expr.cpp | 12

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
rnk wrote: > Also in the issue: #80510 you pointed out a crash bug. We should have the bug > covered in the test case as well. I think that is covered by the existing test case, instead of crashing, we now reject with an error. In the future if we want to align with GCC as you suggest, we'll

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
@@ -108,3 +109,22 @@ int computed_with_lambda = [] { return result; }(); #endif + +#if __cplusplus >= 201703L +namespace DynamicFileScopeLiteral { +// This covers the case where we have a file-scope compound literal with a +// non-constant initializer in C++. Previously, we

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/80519 >From 6ab5ba3f970eaaea542fbed09cae17d3666df6b3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 3 Feb 2024 00:18:42 + Subject: [PATCH 1/2] wip --- clang/lib/AST/Expr.cpp | 12

[clang] Fix a crash in clang::isGetterOfRefCounted by checking nullptr in tryToFindPtrOrigin (PR #80768)

2024-02-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/80768 >From f9f11843c2d09775de20d47dc71c5e482a1ff8b4 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 5 Feb 2024 16:07:09 -0800 Subject: [PATCH] Fix a crash in clang::isGetterOfRefCounted by checking nullptr in

[llvm] [clang] [clang] Support per-function [[clang::code_align(N)]] attribute. (PR #80765)

2024-02-05 Thread Anton Bikineev via cfe-commits
https://github.com/AntonBikineev updated https://github.com/llvm/llvm-project/pull/80765 >From 88151098d3087f95d3a5b652309a12fb2e9f757e Mon Sep 17 00:00:00 2001 From: Anton Bikineev Date: Mon, 5 Feb 2024 12:24:17 +0100 Subject: [PATCH] [clang] Support per-function [[clang::code_align(N)]]

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Björn Pettersson via cfe-commits
https://github.com/bjope approved this pull request. LG https://github.com/llvm/llvm-project/pull/80515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix a crash in clang::isGetterOfRefCounted by checking nullptr in tryToFindPtrOrigin (PR #80768)

2024-02-05 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 6ce03ff3fef8fb6fa9afe8eb22c6d98bced26d48 4e10436ddd55f1b1bed2bb99856e1101b9462117 --

[clang] Disable FTZ/DAZ when compiling shared libraries by default. (PR #80475)

2024-02-05 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > > (Sidenote: "dynamic" isn't even > > [documented](https://clang.llvm.org/docs/UsersManual.html#cmdoption-fdenormal-fp-math)). > > It's not a selectable enum of the Clang `-fdenormal-fp-math` flag, but it is > one for the LLVM function attribute `denormal-fp-math`. This

[clang] Fix a crash in clang::isGetterOfRefCounted by checking nullptr in tryToFindPtrOrigin (PR #80768)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ryosuke Niwa (rniwa) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/80768.diff 2 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp (+8-6) - (added)

[clang] Fix a crash in clang::isGetterOfRefCounted by checking nullptr in tryToFindPtrOrigin (PR #80768)

2024-02-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/80768 None >From 4e10436ddd55f1b1bed2bb99856e1101b9462117 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 5 Feb 2024 16:07:09 -0800 Subject: [PATCH] Fix a crash in clang::isGetterOfRefCounted by checking nullptr

[clang] [AMDGPU] Add missing `__builtin_amdgcn_wavefrontsize` builtin (PR #80741)

2024-02-05 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/80741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] dbed898 - [AMDGPU] Add missing `__builtin_amdgcn_wavefrontsize` builtin (#80741)

2024-02-05 Thread via cfe-commits
Author: Joseph Huber Date: 2024-02-05T17:58:19-06:00 New Revision: dbed89814e5b9ba25a349a5b9acf4a7164e33834 URL: https://github.com/llvm/llvm-project/commit/dbed89814e5b9ba25a349a5b9acf4a7164e33834 DIFF: https://github.com/llvm/llvm-project/commit/dbed89814e5b9ba25a349a5b9acf4a7164e33834.diff

[libc] [clang-tools-extra] [openmp] [libcxx] [compiler-rt] [lldb] [mlir] [llvm] [lld] [flang] [clang] [Driver] Report invalid target triple versions for all environment types. (PR #78655)

2024-02-05 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > There's apparently also wasm32-wasi-preview2 and wasm32-wasi-pthread, which > > I suppose are equally broken by this change. > > Yes, I think so. I think adding these environment types in wasi-libc repo > could help fix those errors. If wasm can arbitrary environment

[llvm] [clang] [clang] Support per-function [[clang::code_align(N)]] attribute. (PR #80765)

2024-02-05 Thread Anton Bikineev via cfe-commits
https://github.com/AntonBikineev updated https://github.com/llvm/llvm-project/pull/80765 >From 99d2cc55fb952361b1fe04e2c21dcb5b04f11d47 Mon Sep 17 00:00:00 2001 From: Anton Bikineev Date: Mon, 5 Feb 2024 12:24:17 +0100 Subject: [PATCH] [clang] Support per-function [[clang::code_align(N)]]

[llvm] [clang] [clang] Support per-function [[clang::code_align(N)]] attribute. (PR #80765)

2024-02-05 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 a7bc9cb6ffa91ff0ebabc45c0c7263c7c2c3a4de ff8cf4e87473dec2e3f55114cb92ae5a63d9488c --

[compiler-rt] [mlir] [clang] [libc] [flang] [clang-tools-extra] [lld] [openmp] [lldb] [llvm] [libcxx] [Driver] Report invalid target triple versions for all environment types. (PR #78655)

2024-02-05 Thread Mike Hommey via cfe-commits
glandium wrote: > Yes, I think so. I think adding these environment types in wasi-libc repo > could help fix those errors. WDYM? https://github.com/llvm/llvm-project/pull/78655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [clang] Support per-function [[clang::code_align(N)]] attribute. (PR #80765)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Anton Bikineev (AntonBikineev) Changes The existing attribute works only for loop headers. This can unfortunately be quite limiting, especially as a protection against the "Jump Conditional Code Erratum" [0] (for example, if there

[llvm] [clang] [clang] Support per-function [[clang::code_align(N)]] attribute. (PR #80765)

2024-02-05 Thread Anton Bikineev via cfe-commits
https://github.com/AntonBikineev created https://github.com/llvm/llvm-project/pull/80765 The existing attribute works only for loop headers. This can unfortunately be quite limiting, especially as a protection against the "Jump Conditional Code Erratum" [0] (for example, if there is an

[lld] [flang] [llvm] [clang] [libc] [libcxx] [compiler-rt] [lldb] [clang-tools-extra] [openmp] [mlir] [Driver] Report invalid target triple versions for all environment types. (PR #78655)

2024-02-05 Thread via cfe-commits
ZijunZhaoCCK wrote: > There's apparently also wasm32-wasi-preview2 and wasm32-wasi-pthread, which I > suppose are equally broken by this change. Yes, I think so. I think adding these environment types in wasi-libc repo could help fix those errors.

[clang] Disable FTZ/DAZ when compiling shared libraries by default. (PR #80475)

2024-02-05 Thread Andy Kaylor via cfe-commits
andykaylor wrote: I don't know anything about how non-x86 targets implement DAZ/FTZ, but for x86-based targets, I think trying to make any assumptions about the setting is bound to be wrong. In theory, it's part of the floating-point environment and shouldn't be modified during execution

[clang] Diagnose invalid fixed point conversion (PR #80763)

2024-02-05 Thread via cfe-commits
https://github.com/PiJoules updated https://github.com/llvm/llvm-project/pull/80763 >From 81e2325ee9600e6a41de51fc26963147617f4ad6 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Mon, 5 Feb 2024 15:33:09 -0800 Subject: [PATCH] [Clang] Diagnose improper fixed point conversions in C++ ---

[llvm] [clang] Diagnose invalid fixed point conversion (PR #80763)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-debuginfo Author: None (PiJoules) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/80763.diff 4 Files Affected: - (modified) clang/include/clang/AST/Type.h (+7) - (modified) clang/lib/Sema/SemaOverload.cpp (+4-1) - (modified)

[clang] [llvm] Diagnose invalid fixed point conversion (PR #80763)

2024-02-05 Thread via cfe-commits
https://github.com/PiJoules created https://github.com/llvm/llvm-project/pull/80763 None >From faf74616efab09e59aade180ce44b68e04259e0e Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Mon, 5 Feb 2024 14:55:34 -0800 Subject: [PATCH 1/2] [llvm] Fix assertion error where we didn't check fixed

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
https://github.com/AdamMagierFOSS updated https://github.com/llvm/llvm-project/pull/80515 >From 4e1c37ae83dec050fc9b7aa172db01fa0b2b6d68 Mon Sep 17 00:00:00 2001 From: Adam Magier Date: Sat, 3 Feb 2024 00:38:54 +0100 Subject: [PATCH 1/3] [clang][CodeGen][UBSan] Fixing shift-exponent generation

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
https://github.com/AdamMagierFOSS edited https://github.com/llvm/llvm-project/pull/80515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-05 Thread Reid Kleckner via cfe-commits
@@ -108,3 +109,22 @@ int computed_with_lambda = [] { return result; }(); #endif + +#if __cplusplus >= 201703L +namespace DynamicFileScopeLiteral { +// This covers the case where we have a file-scope compound literal with a +// non-constant initializer in C++. Previously, we

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Craig Topper (topperc) Changes In an LTO build, we don't set the ELF attributes to indicate what extensions were compiled with. The target CPU/Attrs in RISCVTargetMachine do not get set for an LTO build. Each function gets a

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Craig Topper (topperc) Changes In an LTO build, we don't set the ELF attributes to indicate what extensions were compiled with. The target CPU/Attrs in RISCVTargetMachine do not get set for an LTO

[clang] [RISCV] Add -march string as Module metadata in IR. (PR #80760)

2024-02-05 Thread Craig Topper via cfe-commits
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/80760 In an LTO build, we don't set the ELF attributes to indicate what extensions were compiled with. The target CPU/Attrs in RISCVTargetMachine do not get set for an LTO build. Each function gets a

[compiler-rt] [openmp] [clang] [lldb] [mlir] [llvm] [libcxx] [flang] [libc] [lld] [clang-tools-extra] [Driver] Report invalid target triple versions for all environment types. (PR #78655)

2024-02-05 Thread Mike Hommey via cfe-commits
glandium wrote: There's apparently also wasm32-wasi-preview2 and wasm32-wasi-pthread, which I suppose are equally broken by this change. https://github.com/llvm/llvm-project/pull/78655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [openmp] [compiler-rt] [llvm] [libcxx] [lldb] [lld] [clang] [flang] [libc] [mlir] [Driver] Report invalid target triple versions for all environment types. (PR #78655)

2024-02-05 Thread Mike Hommey via cfe-commits
glandium wrote: We stumbled upon this downstream because we have jobs building wasi-sdk with clang-trunk, and wasi-sdk builds some things with that target. It apparently comes from https://github.com/WebAssembly/wasi-libc/pull/381 https://github.com/llvm/llvm-project/pull/78655

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 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 e296cedcd686e24fee75756185669f1bb3b47fdd c3be3ebd7a8ae57d319eedbb97ab85324c814db2 --

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-05 Thread Bill Wendling via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
AdamMagierFOSS wrote: > > One thing I'll preemptively address is I didn't know where to put the new > > unit testing - creating a separate file seems a little heavy handed but I > > see that there's a test for UBSan shift generation > > (`clang/test/CodeGen/ubsan-shift.c`) and one for UBSan +

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
@@ -0,0 +1,36 @@ +// RUN: %clang_cc1 %s -O0 -fsanitize=shift-exponent -emit-llvm -o - | FileCheck %s + +// Checking that the code generation is using the unextended/untruncated +// exponent values and capping the values accordingly + +// CHECK-LABEL: define{{.*}} i32

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
@@ -4121,6 +4121,13 @@ Value *ScalarExprEmitter::GetWidthMinusOneValue(Value* LHS,Value* RHS) { Ty = cast(VT->getElementType()); else Ty = cast(LHS->getType()); + // Testing with small _BitInt types has shown that Ty->getBitwidth() - 1

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
@@ -0,0 +1,36 @@ +// RUN: %clang_cc1 %s -O0 -fsanitize=shift-exponent -emit-llvm -o - | FileCheck %s AdamMagierFOSS wrote: Sounds good, thank you for the recommendation! https://github.com/llvm/llvm-project/pull/80515

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
https://github.com/AdamMagierFOSS updated https://github.com/llvm/llvm-project/pull/80515 >From 4e1c37ae83dec050fc9b7aa172db01fa0b2b6d68 Mon Sep 17 00:00:00 2001 From: Adam Magier Date: Sat, 3 Feb 2024 00:38:54 +0100 Subject: [PATCH 1/2] [clang][CodeGen][UBSan] Fixing shift-exponent generation

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-05 Thread Adam Magier via cfe-commits
https://github.com/AdamMagierFOSS edited https://github.com/llvm/llvm-project/pull/80515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

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

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

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

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-05 Thread Bill Wendling via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-05 Thread Alex Hoppen via cfe-commits
@@ -508,24 +513,46 @@ static bool mayBeValidIdentifier(llvm::StringRef Ident) { !isAsciiIdentifierStart(Ident.front(), AllowDollar)) return false; for (char C : Ident) { +if (AllowColon && C == ':') ahoppen wrote: Oh, I just assumed that the

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-05 Thread Alex Hoppen via cfe-commits
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl , Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Result); +

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-05 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx edited https://github.com/llvm/llvm-project/pull/80628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-05 Thread Ben Hamilton via cfe-commits
@@ -0,0 +1,3 @@ +// RUN: clang-format -dump-config 2>&1 | FileCheck %s bhamiltoncx wrote: Can you also add a test with `clang-format --assume-filename=foo.m -dump-config 2>&1 | FileCheck %s`? It should result in `Language: ObjC`.

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-05 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx approved this pull request. Looks good. Can you add one more test, please? https://github.com/llvm/llvm-project/pull/80628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[openmp] [clang] [libc] [mlir] [libcxx] [compiler-rt] [lld] [lldb] [llvm] [clang-tools-extra] [flang] [Driver] Report invalid target triple versions for all environment types. (PR #78655)

2024-02-05 Thread via cfe-commits
ZijunZhaoCCK wrote: > This broke the wasi-threads target: `clang: error: version 'threads' in > target triple 'wasm32-unknown-wasi-threads' is invalid` Because `threads` is not in EnvironmentType list: https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/TargetParser/Triple.h#L231

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-05 Thread Alex Hoppen via cfe-commits
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl , Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Result); +

  1   2   3   4   5   >