[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-02-28 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/129370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-02-28 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/129370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC] Update CoverageMapping tests (PR #125404)

2025-02-28 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-asan` running on `sanitizer-buildbot8` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/24/builds/5832 Here is the releva

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-02-28 Thread David Rivera via cfe-commits
https://github.com/RiverDave created https://github.com/llvm/llvm-project/pull/129370 This aims to address a portion of #122480 by adding matchers on binary operators. **This allows explicit arithmetic operations within initializers.** ### Note I'm aware of the other false-negatives presented

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-02-28 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll @LecrisUT what else do you think needs to be done here to get this approved? https://github.com/llvm/llvm-project/pull/125806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang-format] Don't sort includes for C# (PR #129369)

2025-02-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fixes #106194 --- Full diff: https://github.com/llvm/llvm-project/pull/129369.diff 2 Files Affected: - (modified) clang/lib/Format/Format.cpp (+2-1) - (modified) clang/unittests/Format/SortIncludesTest.

[clang] [clang-format] Don't sort includes for C# (PR #129369)

2025-02-28 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/129369 Fixes #106194 >From 38f6c5e4509ba3420aeb69661c764d037bc0 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 28 Feb 2025 23:50:04 -0800 Subject: [PATCH] [clang-format] Don't sort includes for C# Fixes #10619

[clang] [MC/DC] Refactor MCDC::State::Decision. NFC. (PR #125408)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/125408 >From a6d4be0e4b05b411c7160385485cfed0f173965c Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 2 Feb 2025 21:55:43 +0900 Subject: [PATCH 1/4] [MC/DC] Update CoverageMapping tests To resolve the error,

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-02-28 Thread Pedro Miguel Justo via cfe-commits
pmsjt wrote: https://learn.microsoft.com/en-us/cpp/build/exception-handling-x64?view=msvc-170#chained-unwind-info-structures I don't know what an "atend" is, but what you are describing doesn't seem to be a possible solution. Epilogs must be present in the main function entry. Only the main fu

[clang] [MC/DC] Enable usage of `!` among `&&` and `||` (PR #125406)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/125406 >From a6d4be0e4b05b411c7160385485cfed0f173965c Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 2 Feb 2025 21:55:43 +0900 Subject: [PATCH 1/4] [MC/DC] Update CoverageMapping tests To resolve the error,

[clang] [MC/DC] Handle __builtin_expect as if parenthses (PR #125405)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/125405 >From a6d4be0e4b05b411c7160385485cfed0f173965c Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 2 Feb 2025 21:55:43 +0900 Subject: [PATCH 1/3] [MC/DC] Update CoverageMapping tests To resolve the error,

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] constexpr deque (PR #129367)

2025-02-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libcxx Author: Nhat Nguyen (changkhothuychung) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/129367.diff 1 Files Affected: - (modified) libcxx/include/deque (+6-5) ``diff diff --git a/libcxx/include/deque b/libcxx/incl

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] constexpr deque (PR #129367)

2025-02-28 Thread Nhat Nguyen via cfe-commits
https://github.com/changkhothuychung closed https://github.com/llvm/llvm-project/pull/129367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC] Handle __builtin_expect as if parenthses (PR #125405)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/125405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC] Enable usage of `!` among `&&` and `||` (PR #125406)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/125406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC] Update CoverageMapping tests (PR #125404)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/125404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cab738b - [MC/DC] Update CoverageMapping tests (#125404)

2025-02-28 Thread via cfe-commits
Author: NAKAMURA Takumi Date: 2025-03-01T15:58:39+09:00 New Revision: cab738bea1a6d06c6aaebc0e9ad5954a2c5c1e0b URL: https://github.com/llvm/llvm-project/commit/cab738bea1a6d06c6aaebc0e9ad5954a2c5c1e0b DIFF: https://github.com/llvm/llvm-project/commit/cab738bea1a6d06c6aaebc0e9ad5954a2c5c1e0b.dif

[clang] [MC/DC] Update CoverageMapping tests (PR #125404)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/125404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC] Update CoverageMapping tests (PR #125404)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/125404 >From a6d4be0e4b05b411c7160385485cfed0f173965c Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 2 Feb 2025 21:55:43 +0900 Subject: [PATCH 1/2] [MC/DC] Update CoverageMapping tests To resolve the error,

[clang] [MC/DC] Refactor MCDC::State::Decision. NFC. (PR #125408)

2025-02-28 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/125408 >From d414f29ed8732c77fdcd05cc3b066e9ee0d9de07 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 2 Feb 2025 21:59:33 +0900 Subject: [PATCH 1/2] [MC/DC] Refactor MCDC::State::Decision. NFC. Introduce `ID

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-02-28 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: So if an unwind table has an epilog opcode, and you chain another unwind table to it, the chained unwind table inherits the epilog opcode? You could use that. The primary unwind table ends at the first epilog, you mark it with an "atend" epilog opcode. The next region sta

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread via cfe-commits
choikwa wrote: > clang should never emit a call to an ocml function Would IR body of the ocml function be a suitable replacement to emit (for now)? I understand once we have libm/libc implementation, clang can decide between the two. https://github.com/llvm/llvm-project/pull/129347 __

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-28 Thread Nhat Nguyen via cfe-commits
https://github.com/changkhothuychung updated https://github.com/llvm/llvm-project/pull/120920 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread via cfe-commits
https://github.com/choikwa created https://github.com/llvm/llvm-project/pull/129347 …__builtin_scalbn Clang generates library calls for __builtin_* functions which can be a problem for GPUs that cannot handle them. This patch generates a call to device implementation for __builtin_logb and an

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-02-28 Thread Pedro Miguel Justo via cfe-commits
pmsjt wrote: > How do epilogs work in chained unwind tables? Do the epilog opcodes from the > original table get ignored? They are additive. When execution is on a fragment, it is assumed that all unwind opcodes from the parent fragment(s), all the way to the principal fragment, are already a

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-28 Thread Nhat Nguyen via cfe-commits
@@ -0,0 +1,646 @@ +// -*- C++ -*- +//===--===// +// +// 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

[clang] [Clang] Check for uninitialized use in lambda within CXXOperatorCallExpr (PR #129198)

2025-02-28 Thread via cfe-commits
@@ -12806,6 +12810,19 @@ namespace { HandleValue(Arg->IgnoreParenImpCasts()); } +void VisitLambdaExpr(LambdaExpr *E) { + if (!isInCXXOperatorCall) { +Inherited::VisitLambdaExpr(E); +return; + } + + for (const auto &init : E->captu

[clang] [Clang] Check for uninitialized use in lambda within CXXOperatorCallExpr (PR #129198)

2025-02-28 Thread via cfe-commits
@@ -12806,6 +12810,19 @@ namespace { HandleValue(Arg->IgnoreParenImpCasts()); } +void VisitLambdaExpr(LambdaExpr *E) { + if (!isInCXXOperatorCall) { +Inherited::VisitLambdaExpr(E); +return; + } + + for (const auto &init : E->captu

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm requested changes to this pull request. clang should never emit a call to an ocml function https://github.com/llvm/llvm-project/pull/129347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [Clang] Check for uninitialized use in lambda within CXXOperatorCallExpr (PR #129198)

2025-02-28 Thread via cfe-commits
https://github.com/zhaohuiw42 updated https://github.com/llvm/llvm-project/pull/129198 >From 6667d8b34a2d33b1e0b2f56466cac558d13cbf80 Mon Sep 17 00:00:00 2001 From: zhaohui Date: Fri, 28 Feb 2025 14:12:39 +0800 Subject: [PATCH] [Clang] Check for uninitialized use in lambda within CXXOperatorCa

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I would have preferred to do the overloads in the target specific header > file, but __builtin_* methods couldn't be overloaded. I noticed that hip math > header already overloads 'double logb(double)' by calling ocml version, so I > mirrored that in clang. If there is better

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread via cfe-commits
choikwa wrote: I would have preferred to do the overloads in the target specific header file, but __builtin_* methods couldn't be overloaded. I noticed that hip math header already overloads 'double logb(double)' by calling ocml version, so I mirrored that in clang. If there is better approac

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > The motivation came from CUDA cccl code containing __builtin_logb and > __builtin_scalbn and being able to handle them. In my ideal world, unhandled builtins would be lowered before the linker and we'd have a working library called `libm.a` that matches the platform. https://

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread via cfe-commits
choikwa wrote: The motivation came from CUDA cccl code containing __builtin_logb and __builtin_scalbn and being able to handle them. https://github.com/llvm/llvm-project/pull/129347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Yaxun Liu via cfe-commits
@@ -32,22 +32,24 @@ public: template class B; } -// The implicit host/device attrs of virtual dtor B::~B() is inferred to -// have implicit device attr since dtors of its members and parent classes can -// be executed on device. This causes a diagnostic since B::~B() must -//

[clang] [clang] Pass fp128 indirectly and return in xmm0 on Windows (PR #115052)

2025-02-28 Thread Trevor Gross via cfe-commits
tgross35 wrote: Thanks for answering that question, I wouldn't have had a good answer outside of consistency. Does mid-level optimizations refer to optimizations done in Clang rather than in LLVM? Somebody will need to land this for me, the two commits should come separate (first is NFC). >

[clang] [clang] Pass fp128 indirectly and return in xmm0 on Windows (PR #115052)

2025-02-28 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/115052 >From 6afdfd07a22260914b45363870a7be54324bd736 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 5 Nov 2024 07:00:35 -0500 Subject: [PATCH 1/2] [clang] Add fp128 ABI tests for MinGW (NFC) Add a test based

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm requested changes to this pull request. We do not and should never emit ocml calls in clang. There is also no reason to ever use scalbn for binary float types, it is identical to llvm.ldexp https://github.com/llvm/llvm-project/pull/129347 _

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp commented: Are there any error conditions that need testing as well? https://github.com/llvm/llvm-project/pull/129334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang-tools-extra] [clang-tidy] warn when `true` is used as a preprocessor keyword in C (PR #128265)

2025-02-28 Thread via cfe-commits
isuckatcs wrote: > Clang-tidy uses clang to process the source file, so any warning implemented > in clang is available to all clang-tidy users regardless of whether they > compile with clang or GCC or something else. A fair point indeed. I'll proceed with option 3 then. https://github.com/ll

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 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 4ab9c13ba2a6f505fb1b72ae33753902ae9f81e8 86deca6179c6dce4490e859ffd536f553d8d6c0d --e

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/129347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread Joseph Huber via cfe-commits
@@ -259,6 +259,26 @@ Value *readX18AsPtr(CodeGenFunction &CGF) { return CGF.Builder.CreateIntToPtr(X18, CGF.Int8PtrTy); } +llvm::Constant *CodeGenModule::getDeviceLibFunction(const FunctionDecl *FD, +unsigned BuiltinID) { +

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: choikwa (choikwa) Changes …__builtin_scalbn Clang generates library calls for __builtin_* functions which can be a problem for GPUs that cannot handle them. This patch generates call to device implement

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-02-28 Thread via cfe-commits
https://github.com/choikwa edited https://github.com/llvm/llvm-project/pull/129347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] warn when `true` is used as a preprocessor keyword in C (PR #128265)

2025-02-28 Thread Richard Smith via cfe-commits
zygoloid wrote: > > 2. Create check that forbids usage of true/false in processor as an > > non-portable thing (could be in portability category) > > 3. Extracting 'true' case from -Wundef into separate warning like > > -Wundef-true > > I like both of these approaches, though I prefer the 2. o

[clang-tools-extra] [clang-tidy] warn when `true` is used as a preprocessor keyword in C (PR #128265)

2025-02-28 Thread Richard Smith via cfe-commits
zygoloid wrote: > 1. Not adding check if -Wundef is sufficient > 2. Create check that forbids usage of true/false in processor as an > non-portable thing (could be in portability category) > 3. Extracting 'true' case from -Wundef into separate warning like -Wundef-true Option 3 seems best to me

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-28 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt closed https://github.com/llvm/llvm-project/pull/128979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] warn when `true` is used as a preprocessor keyword in C (PR #128265)

2025-02-28 Thread Richard Smith via cfe-commits
zygoloid wrote: Perhaps we could split off a warning from `-Wundef` for the specific case where the undefined macro name is `true`, and enable it by default? Doing this in a clang-tidy check seems like the wrong place -- this check is much better suited to being implemented as a compiler warni

[clang] [CIR] Realign CIR-to-LLVM IR lowering code with incubator (PR #129293)

2025-02-28 Thread Erich Keane via cfe-commits
@@ -37,63 +37,78 @@ using namespace llvm; namespace cir { namespace direct { -class CIRAttrToValue : public CirAttrVisitor { +class CIRAttrToValue { public: CIRAttrToValue(mlir::Operation *parentOp, mlir::ConversionPatternRewriter &rewriter,

[clang] [HLSL] Add "or" intrinsic (PR #128979)

2025-02-28 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/128979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] warn when `true` is used as a preprocessor keyword in C (PR #128265)

2025-02-28 Thread via cfe-commits
@@ -0,0 +1,38 @@ +//===--- TrueMacroCheck.h - clang-tidy --*- C++ -*-===// +// +// 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] Fix fp8-init-list.c test failure (PR #129259)

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

[clang] [analyzer] Do list initialization for CXXNewExpr with initializer list arg (PR #127702)

2025-02-28 Thread Michael Flanders via cfe-commits
https://github.com/Flandini edited https://github.com/llvm/llvm-project/pull/127702 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Treat constexpr-unknown value as invalid in `EvaluateAsInitializer` (PR #128409)

2025-02-28 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Here's a testcase that's should generate a diagnostic, but doesn't without this patch: ``` int &ff(); int &x = ff(); constinit int &z = x; ``` Some related testcases are a little weird... consider the following: ``` extern int &x; int &z = x; ``` There's a gap between ch

[clang-tools-extra] [clang-tidy] Add new check `readability-use-numeric-limits` (PR #127430)

2025-02-28 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,84 @@ +// RUN: %check_clang_tidy %s readability-use-numeric-limits %t +#include + +void constants() { + // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: The constant -128 is being utilized. Consider using std::numeric_limits::min() instead [readability-use-numeric-limit

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/129334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/129334 >From ebaef38c40cba83d4b446a5320d57c86038f8286 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Fri, 28 Feb 2025 11:18:03 -0800 Subject: [PATCH 1/3] new max overloads + new min overloads --- clang/lib/Headers/hl

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Sarah Spall via cfe-commits
spall wrote: > Are there any error conditions that need testing as well? I don't think there were error tests for min and max originally. I could add some to make sure things like min(int4, int3) are still now allowed. https://github.com/llvm/llvm-project/pull/129334 __

[clang] [CIR] Upstream floating point literal expressions (PR #129304)

2025-02-28 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/129304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream floating point literal expressions (PR #129304)

2025-02-28 Thread Bruno Cardoso Lopes via cfe-commits
@@ -57,3 +57,15 @@ bool boolfunc() { return true; } // CHECK: %0 = cir.const #true // CHECK: cir.return %0 : !cir.bool // CHECK: } + +float floatfunc() { return 42.42f; } +// CHECK: cir.func @floatfunc() -> !cir.float { +// CHECK: %0 = cir.const #cir.fp<4.242000e+01> : !c

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-02-28 Thread Bruno Cardoso Lopes via cfe-commits
@@ -210,6 +223,193 @@ void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd, llvm_unreachable("Invalid argument to CIRGenModule::emitGlobalDefinition"); } +static bool shouldBeInCOMDAT(CIRGenModule &cgm, const Decl &d) { + assert(!cir::MissingFeatures::supportComdat

[clang] [llvm] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-28 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/128920 >From 2e1946730f7ae2473a4fc94f8918eb3d9d225d17 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Wed, 26 Feb 2025 09:48:46 -0800 Subject: [PATCH 1/3] [memprof] Export __memprof_default_options_str on Darwin ---

[clang] [clang] Pass fp128 indirectly and return in xmm0 on Windows (PR #115052)

2025-02-28 Thread Reid Kleckner via cfe-commits
rnk wrote: If you take the two PRs together, we're going to implement the indirection logic at both the frontend and backend level. If we do it in the backend, I think it's technically necessary to do it in the frontend, but it is consistent with how we handle all other types. I'd like to see

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-02-28 Thread Bruno Cardoso Lopes via cfe-commits
@@ -210,6 +223,193 @@ void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd, llvm_unreachable("Invalid argument to CIRGenModule::emitGlobalDefinition"); } +static bool shouldBeInCOMDAT(CIRGenModule &cgm, const Decl &d) { + assert(!cir::MissingFeatures::supportComdat

[clang] Reapply "[clang][HIP] Make some math not not work with AMDGCN SPIR-V #128360" (PR #129306)

2025-02-28 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-x86_64-debian-dylib` running on `gribozavr4` while building `clang` at step 7 "test-build-unified-tree-check-llvm". Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/20773 Here is the re

[clang] [clang] Pass fp128 indirectly and return in xmm0 on Windows (PR #115052)

2025-02-28 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. https://github.com/llvm/llvm-project/pull/115052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-02-28 Thread Nikita Popov via cfe-commits
nikic wrote: > > > so IIUC !llvm.errno.tbaa should just be a module-level list of > > > int-compatible TBAA nodes. > > > > > > Yes, exactly. It should be a module level MD node, not on individual > > instructions. > > Thank you, I'm updating this. I've been contemplating this, and thought >

[clang] [Clang][diagnostics] Fix structured binding shadows template param loc (PR #129116)

2025-02-28 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/129116 >From ed0cf3f026e439288f8334f27555ad26825fd56a Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Thu, 27 Feb 2025 21:49:32 +0100 Subject: [PATCH 1/3] [Clang][diagnostics] Fix structured binding shadows tem

[clang] [Clang][diagnostics] Fix structured binding shadows template param loc (PR #129116)

2025-02-28 Thread Amr Hesham via cfe-commits
@@ -162,3 +162,10 @@ struct A { }; A<0>::B a; } + +template void shadow() { // expected-note{{template parameter is declared here}} AmrDeveloper wrote: You mean something like 'template void shadow2() { ... }` or creating a sample with function call http

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. I can approve this, though it might be worth considering adding a macro at the top of hlsl_intrinsics.h, along with some of the other macros there, to shrink the change and possibly simplify future changes that need these types of sets of

[clang] [CIR] Realign CIR-to-LLVM IR lowering code with incubator (PR #129293)

2025-02-28 Thread Erich Keane via cfe-commits
@@ -218,12 +221,31 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite( SmallVector attributes; if (init.has_value()) { -GlobalInitAttrRewriter initRewriter(llvmType, rewriter); -init = initRewriter.rewriteInitAttr(init.value()); -// If initRewri

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Sarah Spall via cfe-commits
@@ -131,3 +157,9 @@ double3 test_min_double3(double3 p0, double3 p1) { return min(p0, p1); } // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> @_Z16test_min_double4 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.minnum.v4f64 double4 test_min_dou

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. https://github.com/llvm/llvm-project/pull/128926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Artem Belevich via cfe-commits
@@ -32,22 +32,24 @@ public: template class B; } -// The implicit host/device attrs of virtual dtor B::~B() is inferred to -// have implicit device attr since dtors of its members and parent classes can -// be executed on device. This causes a diagnostic since B::~B() must -//

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
@@ -131,3 +157,9 @@ double3 test_min_double3(double3 p0, double3 p1) { return min(p0, p1); } // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> @_Z16test_min_double4 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.minnum.v4f64 double4 test_min_dou

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Sarah Spall via cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/129334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Sarah Spall via cfe-commits
@@ -1678,6 +1678,30 @@ half3 max(half3, half3); _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) _HLSL_BUILTIN_ALIAS(__builtin_elementwise_max) half4 max(half4, half4); +_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) +constexpr half2 max(half2 p0, half p1) { spall wrote:

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Sarah Spall via cfe-commits
@@ -1678,6 +1678,30 @@ half3 max(half3, half3); _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) _HLSL_BUILTIN_ALIAS(__builtin_elementwise_max) half4 max(half4, half4); +_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) +constexpr half2 max(half2 p0, half p1) { spall wrote:

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
@@ -1678,6 +1678,30 @@ half3 max(half3, half3); _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) _HLSL_BUILTIN_ALIAS(__builtin_elementwise_max) half4 max(half4, half4); +_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) +constexpr half2 max(half2 p0, half p1) { bob80905 wro

[clang] [Clang] Treat constexpr-unknown value as invalid in `EvaluateAsInitializer` (PR #128409)

2025-02-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I get that we are allowing constexpr unknown values into codegen and that is a mistake but I don't totally follow the fix. Can you go into more details? If I am reading the code correctly there should be some constexpr cases that generate a diagnostic, can

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Sarah Spall (spall) Changes Add additional overloads for min and max to support min(vector, T) and min(T, vector) max(vector, T) and max(T, vector) Add tests Closes #128231 --- Patch is 29.15 KiB, truncated to 2

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Sarah Spall via cfe-commits
https://github.com/spall created https://github.com/llvm/llvm-project/pull/129334 Add additional overloads for min and max to support min(vector, T) and min(T, vector) max(vector, T) and max(T, vector) Add tests Closes #128231 >From ebaef38c40cba83d4b446a5320d57c86038f8286 Mon Sep 17 00:00:00

[clang] Reapply "[clang][HIP] Make some math not not work with AMDGCN SPIR-V #128360" (PR #129306)

2025-02-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx closed https://github.com/llvm/llvm-project/pull/129306 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Artem Belevich via cfe-commits
@@ -32,22 +32,24 @@ public: template class B; } -// The implicit host/device attrs of virtual dtor B::~B() is inferred to -// have implicit device attr since dtors of its members and parent classes can -// be executed on device. This causes a diagnostic since B::~B() must -//

[clang] [CIR] Realign CIR-to-LLVM IR lowering code with incubator (PR #129293)

2025-02-28 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/129293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a19e685 - [CIR] Realign CIR-to-LLVM IR lowering code with incubator (#129293)

2025-02-28 Thread via cfe-commits
Author: Andy Kaylor Date: 2025-02-28T14:43:39-08:00 New Revision: a19e685ea228ec367a7fa01bbf811c3cded37a83 URL: https://github.com/llvm/llvm-project/commit/a19e685ea228ec367a7fa01bbf811c3cded37a83 DIFF: https://github.com/llvm/llvm-project/commit/a19e685ea228ec367a7fa01bbf811c3cded37a83.diff L

[clang] Add `pragma clang scope [push|pop]` (PR #121025)

2025-02-28 Thread Michael Spencer via cfe-commits
@@ -254,7 +285,7 @@ void Preprocessor::updateModuleMacroInfo(const IdentifierInfo *II, } void Preprocessor::dumpMacroInfo(const IdentifierInfo *II) { - ArrayRef Leaf; + ArrayRef Leaf; Bigcheese wrote: This patch has a bunch of unrelated formatting changes,

[clang] [CIR] Realign CIR-to-LLVM IR lowering code with incubator (PR #129293)

2025-02-28 Thread Erich Keane via cfe-commits
@@ -218,12 +221,31 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite( SmallVector attributes; if (init.has_value()) { -GlobalInitAttrRewriter initRewriter(llvmType, rewriter); -init = initRewriter.rewriteInitAttr(init.value()); -// If initRewri

[clang] [Sema] Instantiate destructors for initialized anonymous union fields (PR #128866)

2025-02-28 Thread Eli Friedman via cfe-commits
@@ -5451,10 +5451,23 @@ bool Sema::SetCtorInitializers(CXXConstructorDecl *Constructor, bool AnyErrors, NumInitializers * sizeof(CXXCtorInitializer*)); Constructor->setCtorInitializers(baseOrMemberInitializers); +SourceLocation Location = Constructor->getLo

[clang] Add `pragma clang scope [push|pop]` (PR #121025)

2025-02-28 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Given that some `#pragma`s also impact Sema things, I think `scope` is a bit confusing for what it applies to. I think something like `macro_scope` would be a better name. As for the extension itself, I think it could be useful, but I'm not sure how our language extension pol

[clang] [ubsan] Remove -fsanitizer=vptr from -fsanitizer=undefined (PR #121115)

2025-02-28 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/121115 >From bca319184733b4bad1eb6b83aaac18a75be40b8c Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 25 Dec 2024 14:22:10 -0800 Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?

[clang] [llvm] [Clang][LLVM] Implement single-single vectors MOP4{A/S} (PR #127797)

2025-02-28 Thread via cfe-commits
@@ -376,6 +376,24 @@ let SMETargetGuard = "sme2" in { // Outer product and accumulate/subtract // +multiclass MOP4 checks> { + def NAME # "_1x1" : Inst<"svmop4" # name # "_1x1_" # n # "[_{d}_{d}]", "vidd", t, MergeNone, i # wide # "_1x1", [IsInOutZA, IsStreaming], checks>; -

[clang] 56cc929 - [CIR] Upstream func args alloca handling (#129167)

2025-02-28 Thread via cfe-commits
Author: Andy Kaylor Date: 2025-02-28T11:43:53-08:00 New Revision: 56cc9299b7804257549edb4a7ba15999cbb5 URL: https://github.com/llvm/llvm-project/commit/56cc9299b7804257549edb4a7ba15999cbb5 DIFF: https://github.com/llvm/llvm-project/commit/56cc9299b7804257549edb4a7ba15999cbb5.diff L

[clang] [CIR] Upstream floating point literal expressions (PR #129304)

2025-02-28 Thread Andy Kaylor via cfe-commits
@@ -57,3 +57,15 @@ bool boolfunc() { return true; } // CHECK: %0 = cir.const #true // CHECK: cir.return %0 : !cir.bool // CHECK: } + +float floatfunc() { return 42.42f; } +// CHECK: cir.func @floatfunc() -> !cir.float { +// CHECK: %0 = cir.const #cir.fp<4.242000e+01> : !c

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Yaxun Liu via cfe-commits
@@ -32,22 +32,24 @@ public: template class B; } -// The implicit host/device attrs of virtual dtor B::~B() is inferred to -// have implicit device attr since dtors of its members and parent classes can -// be executed on device. This causes a diagnostic since B::~B() must -//

[clang-tools-extra] [clang-tidy] Add new check `readability-use-numeric-limits` (PR #127430)

2025-02-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/127430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Realign CIR-to-LLVM IR lowering code with incubator (PR #129293)

2025-02-28 Thread Andy Kaylor via cfe-commits
@@ -218,12 +221,31 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite( SmallVector attributes; if (init.has_value()) { -GlobalInitAttrRewriter initRewriter(llvmType, rewriter); -init = initRewriter.rewriteInitAttr(init.value()); -// If initRewri

[clang-tools-extra] [clang-tidy] Fix invalid fixit from modernize-use-ranges for nullptr used with std::unique_ptr (PR #127162)

2025-02-28 Thread via cfe-commits
https://github.com/Andrewyuan34 updated https://github.com/llvm/llvm-project/pull/127162 >From 09b809d803ca319f194eba6b6d8a78fa6dbbf9f3 Mon Sep 17 00:00:00 2001 From: Andrewyuan34 Date: Thu, 13 Feb 2025 22:35:36 -0500 Subject: [PATCH] [clang-tidy] Fix invalid fixit from modernize-use-ranges for

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-02-28 Thread Eli Friedman via cfe-commits
@@ -500,7 +500,8 @@ MCSymbol *MCStreamer::emitLineTableLabel() { MCSymbol *MCStreamer::emitCFILabel() { // Return a dummy non-null value so that label fields appear filled in when // generating textual assembly. - return (MCSymbol *)1; + static size_t DummyLabelValue = 0;

  1   2   3   4   >