[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81014 >From 5ba669011752b6ea6e6fe5f6141c4af66ca7ccbf Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 7 Feb 2024 17:25:10 +0100 Subject: [PATCH 01/10] [Clang] Parsing and Sema for C++23's `assume` attribute --- cl

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
erichkeane wrote: Also note, we need to update the feature-test-macro/has_attribute-expr here. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

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

2024-02-07 Thread James Y Knight via cfe-commits
jyknight wrote: > > > > So, alternatively...we could just go with the simplest solution, and > > > > use "ieee" as the default even under -ffast-math. > > > > > > +1. **There hasn't been a performance reason to use FTZ/DAZ since ~2011.** > > Maybe there's still a power benefit? But in that ca

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -2466,6 +2504,15 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { case CK_IntToOCLSampler: return CGF.CGM.createOpenCLIntToSamplerConversion(E, CGF); + case CK_HLSLVectorTruncation: { +assert(DestTy->isVectorType() && "Expected dest type to be vector ty

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -2414,9 +2420,41 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return EmitScalarConversion(Visit(E), E->getType(), DestTy, CE->getExprLoc(), Opts); } - case CK_IntegralToFloating: - case CK_FloatingToIntegral: - case CK_F

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -361,6 +361,9 @@ CAST_OPERATION(AddressSpaceConversion) // Convert an integer initializer to an OpenCL sampler. CAST_OPERATION(IntToOCLSampler) +// Truncate a vector type (HLSL only). +CAST_OPERATION(HLSLVectorTruncation) llvm-beanz wrote: Yea... HLSL has

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -1843,13 +1843,86 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, return true; } +/// Determine whether the conversion from FromType to ToType is a valid +/// floating point conversion. +/// +static bool IsFloatingPointConversion(Sema &S, QualType

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

2024-02-07 Thread Daniel Rodríguez Troitiño via cfe-commits
drodriguez wrote: > But after taking a quick look, my impression is that this change reverses the > bug fixed in #70817. > > To recap, that PR preferred the C++ headers available in the toolchain > distribution over the SDK headers, when the compiler was launched via a > symbolic link to the

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
Sirraide wrote: > Also note, we need to update the feature-test-macro/has_attribute-expr here. I’ve already added a check for `__has_cpp_attribute` to one of the tests. `__has_attribute(assume)` already evaluates to `1` even without this pr, likely because of `clang::assume`, but I can add a t

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
cor3ntin wrote: Thanks for working on that. GCC does checks assumption in constant evaluation. I think we should too. My main question is whether we think supporting `assume` in the front-end is going to be a net positive knowing that the backend is going to pessimize some use of the attribut

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

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

2024-02-07 Thread Daniel Rodríguez Troitiño via cfe-commits
drodriguez wrote: > With that being said, can you clarify what you mean by "ignoring the > command-line option", and can you expand on why the current state of upstream > Clang is broken in your opinion? But for productivity's sake, let's take for > granted that the canonical state is upstream

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
Sirraide wrote: > We have 2 options: > > * Wait for llvm to get improve their handling of assumption based > optimizations. > * Proceed with this work hoping this encourages work on the optimizer. The standard also mentions that `__has_cpp_attribute` should return `0` ‘if an implementation do

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
Sirraide wrote: > GCC does checks assumption in constant evaluation. I think we should too. I’ll look into it in that case. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [Clang] Fixes of builtins definitions after PR #68324. (PR #81022)

2024-02-07 Thread via cfe-commits
michele-scandale wrote: There are still some differences that I haven't addressed here as they might be ok to have: * `__builtin_rint{,f,l}` were defined with the `const` attribute, now they use the `const when FP exceptions are ignored` -- this seems due to the definition of these has been me

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > The build is failing because of a formatting error which I don't think is > related to the changes that I made. Any thoughts as to why it is failing? That's unrelated, I'll fix it. https://github.com/llvm/llvm-project/pull/81015 ___

[clang] 347ab99 - [Clang][Docs] Fix trailing whitespace warnings

2024-02-07 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-02-07T13:03:31-06:00 New Revision: 347ab99a5c6d096beb7378794c6255dca2a866e6 URL: https://github.com/llvm/llvm-project/commit/347ab99a5c6d096beb7378794c6255dca2a866e6 DIFF: https://github.com/llvm/llvm-project/commit/347ab99a5c6d096beb7378794c6255dca2a866e6.diff

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
erichkeane wrote: > > We have 2 options: > > > > * Wait for llvm to get improve their handling of assumption based > > optimizations. > > * Proceed with this work hoping this encourages work on the optimizer. > > The standard also mentions that `__has_cpp_attribute` should return `0` ‘if > an

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Aaron Ballman via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81015 >From c8ada809964eac64f6cb0c103593748b86932163 Mon Sep 17 00:00:00 2001 From: Sh0g0-1758 Date: Wed, 7 Feb 2024 21:11:58 +0530 Subject: [PATCH 1/5] Add a Null Check --- clang/lib/Sema/SemaOpenMP.cpp | 2 ++ 1 fi

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/80171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81015 >From ed6b669d7d427f2cb4d87f9d4a8063e1b919fc03 Mon Sep 17 00:00:00 2001 From: Sh0g0-1758 Date: Wed, 7 Feb 2024 21:11:58 +0530 Subject: [PATCH 1/5] Add a Null Check --- clang/lib/Sema/SemaOpenMP.cpp | 2 ++ 1 fi

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81014 >From 5ba669011752b6ea6e6fe5f6141c4af66ca7ccbf Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 7 Feb 2024 17:25:10 +0100 Subject: [PATCH 01/11] [Clang] Parsing and Sema for C++23's `assume` attribute --- cl

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

2024-02-07 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > Just to be clear: I'm not proposing entirely eliminating the "link against > crtfastmath.o" behavior, when linking a binary with `-ffast-math` (though, > separately from _this_ review, that may be worth considering!). I only meant > we should stop attempting to infer anythi

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
Sirraide wrote: > > GCC does checks assumption in constant evaluation. I think we should too. > > I’ll look into it in that case. Alright, this should be done now. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commi

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/81014 >From 5ba669011752b6ea6e6fe5f6141c4af66ca7ccbf Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 7 Feb 2024 17:25:10 +0100 Subject: [PATCH 01/12] [Clang] Parsing and Sema for C++23's `assume` attribute --- cl

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread via cfe-commits
Sirraide wrote: > I think the confusion/conflict between this and clang::assume needs to be > figured out. These two should just be, as close as possible, spellings of the > same thing. Well, apparently, `clang::assume` always takes a string and is meant for OMP assumptions, so one solution w

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80171 >From 8e3524f7d4a88a7b868dc3d69bf63a5708db6a1f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 31 Jan 2024 11:09:11 -0500 Subject: [PATCH 1/3] [Clang][Sema] Diagnose friend declarations with enum

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80171 >From 8e3524f7d4a88a7b868dc3d69bf63a5708db6a1f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 31 Jan 2024 11:09:11 -0500 Subject: [PATCH 1/3] [Clang][Sema] Diagnose friend declarations with enum

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

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

2024-02-07 Thread Erick Velez via cfe-commits
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/80801 >From fd07c0a15eb45c3e7eb400026ea7702ae909a11e Mon Sep 17 00:00:00 2001 From: Erick Velez Date: Mon, 5 Feb 2024 21:26:07 -0800 Subject: [PATCH 1/2] [clang] require template arg list after template kw Require a t

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Shourya Goel via cfe-commits
Sh0g0-1758 wrote: Great, pre-commits tests passed. https://github.com/llvm/llvm-project/pull/81015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b89eb97 - [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (#81015)

2024-02-07 Thread via cfe-commits
Author: Shourya Goel Date: 2024-02-07T13:38:22-06:00 New Revision: b89eb9790a8962ca634965d05491a93c58773faf URL: https://github.com/llvm/llvm-project/commit/b89eb9790a8962ca634965d05491a93c58773faf DIFF: https://github.com/llvm/llvm-project/commit/b89eb9790a8962ca634965d05491a93c58773faf.diff

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

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

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (#55106) (PR #81030)

2024-02-07 Thread Cooper Partin via cfe-commits
https://github.com/coopp created https://github.com/llvm/llvm-project/pull/81030 None >From eb6c7e6e9d4ccaf6e63714d2d94a518cc00bcc82 Mon Sep 17 00:00:00 2001 From: Cooper Partin Date: Wed, 7 Feb 2024 11:32:56 -0800 Subject: [PATCH] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline f

[clang] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (#55106) (PR #81030)

2024-02-07 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] [DirectX] Fix HLSL bitshifts to leverage the OpenCL pipeline for bitshifting (#55106) (PR #81030)

2024-02-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Cooper Partin (coopp) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/81030.diff 2 Files Affected: - (modified) clang/lib/CodeGen/CGExprScalar.cpp (+2-2) - (added) clang/test/CodeGenHLSL/shift-mask.hlsl (+35)

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RFC][WIP][AMDGPU] Use `bf16` instead of `i16` for bfloat (PR #80908)

2024-02-07 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/80908 >From a535bf3e8cd9b10d87281f94fed68fc300f3e24c Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Wed, 7 Feb 2024 14:43:24 -0500 Subject: [PATCH] [RFC][WIP][AMDGPU] Use `bf16` instead of `i16` for bfloat Currentl

[clang] [llvm] [RFC][WIP][AMDGPU] Use `bf16` instead of `i16` for bfloat (PR #80908)

2024-02-07 Thread Shilei Tian via cfe-commits
@@ -1562,8 +1562,9 @@ bool IRTranslator::translateBitCast(const User &U, bool IRTranslator::translateCast(unsigned Opcode, const User &U, MachineIRBuilder &MIRBuilder) { - if (U.getType()->getScalarType()->isBFloatTy() || - U.getOperand(0

[clang] [Clang][OpenMP] Add a NULL check (PR #77131)

2024-02-07 Thread Shilei Tian via cfe-commits
https://github.com/shiltian closed https://github.com/llvm/llvm-project/pull/77131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenMP] Add a NULL check (PR #77131)

2024-02-07 Thread Shilei Tian via cfe-commits
shiltian wrote: This has been fixed by #81015. https://github.com/llvm/llvm-project/pull/77131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-02-07 Thread Jun Wang via cfe-commits
@@ -605,12 +606,197 @@ class SIGfx12CacheControl : public SIGfx11CacheControl { bool IsNonTemporal) const override; }; +class SIPreciseMemorySupport { jwanggit86 wrote: Ok, will merge with CacheControl. https://github.co

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

2024-02-07 Thread Jun Wang via cfe-commits
@@ -605,12 +606,197 @@ class SIGfx12CacheControl : public SIGfx11CacheControl { bool IsNonTemporal) const override; }; +class SIPreciseMemorySupport { +protected: + const GCNSubtarget &ST; + const SIInstrInfo *TII = nullptr; + + IsaVers

[clang] [llvm] [BPF] add cast_{user,kern} instructions (PR #79902)

2024-02-07 Thread via cfe-commits
https://github.com/eddyz87 updated https://github.com/llvm/llvm-project/pull/79902 >From 1be5c52fa95455d725d8f921fd23215e55989442 Mon Sep 17 00:00:00 2001 From: Eduard Zingerman Date: Fri, 26 Jan 2024 04:18:32 +0200 Subject: [PATCH 1/4] [BPF] Add cast_{user,kern} instructions This commit aims

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Aaron Ballman via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [clang-format] Add Leave to AlwaysBreakTemplateDeclarations (PR #80569)

2024-02-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/80569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/81033 Summary; The LLVM C library currently uses `nanosleep` in the RPC interface and for the C library `nanosleep` function. We build the LLVM C library for every single NVPTX architecture individually currently, which

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-07 Thread Dinar Temirbulatov via cfe-commits
@@ -3717,6 +3717,30 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def warn_sme_streaming_caller_pass_args_t

[clang] [analyzer] Improve handling of unsigned values in ArrayBoundCheckerV2 (PR #81034)

2024-02-07 Thread via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/81034 A memory access is an out of bounds error if the offset is < the extent of the memory region. Notice that here "<" is a _mathematical_ comparison between two numbers and NOT a C/C++ operator that compares two

[clang] [analyzer] Improve handling of unsigned values in ArrayBoundCheckerV2 (PR #81034)

2024-02-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (NagyDonat) Changes A memory access is an out of bounds error if the offset is < the extent of the memory region. Notice that here "<" is a _mathematical_ comparison between two numbers an

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/80069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Improve handling of unsigned values in ArrayBoundCheckerV2 (PR #81034)

2024-02-07 Thread via cfe-commits
NagyDonat wrote: I found _yet another_ situation where unsigned numbers cause stupid errors in the analyzer. This patch is a conservative, minimal solution to "plug the hole", but perhaps it would be better to eliminate unsigned numbers from the out-of-bound calculations and ensure that all co

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
@@ -0,0 +1,83 @@ +// RUN: echo "int main() { return __builtin_cpu_is(\"ppc970\");}" > %t.c +// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s \ +// RUN: --check-prefix=CHECKBOOL + +// RUN: echo "int main() { return __builtin_cpu_is(\"ppc-cel

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
@@ -126,4 +126,57 @@ PPC_LNX_CPU("power10",47) #undef PPC_LNX_DEFINE_OFFSETS #undef PPC_LNX_FEATURE #undef PPC_LNX_CPU + +// Definition of following value are found in the AIX header file +#ifndef AIX_POWERPC_SYS_CONF +#define AIX_POWERPC_SYS_CONF amy-kwan wro

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
@@ -16542,22 +16542,75 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID, Intrinsic::ID ID = Intrinsic::not_intrinsic; +#include "llvm/TargetParser/PPCTargetParser.def" + auto GetOpRes = [&](Value *FieldValue, unsigned Mask, unsigned Op, +

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
@@ -126,4 +126,57 @@ PPC_LNX_CPU("power10",47) #undef PPC_LNX_DEFINE_OFFSETS #undef PPC_LNX_FEATURE #undef PPC_LNX_CPU + +// Definition of following value are found in the AIX header file +#ifndef AIX_POWERPC_SYS_CONF +#define AIX_POWERPC_SYS_CONF +#define AIX_SYSCON_IMPL_IDX

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
@@ -16542,22 +16542,75 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID, Intrinsic::ID ID = Intrinsic::not_intrinsic; +#include "llvm/TargetParser/PPCTargetParser.def" + auto GetOpRes = [&](Value *FieldValue, unsigned Mask, unsigned Op, +

[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

2024-02-07 Thread Amy Kwan via cfe-commits
@@ -126,4 +126,57 @@ PPC_LNX_CPU("power10",47) #undef PPC_LNX_DEFINE_OFFSETS #undef PPC_LNX_FEATURE #undef PPC_LNX_CPU + +// Definition of following value are found in the AIX header file +#ifndef AIX_POWERPC_SYS_CONF +#define AIX_POWERPC_SYS_CONF +#define AIX_SYSCON_IMPL_IDX

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

2024-02-07 Thread Artem Belevich via cfe-commits
Artem-B wrote: > This patch, which simply makes it legal on all architectures but do nothing > is it's older than sm_70. I do not think this is the right thing to do. "do nothing" is not what one would expect from a `nanosleep`. Let's unpack your problem a bit. __nvvm_reflect() is probably c

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/80921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

2024-02-07 Thread Fangrui Song via cfe-commits
@@ -5392,7 +5392,9 @@ def regcall4 : Flag<["-"], "regcall4">, Group, MarshallingInfoFlag>; def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, - HelpText<"Save intermediate compilatio

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

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

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80171 >From 8e3524f7d4a88a7b868dc3d69bf63a5708db6a1f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 31 Jan 2024 11:09:11 -0500 Subject: [PATCH 1/4] [Clang][Sema] Diagnose friend declarations with enum

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [NFC][clang][Driver] Specify options for with -save-temps= (PR #80921)

2024-02-07 Thread Jacob Lambert via cfe-commits
https://github.com/lamb-j updated https://github.com/llvm/llvm-project/pull/80921 >From 9f021f6d2b99ae73c47313ddc6043ab2af926f23 Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Tue, 6 Feb 2024 17:57:12 -0800 Subject: [PATCH 1/2] [NFC][clang][Driver] Specify options for with -save-temps= -

[clang] [WebAssembly] Add more features to generic CPU config (PR #80923)

2024-02-07 Thread Dan Gohman via cfe-commits
@@ -259,6 +259,10 @@ AIX Support WebAssembly Support ^^^ +The -mcpu=generic configuration now enables nontrapping-fptoint, multivalue, +reference-types, and bulk-memory.These proposals are standardized and available +in all major engines. sunfi

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

2024-02-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > This patch, which simply makes it legal on all architectures but do nothing > > is it's older than sm_70. > > I do not think this is the right thing to do. "do nothing" is not what one > would expect from a `nanosleep`. Thanks, I made this a draft because I figured it wasn'

[clang] [Clang] Fixes of builtin definitions after PR #68324. (PR #81022)

2024-02-07 Thread via cfe-commits
https://github.com/michele-scandale edited https://github.com/llvm/llvm-project/pull/81022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPARC] Support reserving arbitrary general purpose registers (PR #74927)

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

[clang] [llvm] [Driver] Improve error when a compiler-rt library is not found (PR #81037)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/81037 BSD/Linux/OS390x enable `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` by default. When a compiler-rt library is not found, we currently report an incorrect filename `libclang_rt.XXX-$arch.a` ``` % /tmp/Debug/bin/clang++ a.

[clang] [clang][Sema] Subclass `-Wshorten-64-to-32` under `-Wimplicit-int-conversion` (PR #80814)

2024-02-07 Thread John McCall via cfe-commits
rjmccall wrote: This looks right to me, thanks. https://github.com/llvm/llvm-project/pull/80814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIR-V] Add create.handle intrinsic (PR #81038)

2024-02-07 Thread Natalie Chouinard via cfe-commits
https://github.com/sudonatalie created https://github.com/llvm/llvm-project/pull/81038 Add a SPIR-V target-specific intrinsic for creating handles, which is used for lowering HLSL resources types like RWBuffer. `llvm/lib/TargetParser/Triple.cpp`: SPIR-V intrinsics use "spv" as the target pre

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-02-07 Thread Jordan Rupprecht via cfe-commits
rupprecht wrote: It looks like this caused some new `-Wextra-qualification` warnings (playground: https://godbolt.org/z/3MbMjGYET) ``` namespace foo { template struct Z {}; template <> struct Z {}; // OK template <> struct foo::Z {}; // New warning: extra qualification on member 'Z' [-Wextr

[clang] [llvm] [HLSL][SPIR-V] Add create.handle intrinsic (PR #81038)

2024-02-07 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 dd22140e21f2ef51cf031354966a3d41c191c6e7 5f5106478cc21b463eca9820a56b6c236e182afe --

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

2024-02-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Okay, `__nvvm_reflect` doesn't work fully here because the `nanosleep` builtin I added requires `sm_70` at the clang level. Either means I'd need to go back to inline assembly or remove that requirement at least from clang so it's a backend failure. https://github.com/llvm/llvm

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-02-07 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @rupprecht This is intended behavior. We previously did not check qualified declarations of explicit/partial specializations of class templates for redundant qualification & invalid nested-name-specifiers (e.g. ones that begin with `decltype`). We do now, hence the new warnin

[clang] [llvm] [Driver] Improve error when a compiler-rt library is not found (PR #81037)

2024-02-07 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/81037 >From e276cf4e52fd6328860bb31d73d2bb1b6a11c45d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 7 Feb 2024 12:56:05 -0800 Subject: [PATCH] [Driver] Improve error when a compiler-rt library is not found BS

[clang] [llvm] [Driver] Improve error when a compiler-rt library is not found (PR #81037)

2024-02-07 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: I would, generally, prefer to not hardcode `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` (which only affects how runtimes are installed) into Clang. Runtimes may or may not be built at the same time as Clang, and one build of Clang can be used for a multitude of targets with different s

[clang] [llvm] [HLSL][SPIR-V] Add create.handle intrinsic (PR #81038)

2024-02-07 Thread Natalie Chouinard via cfe-commits
https://github.com/sudonatalie ready_for_review https://github.com/llvm/llvm-project/pull/81038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIR-V] Add create.handle intrinsic (PR #81038)

2024-02-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-hlsl Author: Natalie Chouinard (sudonatalie) Changes Add a SPIR-V target-specific intrinsic for creating handles, which is used for lowering HLSL resources types like RWBuffer. `llvm/lib/TargetParser/Triple.cpp`: SPIR-V intr

[clang] Diagnosis for constexpr constructor not initializing a union member #46689 (PR #81042)

2024-02-07 Thread via cfe-commits
https://github.com/mahtohappy created https://github.com/llvm/llvm-project/pull/81042 None >From 9271e67ab27f850413e3d6d6f1383454067efe75 Mon Sep 17 00:00:00 2001 From: mahtohappy Date: Wed, 7 Feb 2024 13:29:45 -0800 Subject: [PATCH] Diagnosis for constexpr constructor not initializing a union

[clang] Diagnosis for constexpr constructor not initializing a union member #46689 (PR #81042)

2024-02-07 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] Diagnosis for constexpr constructor not initializing a union member #46689 (PR #81042)

2024-02-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (mahtohappy) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/81042.diff 3 Files Affected: - (modified) clang/lib/Sema/SemaDeclCXX.cpp (+19) - (modified) clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp (+3)

[clang] Diagnosis for constexpr constructor not initializing a union member fixes #46689 (PR #81042)

2024-02-07 Thread via cfe-commits
https://github.com/mahtohappy edited https://github.com/llvm/llvm-project/pull/81042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnosis for constexpr constructor not initializing a union member Fixes #46689 (PR #81042)

2024-02-07 Thread via cfe-commits
https://github.com/mahtohappy edited https://github.com/llvm/llvm-project/pull/81042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnosis for constexpr constructor not initializing a union member Fixes #46689 (PR #81042)

2024-02-07 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 374a600df7207fbe2002e754a799c7595a0e4833 9271e67ab27f850413e3d6d6f1383454067efe75 --

<    1   2   3   4   5   >