[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libunwind Author: Keith Packard (keith-packard) Changes These two libraries don't build for `-march=armv8-a+nofp -mabi=aapcs-soft` as a couple of uses of floating point instructions and registers have crept in. --- Full diff: https://github.com/llvm/ll

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-04 Thread Keith Packard via cfe-commits
https://github.com/keith-packard created https://github.com/llvm/llvm-project/pull/111235 These two libraries don't build for `-march=armv8-a+nofp -mabi=aapcs-soft` as a couple of uses of floating point instructions and registers have crept in. >From 6201bc34f1213e9f8c477421757509c9c4e678ce Mo

[clang] [flang] [flang][Driver] Add support for -f[no-]wrapv and -f[no]-strict-overflow in the frontend (PR #110061)

2024-10-04 Thread Fangrui Song via cfe-commits
@@ -27,6 +27,14 @@ namespace Fortran::common { class LangOptionsBase { public: + enum SignedOverflowBehaviorTy { +// -fno-wrapv (default behavior in Flang) +SOB_Undefined, MaskRay wrote: unused? Not sure that this definition is useful https://github

[clang] [flang] [flang][Driver] Add support for -f[no-]wrapv and -f[no]-strict-overflow in the frontend (PR #110061)

2024-10-04 Thread Fangrui Song via cfe-commits
@@ -6921,16 +6921,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_ftrap_function_EQ); - // -fno-strict-overflow implies -fwrapv if it isn't disabled, but - // -fstrict-overflow won't turn off an explicitly enabled

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/108570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
@@ -914,6 +918,9 @@ bool GCOVProfiler::emitProfileNotes( GlobalVariable *Counters = new GlobalVariable( *M, CounterTy, false, GlobalValue::InternalLinkage, Constant::getNullValue(CounterTy), "__llvm_gcov_ctr"); +const llvm::Triple &Triple

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
inbelic wrote: Rebasing onto commit that allows the use of `selectExtInst` with both `CL::degrees` and `GL::Degrees`. Adding additional testcase for this as well. https://github.com/llvm/llvm-project/pull/111209 ___ cfe-commits mailing list cfe-commit

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/111209 >From 461d5133ea1ae1fcdffd036a926243ee3dce5abb Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 2 Oct 2024 13:30:33 -0700 Subject: [PATCH] [HLSL] Implementation the `degrees` intrinsic - add degrees b

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,129 @@ +; Tests if the __llvm_gcov_ctr section contains a .ref pseudo-op +; referring to the __llvm_covinit section. +; RUN: llc < %s | FileCheck --check-prefixes=CHECK,CHECK-RW %s +; RUN: llc -mxcoff-roptr < %s | FileCheck --check-prefixes=CHECK,CHECK-RO %s + +target d

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,129 @@ +; Tests if the __llvm_gcov_ctr section contains a .ref pseudo-op +; referring to the __llvm_covinit section. +; RUN: llc < %s | FileCheck --check-prefixes=CHECK,CHECK-RW %s +; RUN: llc -mxcoff-roptr < %s | FileCheck --check-prefixes=CHECK,CHECK-RO %s + +target d

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -32,7 +33,8 @@ void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) { const auto FindCall = cxxMemberCallExpr( - argumentCountIs(1), + anyOf(argumentCountIs(1), +allOf(argumentCountIs(2), hasArgument(1, cxxDefaultArg

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -453,3 +490,15 @@ void testOperandPermutations(std::map& Map) { // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use 'contains' to check for membership [readability-container-contains] // CHECK-FIXES: if (!Map.contains(0)) {}; } + +void testStringNops(std::string St

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -29,6 +29,43 @@ struct multimap { bool contains(const Key &K) const; }; +using size_t = decltype(sizeof(int)); + +// Lightweight standin for std::string_view. +template +class basic_string_view { +public: + basic_string_view(); + basic_string_view(const basic_string_vi

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -94,12 +102,14 @@ void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) { binaryOperator(hasLHS(Literal1), hasOperatorName(">"), hasRHS(CountCall)) .bind("negativeComparison")); - // Find membership tests based on `find() == end()`. + // Find

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -51,6 +53,12 @@ void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) { const auto Literal0 = integerLiteral(equals(0)); const auto Literal1 = integerLiteral(equals(1)); + const auto StringLikeClass = cxxRecordDecl( + hasAnyName("::std::basic_string"

[clang-tools-extra] Add checks to convert std library iterator algorithms into c++20 or boost ranges (PR #97764)

2024-10-04 Thread via cfe-commits
hia3 wrote: It crashes most likely because a local variable is captured in the static lambda. https://github.com/llvm/llvm-project/blob/bf895c714e1f8a51c1e565a75acf60bf7197be51/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp#L208 https://github.com/llvm/llvm-project/pull/97764 __

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
https://github.com/dl8sd11 updated https://github.com/llvm/llvm-project/pull/110351 >From b98e9a4d50d74c298096d2bd2d70ff4c0ef5c4a4 Mon Sep 17 00:00:00 2001 From: dl8sd11 Date: Sat, 28 Sep 2024 07:37:50 + Subject: [PATCH 1/5] [clang-tidy] support string::contains --- .../readability/Contai

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
https://github.com/dl8sd11 updated https://github.com/llvm/llvm-project/pull/110351 >From b98e9a4d50d74c298096d2bd2d70ff4c0ef5c4a4 Mon Sep 17 00:00:00 2001 From: dl8sd11 Date: Sat, 28 Sep 2024 07:37:50 + Subject: [PATCH 1/4] [clang-tidy] support string::contains --- .../readability/Contai

[clang] [clang-format] Don't insert spaces after keywords in protobuf field o… (PR #111229)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes …ptions Fixes #54848. --- Full diff: https://github.com/llvm/llvm-project/pull/111229.diff 2 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+14-12) - (modified) clang/unittests/Forma

[clang] [clang-format] Don't insert spaces after keywords in protobuf field o… (PR #111229)

2024-10-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/111229 …ptions Fixes #54848. >From 8849f09458363a96dc3dd080b9e87aa785f6958f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 4 Oct 2024 21:21:43 -0700 Subject: [PATCH] [clang-format] Don't insert spaces after keywor

[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111228)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111228.diff 1 Files Affected: - (modified) clang/lib/Basic/TargetID.cpp (+6-7) ``diff diff --git a/clang/lib/Basic/TargetID.cpp b/

[clang] [Sema] Avoid repeated hash lookups (NFC) (PR #111227)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111227.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaOpenMP.cpp (+6-12) ``diff diff --git a/clang/lib/Sema/SemaOpenMP.cpp

[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111228)

2024-10-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/111228 None >From 2e3d116613a7441b31036cf603d581db6e0afe9b Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 4 Oct 2024 08:00:11 -0700 Subject: [PATCH] [Basic] Avoid repeated hash lookups (NFC) --- clang/

[clang] [Sema] Avoid repeated hash lookups (NFC) (PR #111227)

2024-10-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/111227 None >From 364f8e5778d8dd587ee8b58104edd931c4b9d336 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 4 Oct 2024 07:59:14 -0700 Subject: [PATCH] [Sema] Avoid repeated hash lookups (NFC) --- clang/l

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111225)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111225.diff 1 Files Affected: - (modified) clang/lib/Driver/Driver.cpp (+9-8) ``diff diff --git a/clang/lib/Driver/Driver.c

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111225)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111225.diff 1 Files Affected: - (modified) clang/lib/Driver/Driver.cpp (+9-8) ``diff diff --git a/clang/lib/Driver/Driver.cpp b/cl

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111225)

2024-10-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/111225 None >From bd591d56e72a252b5dfa2304c8b719c60cfb1808 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 4 Oct 2024 08:00:49 -0700 Subject: [PATCH] [Driver] Avoid repeated hash lookups (NFC) --- clang

[clang] Effect analysis: correctly detect `(x ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos deleted https://github.com/llvm/llvm-project/pull/111224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Effect analysis: correctly detect `(x ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos updated https://github.com/llvm/llvm-project/pull/111224 >From 02398e6398892dac5d151a6e425bf107213e12a8 Mon Sep 17 00:00:00 2001 From: Doug Wyatt Date: Fri, 4 Oct 2024 18:28:37 -0700 Subject: [PATCH 1/2] Effect analysis: correctly detect `(f ? a : b)` as nonblockin

[clang] Effect analysis: correctly detect `(x ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/111224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Effect analysis: correctly detect `(x ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/111224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Effect analysis: correctly detect `(f ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
@@ -1048,15 +1048,14 @@ class Analyzer { } void checkIndirectCall(CallExpr *Call, QualType CalleeType) { - auto *FPT = - CalleeType->getAs(); // Null if FunctionType. FunctionEffectKindSet CalleeEffects; - if (FPT) -CalleeEffects.inser

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-10-04 Thread Kyungwoo Lee via cfe-commits
https://github.com/kyulee-com updated https://github.com/llvm/llvm-project/pull/90933 >From d4ecc690fadc2787425b0b1b94f07ff7f981bdfe Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Fri, 13 Sep 2024 08:51:00 -0700 Subject: [PATCH 1/5] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds

[clang] Effect analysis: correctly detect `(f ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
@@ -1048,15 +1048,14 @@ class Analyzer { } void checkIndirectCall(CallExpr *Call, QualType CalleeType) { - auto *FPT = - CalleeType->getAs(); // Null if FunctionType. FunctionEffectKindSet CalleeEffects; - if (FPT) -CalleeEffects.inser

[clang] Effect analysis: correctly detect `(f ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Doug Wyatt (dougsonos) Changes Fix: Effect analysis: correctly detect `(f ? a : b)` as nonblocking when a and b are --- Full diff: https://github.com/llvm/llvm-project/pull/111224.diff 2 Files Affected: - (modified) clang/lib/Sema/Sema

[clang] Effect analysis: correctly detect `(f ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
@@ -156,6 +156,16 @@ void nb10( static_cast(fp1)(); // expected-warning {{function with 'nonblocking' attribute must not call non-'nonblocking' expression}} } +// Expression involving indirection +int nb10a() [[clang::nonblocking]]; +int nb10b() [[clang::nonblocking]];

[clang] Effect analysis: correctly detect `(f ? a : b)` as nonblocking when a and b are (PR #111224)

2024-10-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos created https://github.com/llvm/llvm-project/pull/111224 Fix: Effect analysis: correctly detect `(f ? a : b)` as nonblocking when a and b are >From 02398e6398892dac5d151a6e425bf107213e12a8 Mon Sep 17 00:00:00 2001 From: Doug Wyatt Date: Fri, 4 Oct 2024 18:28:37 -0

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-04 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: This LGTM but I'm not familiar enough with the mangling aspects or the implications of adding a canonical type to be comfortable signing off on it. https://github.com/llvm/llvm-project/pull/110327 ___ cfe-commits m

[clang] [clang-format] Annotate ::operator as FunctionDeclarationName (PR #111115)

2024-10-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/15 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b5f6689 - [clang-format] Annotate ::operator as FunctionDeclarationName (#111115)

2024-10-04 Thread via cfe-commits
Author: Owen Pan Date: 2024-10-04T18:20:21-07:00 New Revision: b5f6689dc93216f9272e790e787548cf29250566 URL: https://github.com/llvm/llvm-project/commit/b5f6689dc93216f9272e790e787548cf29250566 DIFF: https://github.com/llvm/llvm-project/commit/b5f6689dc93216f9272e790e787548cf29250566.diff LOG:

[clang] [llvm] Adding splitdouble HLSL function (PR #109331)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -489,6 +542,9 @@ class OpLowerer { case Intrinsic::dx_typedBufferStore: HasErrors |= lowerTypedBufferStore(F); break; + case Intrinsic::dx_splitdouble: farzonl wrote: What would require to do it automatically? https://github.com/

[clang] [clang-format] Handle template closer followed by braces (PR #110971)

2024-10-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/110971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e5b05a5 - [clang-format] Handle template closer followed by braces (#110971)

2024-10-04 Thread via cfe-commits
Author: Owen Pan Date: 2024-10-04T18:18:03-07:00 New Revision: e5b05a51b8151cc7788bbdea4d491e5ccfceedea URL: https://github.com/llvm/llvm-project/commit/e5b05a51b8151cc7788bbdea4d491e5ccfceedea DIFF: https://github.com/llvm/llvm-project/commit/e5b05a51b8151cc7788bbdea4d491e5ccfceedea.diff LOG:

[clang] [llvm] Adding splitdouble HLSL function (PR #109331)

2024-10-04 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/109331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Adding splitdouble HLSL function (PR #109331)

2024-10-04 Thread Justin Bogner via cfe-commits
@@ -489,6 +542,9 @@ class OpLowerer { case Intrinsic::dx_typedBufferStore: HasErrors |= lowerTypedBufferStore(F); break; + case Intrinsic::dx_splitdouble: bogner wrote: There will need to be some logic in DXILOpLowering, because we n

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Justin Bogner via cfe-commits
bogner wrote: It is not correct to limit firstbithigh to 32 bit integers. There are a couple of reasons that might make one think that it is, but we do in fact want/need to support int16 and int64 here. 1. The [HLSL docs](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/firstbithi

[clang] [Clang] Fix __builtin_dynamic_object_size off by 4 (PR #111015)

2024-10-04 Thread Jan Hendrik Farr via cfe-commits
Cydox wrote: Also see these comments in the main function of the same test file: ```C int main () { struct annotated *p, *q; p = alloc_buf_more (10); q = alloc_buf_less (10); /* When checking the access p->array, we only have info on the counted-by value. */ EXPECT(__builtin_dyna

[clang] [alpha.webkit.UncountedCallArgsChecker] Skip std::forward in tryToFindPtrOrigin. (PR #111222)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ryosuke Niwa (rniwa) Changes Ignore std::forward when it appears while looking for the pointer origin. --- Full diff: https://github.com/llvm/llvm-project/pull/111222.diff 2 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers

[clang] [alpha.webkit.UncountedCallArgsChecker] Skip std::forward in tryToFindPtrOrigin. (PR #111222)

2024-10-04 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/111222 Ignore std::forward when it appears while looking for the pointer origin. >From a67655fa83adab03351aa02d0982dd6a20726939 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 4 Oct 2024 17:44:11 -0700 Subject: [

[clang-tools-extra] [clangd] Implement simple folding of preprocessor branches (PR #80592)

2024-10-04 Thread Aaron Liu via cfe-commits
aaronliu0130 wrote: I'm new to this, but from what I see, this PR could be easily put up simply removing the pseudo:: prefixes. https://github.com/llvm/llvm-project/pull/80592 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [Clang] Fix __builtin_dynamic_object_size off by 4 (PR #111015)

2024-10-04 Thread Jan Hendrik Farr via cfe-commits
Cydox wrote: > AIUI, GCC considers this to be a bug in the face of `counted_by`. The reason > GCC returns "unknown" (`SIZE_MAX`) in the case of a pointer like that is > because (prior to `counted_by`) if the pointer wasn't to local storage, it > could no know if it was a singleton or not. i.e.

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111082 >From e9ed9f9a0415544781f8334b305eb3916fc0862c Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Mon, 23 Sep 2024 22:10:59 + Subject: [PATCH 1/4] implement firstbithigh hlsl builtin --- clang/include/clang/Ba

[clang] [Clang] Fix __builtin_dynamic_object_size off by 4 (PR #111015)

2024-10-04 Thread Kees Cook via cfe-commits
kees wrote: > This is why I believe the gcc behavior is correct. When it knows the size > given to `malloc` it uses that. When it doesn't know that it simply returns > INT_MAX. When you ask gcc for the `__bdos` of the FAM it will use the `count` > to calculate the size. (nit: `SIZE_MAX`, not

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
@@ -1643,6 +1646,23 @@ bool SPIRVInstructionSelector::selectLength(Register ResVReg, .constrainAllUses(TII, TRI, RBI); } +bool SPIRVInstructionSelector::selectDegrees(Register ResVReg, + const SPIRVType *ResType, +

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
@@ -2625,6 +2645,8 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, return selectFmix(ResVReg, ResType, I); case Intrinsic::spv_length: return selectLength(ResVReg, ResType, I); + case Intrinsic::spv_degrees: +return selectDegrees(ResVReg, Res

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Sarah Spall via cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/111209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Sarah Spall via cfe-commits
@@ -1643,6 +1646,23 @@ bool SPIRVInstructionSelector::selectLength(Register ResVReg, .constrainAllUses(TII, TRI, RBI); } +bool SPIRVInstructionSelector::selectDegrees(Register ResVReg, + const SPIRVType *ResType, +

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Sarah Spall via cfe-commits
@@ -2625,6 +2645,8 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, return selectFmix(ResVReg, ResType, I); case Intrinsic::spv_length: return selectLength(ResVReg, ResType, I); + case Intrinsic::spv_degrees: +return selectDegrees(ResVReg, Res

[clang-tools-extra] Add checks to convert std library iterator algorithms into c++20 or boost ranges (PR #97764)

2024-10-04 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: FYI, the new `boost-use-ranges` check is pretty crashy in clangd (https://github.com/llvm/llvm-project/issues/109037, https://github.com/llvm/llvm-project/issues/109367, https://github.com/clangd/clangd/issues/2173, https://github.com/clangd/clangd/issues/2151). https:/

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/111209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Finn Plummer (inbelic) Changes - add degrees builtin - link degrees api in hlsl_intrinsics.h - add degrees intrinsic to IntrinsicDirectX.td - add degrees intrinsic to IntrinsicSPIRV.td - add lowering from clang bui

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Finn Plummer (inbelic) Changes - add degrees builtin - link degrees api in hlsl_intrinsics.h - add degrees intrinsic to IntrinsicDirectX.td - add degrees intrinsic to IntrinsicSPIRV.td - add lowering from clang builtin t

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Finn Plummer (inbelic) Changes - add degrees builtin - link degrees api in hlsl_intrinsics.h - add degrees intrinsic to IntrinsicDirectX.td - add degrees intrinsic to IntrinsicSPIRV.td - add lowering from clang b

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
https://github.com/inbelic ready_for_review https://github.com/llvm/llvm-project/pull/111209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][HLSL] Add radians intrinsic (PR #110802)

2024-10-04 Thread via cfe-commits
github-actions[bot] wrote: @adam-yang Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a buil

[clang] [Clang] Fix 'counted_by' for nested struct pointers (PR #110497)

2024-10-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: ast-dump for your example: ``` | | `-CallExpr 0xcc44978 'unsigned long' | | |-ImplicitCastExpr 0xcc44960 'unsigned long (*)(const void *, int)' | | | `-DeclRefExpr 0xcc448b8 '' Function 0xcc446b0 '__builtin_dynamic_object_size' 'unsigned long (const void *, i

[clang] [clang][HLSL] Add radians intrinsic (PR #110802)

2024-10-04 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl closed https://github.com/llvm/llvm-project/pull/110802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9df94e2 - [clang][HLSL] Add radians intrinsic (#110802)

2024-10-04 Thread via cfe-commits
Author: Adam Yang Date: 2024-10-04T18:34:46-04:00 New Revision: 9df94e2791a0939f562d2d77f5d611e6ff37f5f9 URL: https://github.com/llvm/llvm-project/commit/9df94e2791a0939f562d2d77f5d611e6ff37f5f9 DIFF: https://github.com/llvm/llvm-project/commit/9df94e2791a0939f562d2d77f5d611e6ff37f5f9.diff LOG

[clang] [clang][HLSL] Add radians intrinsic (PR #110802)

2024-10-04 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/110802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Sarah Spall via cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/111082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[clang][CodeGen] Zero init unspecified fields in initializers in C" (#109898) (PR #110051)

2024-10-04 Thread via cfe-commits
@@ -1774,6 +1805,50 @@ void AggExprEmitter::VisitCXXParenListOrInitListExpr( } } } + if (ZeroInitPadding) { +uint64_t TotalSize = CGF.getContext().toBits( +Dest.getPreferredSize(CGF.getContext(), DestLV.getType())); +DoZeroInitPadding(BaseAddr, Last

[clang] [clang][HLSL] Add radians intrinsic (PR #110802)

2024-10-04 Thread Adam Yang via cfe-commits
adam-yang wrote: @farzonl This is also ready for merging if there's no further feedback. https://github.com/llvm/llvm-project/pull/110802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Qiongsi Wu via cfe-commits
qiongsiwu wrote: Thanks so much @hubert-reinterpretcast for the detailed review! All existing comments are now addressed. https://github.com/llvm/llvm-project/pull/108570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] Reapply "[clang][CodeGen] Zero init unspecified fields in initializers in C" (#109898) (PR #110051)

2024-10-04 Thread via cfe-commits
https://github.com/yabinc updated https://github.com/llvm/llvm-project/pull/110051 >From 112b018d3cac542757fcc399efa9fa5a9caac9b8 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Wed, 25 Sep 2024 10:05:27 -0700 Subject: [PATCH 1/3] Reapply "[clang][CodeGen] Zero init unspecified fields in initia

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Qiongsi Wu via cfe-commits
@@ -2962,13 +2964,34 @@ void PPCAIXAsmPrinter::emitPGORefs(Module &M) { } } +void PPCAIXAsmPrinter::emitGCOVRefs() { + if (!OutContext.hasXCOFFSection( + "__llvm_gcov_ctr_section", + XCOFF::CsectProperties(XCOFF::XMC_RW, XCOFF::XTY_SD))) +return; + +

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/108570 >From e1b5e886f3f7642ec691a08378a1f2cdc9e2465f Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Wed, 11 Sep 2024 14:56:58 -0400 Subject: [PATCH 1/6] Initial commit. --- clang/test/CodeGen/attr-function-return

[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)

2024-10-04 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/107332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Sarah Spall via cfe-commits
@@ -0,0 +1,37 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK: OpMemoryModel Logical GLSL450 + +define noundef i32 @fi

[clang] [Clang] omit parentheses in fold expressions with a single expansion (PR #110761)

2024-10-04 Thread Erich Keane via cfe-commits
@@ -15609,6 +15609,14 @@ TreeTransform::TransformCXXFoldExpr(CXXFoldExpr *E) { return true; } + // When there's only one expansion, the parentheses can be safely eliminated + // to avoid any extra redundancy that may result in incorrect checks. + // For example, tr

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -4588,6 +4588,35 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -985,44 +983,43 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *T

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -115,12 +114,14 @@ struct Eg13{ MySRV s1; MySRV s2; }; -// expected-warning@+4{{binding type 'u' only applies to types containing UAV resources}} // expected-warning@+3{{binding type 'u' only applies to types containing UAV resources}} -// expected-warning@+2{{binding

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Joshua Batista via cfe-commits
@@ -1135,21 +1147,19 @@ static void ValidateMultipleRegisterAnnotations(Sema &S, Decl *TheDecl, RegisterType otherRegType = getRegisterType(attr->getSlot()); if (RegisterTypesDetected[static_cast(otherRegType)]) { -if (PreviousConflicts[TheDecl].count(othe

[clang] [clang][HLSL] Add radians intrinsic (PR #110802)

2024-10-04 Thread Sarah Spall via cfe-commits
https://github.com/spall approved this pull request. LGTM but I didn't look too closely at the tests. https://github.com/llvm/llvm-project/pull/110802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang] omit parentheses in fold expressions with a single expansion (PR #110761)

2024-10-04 Thread Oleksandr T. via cfe-commits
@@ -15609,6 +15609,14 @@ TreeTransform::TransformCXXFoldExpr(CXXFoldExpr *E) { return true; } + // When there's only one expansion, the parentheses can be safely eliminated + // to avoid any extra redundancy that may result in incorrect checks. + // For example, tr

[clang] [llvm] Implement operand bundles for floating-point operations (PR #109798)

2024-10-04 Thread Kevin P. Neal via cfe-commits
kpneal wrote: > It does not look as a good base for safety. Many users want the code in > non-default FP modes to be more efficient, Now any any deviation from the > default mode requires use of constrained intrinsics in the entire function, > but now such solution exhibits poor performance, u

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-10-04 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: ah there's a stack trace in an asserts build of clang ``` F 00:00:1728077756.9778713296 logging.cc:62] assert.h assertion failed at third_party/llvm/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4602 in llvm::PointerUnion *clang::LocalInstantiationScope::find

[clang] [Clang] Fix 'counted_by' for nested struct pointers (PR #110497)

2024-10-04 Thread Jan Hendrik Farr via cfe-commits
Cydox wrote: > > Yeah so the problem is if you do `__builtin_dynamic_object_size(v, 0)` > > In that case it's a `DeclRefExpr`, a pointer, and an `LValue`. > > Can you give a more complete example? I just tried the following, and I see > an lvaluetorvalue cast. > > ``` > int f(const void *p) {

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -82,5 +82,6 @@ let TargetPrefix = "spv" in { [llvm_anyint_ty, LLVMScalarOrSameVectorWidth<0, LLVMVectorElementType<0>>], [IntrNoMem, Commutative] >; def int_spv_wave_is_first_lane : DefaultAttrsIntrinsic<[llvm_i1_ty], [], [IntrConvergent]>; + def int_spv_wave_rea

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %} + +; Test lowering to spir-v backend + +; CHECK-DAG: %[[#uint

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %} + +; Test lowering to spir-v backend + +; CHECK-DAG: %[[#uint

[clang] [Clang] omit parentheses in fold expressions with a single expansion (PR #110761)

2024-10-04 Thread Erich Keane via cfe-commits
@@ -15609,6 +15609,14 @@ TreeTransform::TransformCXXFoldExpr(CXXFoldExpr *E) { return true; } + // When there's only one expansion, the parentheses can be safely eliminated + // to avoid any extra redundancy that may result in incorrect checks. + // For example, tr

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %} + +; Test lowering to spir-v backend + +; CHECK-DAG: %[[#uint

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %} + +; Test lowering to spir-v backend + +; CHECK-DAG: %[[#uint

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,56 @@ +; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s | FileCheck %s + +; Test that for scalar values, WaveReadLaneAt maps down to the DirectX op + +define noundef half @wave_rla_half(half noundef %expr, i32 noundef %idx) #0 { +entry: +; CHECK:

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,56 @@ +; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s | FileCheck %s + +; Test that for scalar values, WaveReadLaneAt maps down to the DirectX op + +define noundef half @wave_rla_half(half noundef %expr, i32 noundef %idx) #0 { +entry: +; CHECK:

  1   2   3   4   >