[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/138174 >From 7c67ef6748f8813b7aaa91f8e6b463d9fde57d94 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Wed, 30 Apr 2025 23:47:37 -0700 Subject: [PATCH] [NFC][Support] Add llvm::uninitialized_copy Add `llvm::uninitiali

[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Rahul Joshi via cfe-commits
@@ -2981,7 +2981,7 @@ ScalarEvolution::getOrCreateAddExpr(ArrayRef Ops, static_cast(UniqueSCEVs.FindNodeOrInsertPos(ID, IP)); if (!S) { const SCEV **O = SCEVAllocator.Allocate(Ops.size()); -std::uninitialized_copy(Ops.begin(), Ops.end(), O); +llvm::uninitial

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: Thanks for your input. I will close this PR. https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][NFC] Improve Clang Static Analyzer performance. (PR #138295)

2025-05-02 Thread via cfe-commits
tigbr wrote: Yes, that is what I have hoped to improve, and based on the measurements it seems that it had positive effects. https://github.com/llvm/llvm-project/pull/138295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/138317 This patch adds the cir-simplify pass for SelectOp and TernaryOp. It also adds the SelectOp folder and adds the constant materializer for the CIR dialect. >From 2b6ecd77c4fac0a2982172294d12ae858f0a2b34 Mon Sep 17 0

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Morris Hafner (mmha) Changes This patch adds the cir-simplify pass for SelectOp and TernaryOp. It also adds the SelectOp folder and adds the constant materializer for the CIR dialect. --- Patch is 23.47 KiB, truncated to 20.00 KiB below,

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Morris Hafner (mmha) Changes This patch adds the cir-simplify pass for SelectOp and TernaryOp. It also adds the SelectOp folder and adds the constant materializer for the CIR dialect. --- Patch is 23.47 KiB, truncated to 20.00 KiB belo

[clang] [CIR][NFC] Upstream bulk handling for Decl kinds (PR #138319)

2025-05-02 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/138319 This adds explicit case statements for Decl types that weren't explicitly present in the emitDecl function. Those that need no handling are just accepted. Those that will need handling still go to errorNYI,

[clang] [CIR][NFC] Upstream bulk handling for Decl kinds (PR #138319)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) Changes This adds explicit case statements for Decl types that weren't explicitly present in the emitDecl function. Those that need no handling are just accepted. Those that will need handling still go to errorN

[clang] [CIR][NFC] Upstream bulk handling for Decl kinds (PR #138319)

2025-05-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/138319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/138317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Not the best reviewer for this, but found 1 thing I'd like a comment on. Else LGTM pending others being ok with it. https://github.com/llvm/llvm-project/pull/138317 ___ cfe-commits mailing list cfe-commits@lis

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Erich Keane via cfe-commits
@@ -27,6 +27,8 @@ def CIR_Dialect : Dialect { let useDefaultAttributePrinterParser = 0; let useDefaultTypePrinterParser = 0; + let hasConstantMaterializer = 1; erichkeane wrote: oh boy would i love a comment explaining this. https://github.com/llvm/llvm

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Krzysztof Drewniak via cfe-commits
@@ -2641,6 +2641,28 @@ def int_amdgcn_perm : // GFX9 Intrinsics //===--===// +/// This is a general-purpose intrinsic for all operations that take a pointer +/// a base location in LDS, and a data size and us

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -29,6 +29,20 @@ def CIRCanonicalize : Pass<"cir-canonicalize"> { let dependentDialects = ["cir::CIRDialect"]; } +def CIRSimplify : Pass<"cir-simplify"> { + let summary = "Performs CIR simplification and code optimization"; + let description = [{ +The pass performs c

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -62,15 +62,17 @@ class CIRGenConsumer : public clang::ASTConsumer { IntrusiveRefCntPtr FS; std::unique_ptr Gen; const FrontendOptions &FEOptions; + CodeGenOptions &codeGenOptions; andykaylor wrote: ```suggestion CodeGenOptions &CodeGenOptions; ```

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -49,7 +49,7 @@ class CIRGenAction : public clang::ASTFrontendAction { public: ~CIRGenAction() override; - OutputType Action; + OutputType action; andykaylor wrote: This file uses the normal clang coding style, so variable names should be capitalized.

[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

2025-05-02 Thread via cfe-commits
PiJoules wrote: I updated to this with a new AST node but would like some guidance in implementation details. One of the shortcomings of making this a (sugared) node is when passing this type around through templates, the node doesn't persist since only canonical types are substituted through

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > But it might not be a `UnaryOperator`, no? `unaryOperator(...).bind("op")` implies `op` will always be a `UnaryOperator`. https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [llvm] [OpenMP] Remove "alternativeName" from Clause and Directive classes (PR #138179)

2025-05-02 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/138179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add CLI option `-fspv-extension` (PR #137985)

2025-05-02 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/137985 >From d44ed16655870a2435023dc7a4289ea8b3073071 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Mon, 28 Apr 2025 15:55:31 -0400 Subject: [PATCH 1/2] [HLSL][SPIRV] Add CLI option `-fspv-extension` This commit

[clang] 52c6236 - [OpenMP] Remove "alternativeName" from Clause and Directive classes (#138179)

2025-05-02 Thread via cfe-commits
Author: Krzysztof Parzyszek Date: 2025-05-02T13:02:24-05:00 New Revision: 52c62364e76be0c66ba69764a80999aa651f6b59 URL: https://github.com/llvm/llvm-project/commit/52c62364e76be0c66ba69764a80999aa651f6b59 DIFF: https://github.com/llvm/llvm-project/commit/52c62364e76be0c66ba69764a80999aa651f6b59

[clang] [llvm] [OpenMP] Remove "alternativeName" from Clause and Directive classes (PR #138179)

2025-05-02 Thread Krzysztof Parzyszek via cfe-commits
https://github.com/kparzysz closed https://github.com/llvm/llvm-project/pull/138179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Sergei Barannikov via cfe-commits
@@ -22,8 +22,8 @@ Checksum &Checksum::operator=(const Checksum &checksum) { } void Checksum::SetMD5(llvm::MD5::MD5Result md5) { - const constexpr size_t md5_length = 16; - std::uninitialized_copy_n(md5.begin(), md5_length, m_checksum.begin()); + static_assert(sizeof(md5) ==

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-clang-codegen Author: Craig Topper (topperc) Changes Most callers want a constant index. Instead of making every caller create a ConstantInt, we can do it in IRBuilder. This is similar to createInsertElement/createExtractEl

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

2025-05-02 Thread Craig Topper via cfe-commits
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/138324 Most callers want a constant index. Instead of making every caller create a ConstantInt, we can do it in IRBuilder. This is similar to createInsertElement/createExtractElement. >From 827f973d34f46625cfadf56776

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Craig Topper (topperc) Changes Most callers want a constant index. Instead of making every caller create a ConstantInt, we can do it in IRBuilder. This is similar to createInsertElement/createExtractElement. --- Full diff: http

[clang] [CIR] Upstream local initialization for VectorType (PR #138107)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -1685,6 +1686,29 @@ mlir::LogicalResult CIRToLLVMStackRestoreOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMVecCreateOpLowering::matchAndRewrite( +cir::VecCreateOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewr

[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Rahul Joshi via cfe-commits
@@ -22,8 +22,8 @@ Checksum &Checksum::operator=(const Checksum &checksum) { } void Checksum::SetMD5(llvm::MD5::MD5Result md5) { - const constexpr size_t md5_length = 16; - std::uninitialized_copy_n(md5.begin(), md5_length, m_checksum.begin()); + static_assert(sizeof(md5) ==

[clang] [CIR] Upstream local initialization for VectorType (PR #138107)

2025-05-02 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/138107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Fix some clang-format mistakes (PR #138036)

2025-05-02 Thread Eli Friedman via cfe-commits
@@ -3997,7 +3996,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI, RV = SI->getValueOperand(); SI->eraseFromParent(); -// Otherwise, we have to do a simple load. + // Otherwise, we have to do a simple load. e

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Krzysztof Drewniak via cfe-commits
@@ -2641,6 +2641,28 @@ def int_amdgcn_perm : // GFX9 Intrinsics //===--===// +/// This is a general-purpose intrinsic for all operations that take a pointer +/// a base location in LDS, and a data size and us

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Krzysztof Drewniak via cfe-commits
@@ -2641,6 +2641,28 @@ def int_amdgcn_perm : // GFX9 Intrinsics //===--===// +/// This is a general-purpose intrinsic for all operations that take a pointer +/// a base location in LDS, and a data size and us

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

2025-05-02 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. I thought this already existed https://github.com/llvm/llvm-project/pull/138324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: I don't have a strong opinion on this, but this `assert` may be a sign of "false safety". In release builds, it's a no-op, so end users will experience a regular Segfault, e.g. like this issue https://github.com/llvm/llvm-project/issues/135665. Debug builds with asserts are usu

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

2025-05-02 Thread Ian Anderson via cfe-commits
@@ -1366,6 +1366,15 @@ ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{ return *cxxStdlibType; } +/// Utility function to add a system framework directory to CC1 arguments. +/*static*/ void ian-twilightcoder wrote: I copied

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

2025-05-02 Thread Ian Anderson via cfe-commits
@@ -1396,6 +1405,17 @@ void ToolChain::addExternCSystemIncludeIfExists(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, Path); } +/// Utility function to add a list of system framework directories to CC1. +/*static*/ void ian-twilig

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

2025-05-02 Thread Ian Anderson via cfe-commits
@@ -1,13 +0,0 @@ -// RUN: %clang -cc1 -fcuda-is-device -isysroot /var/empty \ ian-twilightcoder wrote: We don't need it because the `ignoring nonexistent directory` are no longer produced. Those paths get pruned before they reach the HeaderSearch now. The old c

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Krzysztof Drewniak via cfe-commits
https://github.com/krzysz00 updated https://github.com/llvm/llvm-project/pull/137425 >From bcb72e3d8cb2dcdb97199d32797306c5807c8442 Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak Date: Sat, 26 Apr 2025 00:20:22 + Subject: [PATCH 1/4] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic This

[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Rahul Joshi via cfe-commits
@@ -2038,6 +2038,11 @@ template auto mismatch(R1 &&Range1, R2 &&Range2) { adl_end(Range2)); } +template +auto uninitialized_copy(R1 &&Src, IterTy Dst) { jurahul wrote: Thanks, fixed. https://github.com/llvm/llvm-project/pull/138174

[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

2025-05-02 Thread via cfe-commits
https://github.com/PiJoules updated https://github.com/llvm/llvm-project/pull/135836 >From bcb99801417631cefbc175b578a216ef9f0e24a6 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Wed, 9 Apr 2025 14:21:00 -0700 Subject: [PATCH] [clang] Function type attribute to prevent CFI instrumentation

[clang-tools-extra] [NFC] Fix potential nullptr dereference. (PR #138283)

2025-05-02 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam closed https://github.com/llvm/llvm-project/pull/138283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Morris Hafner via cfe-commits
@@ -27,6 +27,8 @@ def CIR_Dialect : Dialect { let useDefaultAttributePrinterParser = 0; let useDefaultTypePrinterParser = 0; + let hasConstantMaterializer = 1; mmha wrote: There's some documentation here: https://mlir.llvm.org/docs/Canonicalization/#gen

[clang] [FixIt] Improve Source Ranges and Fix-It Hints for Unused Lambda Captures #106445 (PR #117953)

2025-05-02 Thread via cfe-commits
https://github.com/charan-003 updated https://github.com/llvm/llvm-project/pull/117953 >From b886394f3aca3ea53f2c97d85a8e963d192c122f Mon Sep 17 00:00:00 2001 From: charan-003 <85248228+charan-...@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:43:38 -0700 Subject: [PATCH 01/26] Update SemaL

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

2025-05-02 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder edited https://github.com/llvm/llvm-project/pull/138234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC][doc] fix typos in docs. (PR #138305)

2025-05-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/138305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 2f16cbc - [clang-tidy][NFC][doc] fix typos in docs. (#138305)

2025-05-02 Thread via cfe-commits
Author: Baranov Victor Date: 2025-05-02T20:41:43+02:00 New Revision: 2f16cbc74c9d60c4ea03d102ce5d3b1343b8 URL: https://github.com/llvm/llvm-project/commit/2f16cbc74c9d60c4ea03d102ce5d3b1343b8 DIFF: https://github.com/llvm/llvm-project/commit/2f16cbc74c9d60c4ea03d102ce5d3b1343b8.diff

[clang-tools-extra] [clang-tidy][NFC][doc] fix typos in docs. (PR #138305)

2025-05-02 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/138305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Matt Arsenault via cfe-commits
@@ -2641,6 +2641,28 @@ def int_amdgcn_perm : // GFX9 Intrinsics //===--===// +/// This is a general-purpose intrinsic for all operations that take a pointer +/// a base location in LDS, and a data size and us

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Jay Foad via cfe-commits
@@ -2641,6 +2641,28 @@ def int_amdgcn_perm : // GFX9 Intrinsics //===--===// +/// This is a general-purpose intrinsic for all operations that take a pointer +/// a base location in LDS, and a data size and us

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,184 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,184 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-02 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,60 @@ +// RUN: cir-opt -cir-canonicalize -cir-simplify -o %t.cir %s +// RUN: FileCheck --input-file=%t.cir %s + +!s32i = !cir.int + +module { + cir.func @fold_ternary(%arg0: !s32i, %arg1: !s32i) -> !s32i { +%0 = cir.const #cir.bool : !cir.bool +%1 = cir.ternary

[clang] [llvm] [sancov] Introduce optional callback for stack-depth tracking (PR #138323)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer @llvm/pr-subscribers-clang-codegen Author: Kees Cook (kees) Changes Normally -fsanitize-coverage=stack-depth inserts inline arithmetic to update thread_local __sancov_lowest_stack. To support stack depth tracking in the Linux kern

[clang] [CIR] Upstream local initialization for VectorType (PR #138107)

2025-05-02 Thread Amr Hesham via cfe-commits
@@ -1685,6 +1686,29 @@ mlir::LogicalResult CIRToLLVMStackRestoreOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMVecCreateOpLowering::matchAndRewrite( +cir::VecCreateOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewr

[clang] [llvm] [sancov] Introduce optional callback for stack-depth tracking (PR #138323)

2025-05-02 Thread Kees Cook via cfe-commits
https://github.com/kees created https://github.com/llvm/llvm-project/pull/138323 Normally -fsanitize-coverage=stack-depth inserts inline arithmetic to update thread_local __sancov_lowest_stack. To support stack depth tracking in the Linux kernel, which does not implement traditional thread_loca

[clang] [llvm] [sancov] Introduce optional callback for stack-depth tracking (PR #138323)

2025-05-02 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 HEAD~1 HEAD --extensions cpp,h -- clang/include/clang/Driver/SanitizerArgs.h clang/li

[clang] [llvm] [sancov] Introduce optional callback for stack-depth tracking (PR #138323)

2025-05-02 Thread Kees Cook via cfe-commits
https://github.com/kees updated https://github.com/llvm/llvm-project/pull/138323 >From 4c9e223b8f0457b3f3f66bbb3fa2688b49204cc9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 2 May 2025 10:51:02 -0700 Subject: [PATCH] [sancov] Introduce optional callback for stack-depth tracking Normally -

[clang] [llvm] [sancov] Introduce optional callback for stack-depth tracking (PR #138323)

2025-05-02 Thread Kees Cook via cfe-commits
kees wrote: > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️ > > You can test this locally with the following command: > View the diff from clang-format here. Whoops, yes, I've fixed these now. https://github.com/llvm/llvm-project/pull/138323 __

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

2025-05-02 Thread Ian Anderson via cfe-commits
@@ -2577,6 +2577,27 @@ void AppleMachO::AddClangSystemIncludeArgs( } } +void DarwinClang::AddClangSystemIncludeArgs( +const llvm::opt::ArgList &DriverArgs, +llvm::opt::ArgStringList &CC1Args) const { + AppleMachO::AddClangSystemIncludeArgs(DriverArgs, CC1Args); + +

[clang-tools-extra] [clang-tidy][NFC][doc] fix typos in docs. (PR #138305)

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

[clang] cce6de8 - [Clang] Never consider conversion from single-element braced-init-list perfect (#138307)

2025-05-02 Thread via cfe-commits
Author: cor3ntin Date: 2025-05-02T20:56:02+02:00 New Revision: cce6de83138223db07d538824e0c398d5da83190 URL: https://github.com/llvm/llvm-project/commit/cce6de83138223db07d538824e0c398d5da83190 DIFF: https://github.com/llvm/llvm-project/commit/cce6de83138223db07d538824e0c398d5da83190.diff LOG:

[clang] [Clang] Never consider conversion from single-element braced-init-list perfect (PR #138307)

2025-05-02 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/138307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1101b76 - [Clang] Implement CWG3005 Function parameters should never be name-independent (#138245)

2025-05-02 Thread via cfe-commits
Author: cor3ntin Date: 2025-05-02T20:56:28+02:00 New Revision: 1101b767329dd163d528fa5f667a6c0dbdde0ad5 URL: https://github.com/llvm/llvm-project/commit/1101b767329dd163d528fa5f667a6c0dbdde0ad5 DIFF: https://github.com/llvm/llvm-project/commit/1101b767329dd163d528fa5f667a6c0dbdde0ad5.diff LOG:

[clang] [Clang] Implement CWG3005 Function parameters should never be name-independent (PR #138245)

2025-05-02 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/138245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

2025-05-02 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I'm confident making this part of the FunctionType is the right approach. We don't implicitly drop the bits from the FunctionType bitfields, for bits that are part of the canonical type. Any cast is explicitly represented in the AST, and we have warnings for mismatches (s

[clang] [clang][Sema] Don't warn for implicit uses of builtins in system headers (PR #138205)

2025-05-02 Thread Artem Belevich via cfe-commits
Artem-B wrote: Something does not add up here. AFAICT, using builtins w/o explicitly declaring them is something that's done all the time. https://godbolt.org/z/ha47W53dh In that sense, we should not be needing to filter out the diagnostics coming from the system headers only. There should not

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Morris Hafner via cfe-commits
@@ -365,46 +406,108 @@ mlir::Value CIRGenModule::getAddrOfGlobalVar(const VarDecl *d, mlir::Type ty, void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *vd, bool isTentative) { const QualType astTy = vd->getType(); - c

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Morris Hafner via cfe-commits
@@ -90,8 +90,100 @@ class ConstExprEmitter } mlir::Attribute VisitCastExpr(CastExpr *e, QualType destType) { -cgm.errorNYI(e->getBeginLoc(), "ConstExprEmitter::VisitCastExpr"); -return {}; +if (const auto *ece = dyn_cast(e)) + cgm.errorNYI(e->getBeginLoc()

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Morris Hafner via cfe-commits
@@ -31,6 +31,15 @@ class ConstantEmitter { private: bool abstract = false; + /// Whether non-abstract components of the emitter have been initialized. + bool initializedNonAbstract = false; mmha wrote: Is this just for sanity checking? Should this be wrap

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Morris Hafner via cfe-commits
@@ -365,46 +406,108 @@ mlir::Value CIRGenModule::getAddrOfGlobalVar(const VarDecl *d, mlir::Type ty, void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *vd, bool isTentative) { const QualType astTy = vd->getType(); - c

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Morris Hafner via cfe-commits
@@ -118,7 +210,26 @@ class ConstExprEmitter } mlir::Attribute VisitInitListExpr(InitListExpr *ile, QualType t) { -cgm.errorNYI(ile->getBeginLoc(), "ConstExprEmitter::VisitInitListExpr"); +if (ile->isTransparent()) + return Visit(ile->getInit(0), t); + +if

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-05-02 Thread Matt Arsenault via cfe-commits
@@ -2641,6 +2641,28 @@ def int_amdgcn_perm : // GFX9 Intrinsics //===--===// +/// This is a general-purpose intrinsic for all operations that take a pointer +/// a base location in LDS, and a data size and us

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Morris Hafner via cfe-commits
https://github.com/mmha commented: Mostly a few nits. https://github.com/llvm/llvm-project/pull/138222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

2025-05-02 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/138324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/138174 >From 46542ce5b946735c2c0a8f65e185761ebbf77073 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Wed, 30 Apr 2025 23:47:37 -0700 Subject: [PATCH] [NFC][Support] Add llvm::uninitialized_copy Add `llvm::uninitiali

[clang] [clang][NFC] Fix some clang-format mistakes (PR #138036)

2025-05-02 Thread Nick Sarnie via cfe-commits
@@ -3997,7 +3996,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI, RV = SI->getValueOperand(); SI->eraseFromParent(); -// Otherwise, we have to do a simple load. + // Otherwise, we have to do a simple load. s

[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Rahul Joshi via cfe-commits
@@ -22,8 +22,8 @@ Checksum &Checksum::operator=(const Checksum &checksum) { } void Checksum::SetMD5(llvm::MD5::MD5Result md5) { - const constexpr size_t md5_length = 16; - std::uninitialized_copy_n(md5.begin(), md5_length, m_checksum.begin()); + static_assert(sizeof(md5) ==

[clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-02 Thread Rahul Joshi via cfe-commits
@@ -2981,7 +2981,7 @@ ScalarEvolution::getOrCreateAddExpr(ArrayRef Ops, static_cast(UniqueSCEVs.FindNodeOrInsertPos(ID, IP)); if (!S) { const SCEV **O = SCEVAllocator.Allocate(Ops.size()); -std::uninitialized_copy(Ops.begin(), Ops.end(), O); +llvm::uninitial

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

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

[clang] [clang][Sema] Don't warn for implicit uses of builtins in system headers (PR #138205)

2025-05-02 Thread Nick Sarnie via cfe-commits
sarnex wrote: I think it's because we are explciitly marking these builtins as requiring a header. If they aren't declared that way then you won't see this warning and won't need this change. I made the builtins require a header based on feedback from @rnk in the earlier PR, and his suggestio

[clang] [HLSL] Implement the `ldexp` intrinsic (PR #138182)

2025-05-02 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. This looks fine. I would not like to carry forward native half testing of intrinsics that are written purely in HLSL. I think the builtin ones aren't great either but I understand how they came to exist. As for looking at notes. its eas

[clang] [HLSL] Implement the `ldexp` intrinsic (PR #138182)

2025-05-02 Thread Farzon Lotfi via cfe-commits
@@ -303,6 +303,48 @@ fmod(__detail::HLSL_FIXED_VECTOR X, return __detail::fmod_vec_impl(X, Y); } +//===--===// +// ldexp builtins +//===--=

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Mehdi Amini via cfe-commits
@@ -59,22 +59,41 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] [HLSL] Implement the `ldexp` intrinsic (PR #138182)

2025-05-02 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/138182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/138251 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-ser

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
@@ -59,22 +59,41 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] Reset CodeGenOptions fields for clean module/PCH builds (PR #138256)

2025-05-02 Thread Ayush Pareek via cfe-commits
https://github.com/ayushpareek2003 created https://github.com/llvm/llvm-project/pull/138256 This change resets certain CodeGenOptions fields using = {} instead of .clear(), to clean up build-specific data when generating modules or PCH files. It helps make the output more consistent and easier

[clang] Reset CodeGenOptions fields for clean module/PCH builds (PR #138256)

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

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
@@ -59,22 +59,41 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] [HLSL] Implement the `ldexp` intrinsic (PR #138182)

2025-05-02 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float test_double_inputs(double p0, double p1) { + return ldexp(p0, p1); + // expected-error@-1 {{no matc

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Mehdi Amini via cfe-commits
@@ -59,22 +59,41 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] [C] Add -Wjump-bypasses-init (PR #138009)

2025-05-02 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=c,both -Wjump-bypasses-init %s +// RUN: %clang_cc1 -fsyntax-only -verify=c,both -Wc++-compat %s +// RUN: %clang_cc1 -fsyntax-only -verify=good %s +// RUN: %clang_cc1 -fsyntax-only -verify=cxx,both -x c++ %s +// good-no-dia

[libunwind] [libunwind] [SEH] Set NonVolatileRegisters before calling a personality function (PR #137951)

2025-05-02 Thread Martin Storsjö via cfe-commits
https://github.com/mstorsjo updated https://github.com/llvm/llvm-project/pull/137951 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-

[clang] [C] Update -Wimplicit-void-ptr-cast for null pointer constants (PR #138271)

2025-05-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/138271 Null pointer constants require a bit of extra effort to handle in C. Fixes #138145 Rate limit · GitHub body { background-color: #f6f8fa; color: #2429

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-05-02 Thread Anchu Rajendran S via cfe-commits
https://github.com/anchuraj closed https://github.com/llvm/llvm-project/pull/137996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Fix target parsing for -fveclib=libmvec option. (PR #138288)

2025-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Paul Walker (paulwalker-arm) Changes There are various places where the -fveclib option is parsed to determine whether its value is correct for the target. Unfortunately these places assume case-insensitivity and subsequently use "

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Mehdi Amini via cfe-commits
@@ -59,22 +59,42 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] Fix missing initializer for inline static template member with auto caused by delayed template instantiation. (PR #138122)

2025-05-02 Thread Yanzuo Liu via cfe-commits
@@ -6027,8 +6027,15 @@ void Sema::BuildVariableInstantiation( Context.setManglingNumber(NewVar, Context.getManglingNumber(OldVar)); Context.setStaticLocalNumber(NewVar, Context.getStaticLocalNumber(OldVar)); + bool VarTemplateWithAutoType = false; + QualType VarSourceTyp

  1   2   3   4   5   6   7   >