[clang] [Coverage] Introduce the type `CounterPair` for RegionCounterMap. NFC. (PR #112724)

2024-12-18 Thread Jessica Paquette via cfe-commits
@@ -1869,7 +1871,10 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) { // If we are at an unreachable point, we don't need to emit the initializer // unless it contains a label. if (!HaveInsertPoint()) { -if (!Init || !ContainsLabel(Init)) re

[clang] [OpenMP] Codegen support for masked combined construct (PR #120520)

2024-12-18 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 5fc8062f5d9b0c62bdb3c817182d7275d27f7527 ca5e6f208927fc9b82c6dce34ee46dbca2d83a58 --e

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/120526 The limits.h of glibc, aka /usr/include/limits.h file of *-linux-gnu systems, has `#include_next `, so the limits.h from clang is included. And in the limits.h for clang, `#include_next ` is also used. Normall

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: YunQiang Su (wzssyqa) Changes The limits.h of glibc, aka /usr/include/limits.h file of *-linux-gnu systems, has `#include_next `, so the limits.h from clang is included. And in the limits.h for clang, `#include_next

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/120352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-18 Thread Yingwei Zheng via cfe-commits
@@ -1520,15 +1520,102 @@ ConstantRange ConstantRange::binaryNot() const { return ConstantRange(APInt::getAllOnes(getBitWidth())).sub(*this); } +/// Estimate the 'bit-masked AND' operation's lower bound. +/// +/// E.g., given two ranges as follows (single quotes are separator

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-18 Thread Yingwei Zheng via cfe-commits
@@ -1520,15 +1520,102 @@ ConstantRange ConstantRange::binaryNot() const { return ConstantRange(APInt::getAllOnes(getBitWidth())).sub(*this); } +/// Estimate the 'bit-masked AND' operation's lower bound. +/// +/// E.g., given two ranges as follows (single quotes are separator

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-18 Thread Yingwei Zheng via cfe-commits
@@ -1520,15 +1520,102 @@ ConstantRange ConstantRange::binaryNot() const { return ConstantRange(APInt::getAllOnes(getBitWidth())).sub(*this); } +/// Estimate the 'bit-masked AND' operation's lower bound. +/// +/// E.g., given two ranges as follows (single quotes are separator

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw commented: Please give me more time to understand the implementation... https://github.com/llvm/llvm-project/pull/120352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-18 Thread Yingwei Zheng via cfe-commits
@@ -1520,15 +1520,102 @@ ConstantRange ConstantRange::binaryNot() const { return ConstantRange(APInt::getAllOnes(getBitWidth())).sub(*this); } +/// Estimate the 'bit-masked AND' operation's lower bound. +/// +/// E.g., given two ranges as follows (single quotes are separator

[clang] [clang-tools-extra] [clangd][clang-tidy] Make clangd run `format::cleanupAroundReplacements()` for all code actions just as clang-tidy does (PR #118569)

2024-12-18 Thread Richard Li via cfe-commits
https://github.com/chomosuke updated https://github.com/llvm/llvm-project/pull/118569 >From efc17a803c9c22543de7d5f9e960a7267ade1f2e Mon Sep 17 00:00:00 2001 From: chomosuke Date: Wed, 4 Dec 2024 14:42:24 + Subject: [PATCH 1/2] [clangd][clang-tidy] Make clangd run `format::cleanupAroundRep

[clang] [clang-tools-extra] [clangd][clang-tidy] Make clangd run `format::cleanupAroundReplacements()` for all code actions just as clang-tidy does (PR #118569)

2024-12-18 Thread Richard Li via cfe-commits
chomosuke wrote: Ping https://github.com/llvm/llvm-project/pull/118569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (PR #120352)

2024-12-18 Thread Yingwei Zheng via cfe-commits
@@ -1520,15 +1520,102 @@ ConstantRange ConstantRange::binaryNot() const { return ConstantRange(APInt::getAllOnes(getBitWidth())).sub(*this); } +/// Estimate the 'bit-masked AND' operation's lower bound. +/// +/// E.g., given two ranges as follows (single quotes are separator

[clang] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (PR #119932)

2024-12-18 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/119932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (PR #120528)

2024-12-18 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/120528 In WebKit, we often capture this as Ref or RefPtr in addition to this itself so that the object lives as long as a capturing lambda stays alive. Detect this pattern and treat it as safe. This PR also makes the ch

[clang] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (PR #120528)

2024-12-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ryosuke Niwa (rniwa) Changes In WebKit, we often capture this as Ref or RefPtr in addition to this itself so that the object lives as long as a capturing lambda stays alive. Detect this pattern and treat it as safe. This PR also makes the

[clang] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (PR #120528)

2024-12-18 Thread Rashmi Mudduluru via cfe-commits
@@ -180,11 +212,51 @@ class UncountedLambdaCapturesChecker } else if (C.capturesThis() && shouldCheckThis) { if (ignoreParamVarDecl) // this is always a parameter to this function. continue; -reportBugOnThisPtr(C); +bool hasProtectThis =

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-12-18 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > While I don't have direct experience with LLVM releases, I suppose the > Outgoing Calls feature will be part of version 20? Yep https://github.com/llvm/llvm-project/pull/117673 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (PR #120528)

2024-12-18 Thread Ryosuke Niwa via cfe-commits
@@ -180,11 +212,51 @@ class UncountedLambdaCapturesChecker } else if (C.capturesThis() && shouldCheckThis) { if (ignoreParamVarDecl) // this is always a parameter to this function. continue; -reportBugOnThisPtr(C); +bool hasProtectThis =

[clang] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (PR #120528)

2024-12-18 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/120528 >From 97a721c8358d48333e0f8ab4177906135a2e2364 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 13 Dec 2024 14:34:39 -0800 Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis p

[clang] [clang][NFC] Increase NumStmtBits by 2 as we are approaching the limit (PR #120341)

2024-12-18 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Let's just increase to 9 bits. > > Have you checked whether the size of `Stmt` or `Expr` changes when you do > > this? > > @rjmccall I've changed it to 9 bits and checked that `Stmt` and `Expr` are > still 8 bytes and 16 bytes resp.. I think checking just those two isn't

[clang] [llvm] [Experimental] Alternative implementation of FP8 Neon (PR #120476)

2024-12-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Momchil Velikov (momchil-velikov) Changes --- Patch is 159.33 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/120476.diff 31 Files Affected: - (modified) clang/include/clang/AST/Type

[clang] [llvm] [Experimental] Alternative implementation of FP8 Neon (PR #120476)

2024-12-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-arm @llvm/pr-subscribers-backend-aarch64 Author: Momchil Velikov (momchil-velikov) Changes --- Patch is 159.33 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/120476.diff 31 Files Affected: - (mod

[clang] [llvm] [Experimental] Alternative implementation of FP8 Neon (PR #120476)

2024-12-18 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov converted_to_draft https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Increase NumStmtBits by 2 as we are approaching the limit (PR #120341)

2024-12-18 Thread John McCall via cfe-commits
rjmccall wrote: > > > Let's just increase to 9 bits. > > > Have you checked whether the size of `Stmt` or `Expr` changes when you do > > > this? > > > > > > @rjmccall I've changed it to 9 bits and checked that `Stmt` and `Expr` are > > still 8 bytes and 16 bytes resp.. > > I think checking j

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-18 Thread via cfe-commits
https://github.com/4m4n-x-B4w4ne updated https://github.com/llvm/llvm-project/pull/120087 >From 03f536888ddc5b7be2514c2d880c6d3119b7f4ee Mon Sep 17 00:00:00 2001 From: 4m4n-x-B4w4ne <125849251+4m4n-x-b4w...@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:43:42 +0530 Subject: [PATCH 01/20] Up

[clang] [llvm] [Experimental] Alternative implementation of FP8 Neon (PR #120476)

2024-12-18 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 229d78de31467f623e33716a30cb0c6d285d7683 1cde192318d698668510362400a08b95a5cf54e4 --e

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/120327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -206,3 +208,124 @@ void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(::new (SemaRef.Context) SYCLKernelEntryPointAttr(SemaRef.Context, AL, TSI)); } + +static SourceLocation SourceLocationForType(QualType QT) { + Source

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -206,3 +208,124 @@ void SemaSYCL::handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(::new (SemaRef.Context) SYCLKernelEntryPointAttr(SemaRef.Context, AL, TSI)); } + +static SourceLocation SourceLocationForType(QualType QT) { + Source

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -15978,6 +15988,24 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, CheckCoroutineWrapper(FD); } + // Diagnose invalid SYCL kernel entry point function declarations. + if (FD && !FD->isInvalidDecl() && !FD->isTemplated() && + FD->hasAttr()) { +

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -15978,6 +15988,24 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, CheckCoroutineWrapper(FD); } + // Diagnose invalid SYCL kernel entry point function declarations. + if (FD && !FD->isInvalidDecl() && !FD->isTemplated() && erichkean

[clang] [SYCL] Basic diagnostics for the sycl_kernel_entry_point attribute. (PR #120327)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -1134,8 +1134,18 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { // the presence of a sycl_kernel_entry_point attribute, register it so that // associated metadata is recreated. if (FD->hasAttr()) { +const auto *SKEPAttr = FD->getAttr(); ASTContex

[clang] [Sema] Diagnose tautological bounds checks (PR #120222)

2024-12-18 Thread Nikita Popov via cfe-commits
nikic wrote: @nathanchance You are correct, this warning should indeed respect `-fwrapv`/`-fno-strict-overflow`. Your patch looks reasonable to me as well. https://github.com/llvm/llvm-project/pull/120222 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang][NFC] Increase NumStmtBits by 2 as we are approaching the limit (PR #120341)

2024-12-18 Thread Erich Keane via cfe-commits
erichkeane wrote: > > > > Let's just increase to 9 bits. > > > > Have you checked whether the size of `Stmt` or `Expr` changes when you > > > > do this? > > > > > > > > > @rjmccall I've changed it to 9 bits and checked that `Stmt` and `Expr` > > > are still 8 bytes and 16 bytes resp.. > > >

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-18 Thread via cfe-commits
4m4n-x-B4w4ne wrote: > Please mention options in Release Notes and check documentation. I have documented it can you please review it ! https://github.com/llvm/llvm-project/pull/120087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [clang][NFC] Increase NumStmtBits by 2 as we are approaching the limit (PR #120341)

2024-12-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Please wait a little while to give the others a chance to approve this version before committing. https://github.com/llvm/llvm-project/pull/120341 ___ cfe-commits mailing list cfe-commits@lists

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -11285,6 +11285,21 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, if (Builtin->LLVMIntrinsic == 0) return nullptr; + if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) { +// If we already know the streaming mode, don't bothe

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -11285,6 +11285,21 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, if (Builtin->LLVMIntrinsic == 0) return nullptr; + if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) { +// If we already know the streaming mode, don't bothe

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -11285,6 +11285,21 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, if (Builtin->LLVMIntrinsic == 0) return nullptr; + if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) { +// If we already know the streaming mode, don't bothe

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited https://github.com/llvm/llvm-project/pull/120265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. LGTM with nits addressed https://github.com/llvm/llvm-project/pull/120265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wunsafe-buffer-usage] Fix false positive when const sized array is indexed by const evaluatable expressions (PR #119340)

2024-12-18 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM, thank you @malavikasamak https://github.com/llvm/llvm-project/pull/119340 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [clang][NFC] Increase NumStmtBits by 2 as we are approaching the limit (PR #120341)

2024-12-18 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. https://github.com/llvm/llvm-project/pull/120341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-18 Thread via cfe-commits
@@ -147,3 +147,38 @@ Options if (foo) {} // ^ propose replacement default: if (foo != 0u) {} // ^ propose replacement with option `UseUpperCaseLiteralSuffix`: if (foo != 0U) {} +.. option:: CheckConversionsToBool + + When `true`, the check diagnoses implici

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-18 Thread via cfe-commits
@@ -147,3 +147,38 @@ Options if (foo) {} // ^ propose replacement default: if (foo != 0u) {} // ^ propose replacement with option `UseUpperCaseLiteralSuffix`: if (foo != 0U) {} +.. option:: CheckConversionsToBool + + When `true`, the check diagnoses implici

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-18 Thread via cfe-commits
https://github.com/4m4n-x-B4w4ne updated https://github.com/llvm/llvm-project/pull/120087 >From 03f536888ddc5b7be2514c2d880c6d3119b7f4ee Mon Sep 17 00:00:00 2001 From: 4m4n-x-B4w4ne <125849251+4m4n-x-b4w...@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:43:42 +0530 Subject: [PATCH 01/21] Up

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-18 Thread via cfe-commits
@@ -147,3 +147,38 @@ Options if (foo) {} // ^ propose replacement default: if (foo != 0u) {} // ^ propose replacement with option `UseUpperCaseLiteralSuffix`: if (foo != 0U) {} +.. option:: CheckConversionsToBool + + When `true`, the check diagnoses implici

[clang] [llvm] [LLVM][PhaseOrdering] Run CSE after InstCombine has cleaned the result of vectorisation. (PR #120443)

2024-12-18 Thread Florian Hahn via cfe-commits
@@ -1306,6 +1306,10 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level, } // Cleanup after the loop optimization passes. FPM.addPass(InstCombinePass()); + // InstCombine can create CSE opportunities when it cleans the result of loop + // vectorization. They o

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/120449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-18 Thread Eli Friedman via cfe-commits
@@ -1977,15 +1977,15 @@ def AtomicNandFetch : AtomicBuiltin { let Prototype = "void(...)"; } -def AtomicTestAndSet : Builtin { +def AtomicTestAndSet : AtomicBuiltin { let Spellings = ["__atomic_test_and_set"]; - let Attributes = [NoThrow]; + let Attributes = [NoThrow, C

[clang] [Sema] Fix tautological bounds check warning with -fwrapv (PR #120480)

2024-12-18 Thread Nathan Chancellor via cfe-commits
https://github.com/nathanchance created https://github.com/llvm/llvm-project/pull/120480 The tautological bounds check warning added in #120222 does not take into account whether signed integer overflow is well defined or not, which could result in a developer removing a bounds check that may

[clang] [Sema] Diagnose tautological bounds checks (PR #120222)

2024-12-18 Thread Nathan Chancellor via cfe-commits
nathanchance wrote: > @nathanchance You are correct, this warning should indeed respect > `-fwrapv`/`-fno-strict-overflow`. Your patch looks reasonable to me as well. Thanks for the confirmation, I have submitted https://github.com/llvm/llvm-project/pull/120480 for this. https://github.com/ll

[clang] [Sema] Fix tautological bounds check warning with -fwrapv (PR #120480)

2024-12-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nathan Chancellor (nathanchance) Changes The tautological bounds check warning added in #120222 does not take into account whether signed integer overflow is well defined or not, which could result in a developer removing a bounds check t

[clang] [Sema] Fix tautological bounds check warning with -fwrapv (PR #120480)

2024-12-18 Thread Nikita Popov via cfe-commits
@@ -1,40 +1,72 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -DFWRAPV -fwrapv -verify %s nikic wrote: I'm not very familiar with `-verify` tests, but may there is some way to avoid these ifdefs using prefixes? Something like t

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

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

[clang] [llvm] [AArch64] Implement NEON FP8 intrinsics for fused multiply-add (indexed) (PR #120403)

2024-12-18 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/120403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix tautological bounds check warning with -fwrapv (PR #120480)

2024-12-18 Thread Nathan Chancellor via cfe-commits
https://github.com/nathanchance updated https://github.com/llvm/llvm-project/pull/120480 >From 0eb68a5e438701a92dcedefc26a99c8dd48d0bed Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Wed, 18 Dec 2024 14:03:14 -0700 Subject: [PATCH 1/2] [Sema] Fix tautological bounds check warning with -

[clang] [Sema] Fix tautological bounds check warning with -fwrapv (PR #120480)

2024-12-18 Thread Nathan Chancellor via cfe-commits
@@ -1,40 +1,72 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -DFWRAPV -fwrapv -verify %s nathanchance wrote: Ah yes, that is much cleaner. Done in 8504a0d758c06fa9f3b95117fdb05021d75afe8d. https://github.com/llvm/llvm-project/

[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler (PR #108357)

2024-12-18 Thread via cfe-commits
h-vetinari wrote: We could backport #120370 so that at least clang 19.1.x still becomes compatible again (post-reland)? https://github.com/llvm/llvm-project/pull/108357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2024-12-18 Thread Alex Voicu via cfe-commits
@@ -225,7 +225,9 @@ ABIArgInfo AMDGPUABIInfo::classifyArgumentType(QualType Ty, bool Variadic, // Records with non-trivial destructors/copy-constructors should not be // passed by value. if (auto RAA = getRecordArgABI(Ty, getCXXABI())) - return getNaturalAlign

[clang] [llvm] Revert "[InstCombine] Infer nuw for gep inbounds from base of object" (PR #120460)

2024-12-18 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lld-x86_64-ubuntu-fast` running on `as-builder-4` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/8539 Here is the

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Vitaly Buka via cfe-commits
@@ -696,6 +697,17 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, TrappingKinds &= Kinds; RecoverableKinds &= ~TrappingKinds; + // Parse -f(no-)?sanitize-nonmerged-handlers flags + SanitizerMask AlwaysMerge; // Empty vitalybuka wrote: ``` ``` San

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/120464 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/120464 >From 2c0da9aa6f58900387fa91cdc6bcb41e0235d94c Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 18 Dec 2024 18:37:11 + Subject: [PATCH 01/18] [ubsan] Add -fsanitize-nonmerged-handlers (and -fno-san

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread Eli Friedman via cfe-commits
@@ -129,4 +130,224 @@ def PrimitiveInt : AnyTypeOf<[UInt8, UInt16, UInt32, UInt64, SInt8, SInt16, SInt32, SInt64], "primitive int", "::cir::IntType">; +//===--===// +// FloatType +//===

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/120464 >From 2c0da9aa6f58900387fa91cdc6bcb41e0235d94c Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 18 Dec 2024 18:37:11 + Subject: [PATCH 01/14] [ubsan] Add -fsanitize-nonmerged-handlers (and -fno-san

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/120464 >From 2c0da9aa6f58900387fa91cdc6bcb41e0235d94c Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 18 Dec 2024 18:37:11 + Subject: [PATCH 01/15] [ubsan] Add -fsanitize-nonmerged-handlers (and -fno-san

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/120464 >From 2c0da9aa6f58900387fa91cdc6bcb41e0235d94c Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 18 Dec 2024 18:37:11 + Subject: [PATCH 01/16] [ubsan] Add -fsanitize-nonmerged-handlers (and -fno-san

[clang] [llvm] [ubsan] Add runtime test for -fsanitize=local-bounds (PR #120038)

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

[clang] e34cc7c - [OpenACC] Implement 'wait' construct

2024-12-18 Thread via cfe-commits
Author: erichkeane Date: 2024-12-18T15:06:01-08:00 New Revision: e34cc7c99375c43e1698c78ec9150fa40c88d486 URL: https://github.com/llvm/llvm-project/commit/e34cc7c99375c43e1698c78ec9150fa40c88d486 DIFF: https://github.com/llvm/llvm-project/commit/e34cc7c99375c43e1698c78ec9150fa40c88d486.diff LO

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/120464 >From 2c0da9aa6f58900387fa91cdc6bcb41e0235d94c Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 18 Dec 2024 18:37:11 + Subject: [PATCH 01/17] [ubsan] Add -fsanitize-nonmerged-handlers (and -fno-san

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -18,6 +21,87 @@ mlir::MLIRContext &CIRGenTypes::getMLIRContext() const { return *builder.getContext(); } +/// Return true if the specified type in a function parameter or result position +/// can be converted to a CIR type at this point. This boils down to being +/// whe

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -133,6 +143,276 @@ IntType::verify(llvm::function_ref emitError, return mlir::success(); } +//===--===// +// Floating-point type definitions +//===

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -0,0 +1,52 @@ +//===- CIRFPTypeInterface.td - CIR FP Interface Definitions -*- C++ -*-===// erichkeane wrote: Wasn't there some discussion on the last patch about the header not containing certain info? I see this has the top level header, and the above

[clang] [compiler-rt] [llvm] [ubsan] Add runtime test for -fsanitize=local-bounds (PR #120038)

2024-12-18 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/120038 >From b42a2ec4a07d94c6c0d73d4baedf2ffef3d3825c Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Sun, 15 Dec 2024 21:24:50 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Eli Friedman (efriedma-quic) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/120494.diff 2 Files Affected: - (modified) clang/bindings/python/clang/cindex.py (+78) - (modified) clang/bindings/python/tests/cindex/test_

[clang] 7eaf470 - [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (#120464)

2024-12-18 Thread via cfe-commits
Author: Thurston Dang Date: 2024-12-18T15:36:12-08:00 New Revision: 7eaf4708098c216bf432fc7e0bc79c3771e793a4 URL: https://github.com/llvm/llvm-project/commit/7eaf4708098c216bf432fc7e0bc79c3771e793a4 DIFF: https://github.com/llvm/llvm-project/commit/7eaf4708098c216bf432fc7e0bc79c3771e793a4.diff

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond closed https://github.com/llvm/llvm-project/pull/120464 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [ubsan] Add runtime test for -fsanitize=local-bounds (PR #120038)

2024-12-18 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/120038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/120494 None >From 8f2e784333ed7cdd746dd408b18c2f12297378fe Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPol

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread David Olsen via cfe-commits
@@ -129,4 +130,224 @@ def PrimitiveInt : AnyTypeOf<[UInt8, UInt16, UInt32, UInt64, SInt8, SInt16, SInt32, SInt64], "primitive int", "::cir::IntType">; +//===--===// +// FloatType +//===

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-18 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 07e053fb95e131244dafab04aae84650de383664...8f2e784333ed7cdd746dd408b18c2f12297378fe clang

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/120464 >From 2c0da9aa6f58900387fa91cdc6bcb41e0235d94c Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 18 Dec 2024 18:37:11 + Subject: [PATCH 01/19] [ubsan] Add -fsanitize-nonmerged-handlers (and -fno-san

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread David Olsen via cfe-commits
@@ -0,0 +1,52 @@ +//===- CIRFPTypeInterface.td - CIR FP Interface Definitions -*- C++ -*-===// dkolsen-pgi wrote: You're right. The updated guidelines say that this line doesn't need to contain any useful information. I'll remove it. https://github.com/

[clang] [clang codegen] Emit !unpredictable metadata more consistently. (PR #111065)

2024-12-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Would this have value with a release note? Perhaps mention what we can do 'better' because of it? https://github.com/llvm/llvm-project/pull/111065 ___ cfe-commits mailing list cfe-commits@list

[clang] ef95590 - [Coverage] Resurrect Branch:FalseCnt in SwitchStmt that was pruned in #112694 (#120418)

2024-12-18 Thread via cfe-commits
Author: NAKAMURA Takumi Date: 2024-12-19T08:41:07+09:00 New Revision: ef955908302b6a6170e9775d89a94846fde12ebf URL: https://github.com/llvm/llvm-project/commit/ef955908302b6a6170e9775d89a94846fde12ebf DIFF: https://github.com/llvm/llvm-project/commit/ef955908302b6a6170e9775d89a94846fde12ebf.dif

[clang] [Coverage] Resurrect Branch:FalseCnt in SwitchStmt that was pruned in #112694 (PR #120418)

2024-12-18 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/120418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/120494 >From ec604efdae3e05bf14ade994cbc7d0f1acebd1c6 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Dec 2024 15:25:00 -0800 Subject: [PATCH] [libclang/python] Add python bindings for PrintingPolicy -

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread David Olsen via cfe-commits
@@ -18,6 +21,87 @@ mlir::MLIRContext &CIRGenTypes::getMLIRContext() const { return *builder.getContext(); } +/// Return true if the specified type in a function parameter or result position +/// can be converted to a CIR type at this point. This boils down to being +/// whe

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

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

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-sles-build-only` running on `rocm-worker-hw-04-sles` while building `clang` at step 6 "Add check check-clang". Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/13376 Here is

[clang] 2691b96 - Revert "[ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (#120464)"

2024-12-18 Thread Thurston Dang via cfe-commits
Author: Thurston Dang Date: 2024-12-18T23:50:01Z New Revision: 2691b964150c77a9e6967423383ad14a7693095e URL: https://github.com/llvm/llvm-project/commit/2691b964150c77a9e6967423383ad14a7693095e DIFF: https://github.com/llvm/llvm-project/commit/2691b964150c77a9e6967423383ad14a7693095e.diff LOG:

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread David Olsen via cfe-commits
@@ -133,6 +143,276 @@ IntType::verify(llvm::function_ref emitError, return mlir::success(); } +//===--===// +// Floating-point type definitions +//===

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -129,4 +130,224 @@ def PrimitiveInt : AnyTypeOf<[UInt8, UInt16, UInt32, UInt64, SInt8, SInt16, SInt32, SInt64], "primitive int", "::cir::IntType">; +//===--===// +// FloatType +//===

[clang] [ubsan] Add -fsanitize-merge (and -fno-sanitize-merge) (PR #120464)

2024-12-18 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-cmake-x86_64-avx512-linux` running on `avx512-intel64` while building `clang` at step 7 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/133/builds/8646 Here is the relevant pie

[clang] [CIR] floating-point, pointer, and function types (PR #120484)

2024-12-18 Thread Erich Keane via cfe-commits
@@ -0,0 +1,52 @@ +//===- CIRFPTypeInterface.td - CIR FP Interface Definitions -*- C++ -*-===// erichkeane wrote: If you would, please audit the rest of the files that get added, I thought I noticed it a few places scrolling through. https://github.com/llvm

<    1   2   3   4   5   6   >