[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -205,7 +205,7 @@ void LoongArchTargetInfo::getTargetDefines(const LangOptions &Opts, // TODO: As more features of the V1.1 ISA are supported, a unified "v1.1" // arch feature set will be used to include all sub-features belonging to // the V1.1 ISA version

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -0,0 +1,1674 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc --mtriple=loongarch32 --mattr=+d,-lam-bh < %s | FileCheck %s --check-prefix=LA32 +; RUN: llc --mtriple=loongarch32 --mattr=+d,+lam-bh < %s | FileCheck %s --check-prefix=

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -2088,8 +2088,26 @@ multiclass binary_atomic_op_wd { (!cast(inst#"__DB_D"#signed) GPR:$rk, GPR:$rj)>; } +// Atomic operation for byte and half word +multiclass binary_atomic_op_bh { + def : Pat<(!cast(op#"_i8_monotonic") GPR:$rj, GPR:$rk), +(!cast(i

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -2088,8 +2088,26 @@ multiclass binary_atomic_op_wd { (!cast(inst#"__DB_D"#signed) GPR:$rk, GPR:$rj)>; } +// Atomic operation for byte and half word +multiclass binary_atomic_op_bh { + def : Pat<(!cast(op#"_i8_monotonic") GPR:$rj, GPR:$rk), +(!cast(i

[clang] [llvm] [X86] Support MOVRS and AVX10.2 instructions. (PR #113274)

2024-10-22 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf created https://github.com/llvm/llvm-project/pull/113274 Ref.: https://cdrdv2.intel.com/v1/dl/getContent/671368 >From 19c6400ac7127860ac1712941acbd1585614d17d Mon Sep 17 00:00:00 2001 From: Freddy Ye Date: Mon, 21 Oct 2024 10:24:14 +0800 Subject: [PATCH] [X86] Su

[clang] [WebKit Checkers] Make TrivialFunctionAnalysis recognize std::array::operator[] as trivial (PR #113377)

2024-10-22 Thread Rashmi Mudduluru via cfe-commits
https://github.com/t-rasmud created https://github.com/llvm/llvm-project/pull/113377 TFA wasn't recognizing `__libcpp_verbose_abort` as trivial causing `std::array::operator[]` also not being recongnized as trivial. >From 9e21b0f2f0968a5f8810c797913318884dcc8c7b Mon Sep 17 00:00:00 2001 From:

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -95,6 +99,157 @@ static void initializeAlloca(CodeGenFunction &CGF, AllocaInst *AI, Value *Size, I->addAnnotationMetadata("auto-init"); } +static Value *handleHlslSplitdouble(const CallExpr *E, CodeGenFunction *CGF) { + Value *Op0 = CGF->EmitScalarExpr(E->getArg(0)); +

[clang] [WebKit Checkers] Make TrivialFunctionAnalysis recognize std::array::operator[] as trivial (PR #113377)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 @llvm/pr-subscribers-clang Author: Rashmi Mudduluru (t-rasmud) Changes TFA wasn't recognizing `__libcpp_verbose_abort` as trivial causing `std::array::operator[]` also not being recongnized as trivial. --- Full diff: https://git

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -4681,6 +4676,12 @@ void CallArg::copyInto(CodeGenFunction &CGF, Address Addr) const { IsUsed = true; } +void CodeGenFunction::EmitWritebacks(CodeGenFunction &CGF, + const CallArgList &args) { + for (const auto &I : args.writebacks())

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -5149,6 +5152,9 @@ class CodeGenFunction : public CodeGenTypeCache { SourceLocation ArgLoc, AbstractCallee AC, unsigned ParmNum); + /// EmitWriteback - Emit callbacks for function. + void EmitWritebacks(CodeGenFunction

[clang] [llvm] [mlir] [flang][OpenMP] Support `target enter|update|exit .. nowait` (PR #113305)

2024-10-22 Thread Pranav Bhandarkar via cfe-commits
@@ -2342,26 +2345,34 @@ class OpenMPIRBuilder { /// Generate a target region entry call and host fallback call. /// /// \param Loc The location at which the request originated and is fulfilled. - /// \param OutlinedFn The outlined kernel function. /// \param OutlinedF

[clang] [llvm] [mlir] [flang][OpenMP] Support `target enter|update|exit .. nowait` (PR #113305)

2024-10-22 Thread Pranav Bhandarkar via cfe-commits
https://github.com/bhandarkar-pranav edited https://github.com/llvm/llvm-project/pull/113305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [flang][OpenMP] Support `target enter|update|exit .. nowait` (PR #113305)

2024-10-22 Thread Pranav Bhandarkar via cfe-commits
https://github.com/bhandarkar-pranav approved this pull request. A couple of minor nits, that's all. https://github.com/llvm/llvm-project/pull/113305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [llvm] [mlir] [flang][OpenMP] Support `target enter|update|exit .. nowait` (PR #113305)

2024-10-22 Thread Pranav Bhandarkar via cfe-commits
@@ -6403,16 +6401,45 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createTargetData( SrcLocInfo = getOrCreateIdent(SrcLocStr, SrcLocStrSize); } -Value *OffloadingArgs[] = {SrcLocInfo, DeviceID, - PointerNum,

[clang] [llvm] [mlir] [flang][OpenMP] Support `target enter|update|exit .. nowait` (PR #113305)

2024-10-22 Thread Pranav Bhandarkar via cfe-commits
@@ -6403,16 +6401,45 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createTargetData( SrcLocInfo = getOrCreateIdent(SrcLocStr, SrcLocStrSize); } -Value *OffloadingArgs[] = {SrcLocInfo, DeviceID, - PointerNum,

[clang-tools-extra] [clang-tidy] Stop linking against clangSema (PR #113373)

2024-10-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/113373 This is bad layering-wise. The only fix needed now is to anchor `SemaConsumer` vtable, which is also done in this patch. >From 5a227a152392cc0725a1b104c8d7832621a9ec46 Mon Sep 17 00:00:00 2001 From: Vlad Serebr

[clang] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it accessible outside of Sema (PR #113206)

2024-10-22 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113206 >From ae8b3c909231915f87631665b06321a9f9baff33 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 21 Oct 2024 12:17:58 -0700 Subject: [PATCH 1/2] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to ma

[clang] [AMDGPU] Relax __builtin_amdgcn_update_dpp sema check (PR #113341)

2024-10-22 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec closed https://github.com/llvm/llvm-project/pull/113341 ___ 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-22 Thread Tex Riddell via cfe-commits
@@ -18952,6 +18955,142 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: { CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0}, nullptr, "hlsl.radians"); } + case Builtin::BI__builtin_hlsl_splitdouble: { + +assert((E->getArg(0)->getType()->hasFlo

[clang] [analyzer] Add alpha.cplusplus.BoundsInformation checker (PR #112784)

2024-10-22 Thread David Kilzer via cfe-commits
ddkilzer wrote: Thanks for the feedback! I will work on updates this week (around the WebKit Contributors meeting, which happens to be the same week as the LLVM Developer's Meeting). In the meantime, the checker (using the original PR) has already found some `std::span` anti-patterns in WebK

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/113389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113389 With inferred modules, the dependency scanner takes care to replace the fake "__inferred_module.map" path with the file that allowed the module to be inferred. However, this only worked when such a module

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes With inferred modules, the dependency scanner takes care to replace the fake "__inferred_module.map" path with the file that allowed the module to be inferred. However, this only worked when such a modul

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/112452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0ffa29f - [clang][modules] Timestamp PCM files when writing (#112452)

2024-10-22 Thread via cfe-commits
Author: Jan Svoboda Date: 2024-10-22T15:08:02-07:00 New Revision: 0ffa29fe8152e247eea87017e8c5aeedc6329c15 URL: https://github.com/llvm/llvm-project/commit/0ffa29fe8152e247eea87017e8c5aeedc6329c15 DIFF: https://github.com/llvm/llvm-project/commit/0ffa29fe8152e247eea87017e8c5aeedc6329c15.diff L

[clang] [WebKit Checkers] Make TrivialFunctionAnalysis recognize std::array::operator[] as trivial (PR #113377)

2024-10-22 Thread Ryosuke Niwa via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s +// expected-no-diagnostics + +#include "mock-types.h" + +using size_t = __typeof(sizeof(int)); +namespace std{ +template +class array { + T elements[N]; + + publi

[clang] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-10-22 Thread Evgenii Stepanov via cfe-commits
@@ -764,11 +764,18 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) { const DataLayout &DL = GV->getDataLayout(); uint64_t Size = DL.getTypeAllocSize(GV->getValueType()); + if (GV->isTagged()) +Size = alignTo(Size, 16); eugenis wrote:

[clang] [llvm] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic (PR #113382)

2024-10-22 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/113382 >From 68c16dc2e21d3a78a388fdb883551f32b902db11 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 18 Oct 2024 15:48:29 -0700 Subject: [PATCH 1/2] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic - add co

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113391 This patch avoids eagerly populating the submodule index on `Module` construction. The `StringMap` allocation shows up in my profiles of `clang-scan-deps`, while the index is not necessary most of the time

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Jan Svoboda (jansvoboda11) Changes This patch avoids eagerly populating the submodule index on `Module` construction. The `StringMap` allocation shows up in my profiles of `clang-scan-deps`, while the index is not necessary most o

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes This patch avoids eagerly populating the submodule index on `Module` construction. The `StringMap` allocation shows up in my profiles of `clang-scan-deps`, while the index is not necessary most of the ti

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-22 Thread Peilin Ye via cfe-commits
peilin-ye wrote: > In the above, you will do unsigned load extension. But what about signed extension load variant? @yonghong-song, if we ever need that, we can add a new flag to bit `0-3` of `imm` to indicate "this 8- or 16-bit load-acquire is sign-extending", just like `BPF_FETCH` for `BPF_X

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-22 Thread Peilin Ye via cfe-commits
peilin-ye wrote: Another problem is, right now, if I do this: ```diff --- a/llvm/lib/Target/BPF/BPFInstrInfo.td +++ b/llvm/lib/Target/BPF/BPFInstrInfo.td @@ -1343,11 +1343,11 @@ let Predicates = [BPFHasALU32] in { let Predicates = [BPFHasLoadAcquire] in { foreach P = [[relaxed_load, LDW

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-22 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann updated https://github.com/llvm/llvm-project/pull/105738 >From b775b7288035d83281434e27341b98a76623802f Mon Sep 17 00:00:00 2001 From: Tom Honermann Date: Thu, 22 Aug 2024 09:44:56 -0700 Subject: [PATCH 1/4] [Clang] Match MSVC handling of duplicate header search

[clang] [llvm] [HLSL][SPIRV] Added clamp intrinsic (PR #113394)

2024-10-22 Thread Adam Yang via cfe-commits
https://github.com/adam-yang created https://github.com/llvm/llvm-project/pull/113394 Fixes #88052 - Added the following intrinsics: - `int_spv_uclamp` - `int_spv_sclamp` - `int_spv_fclamp` - Update the clamp.hlsl unit tests to include SPIRV - Added the SPIRV specific tests >From 8cf5032

[clang] [llvm] [HLSL][SPIRV] Added clamp intrinsic (PR #113394)

2024-10-22 Thread via cfe-commits
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-email

[clang] [llvm] [HLSL][SPIRV] Added clamp intrinsic (PR #113394)

2024-10-22 Thread Adam Yang via cfe-commits
https://github.com/adam-yang updated https://github.com/llvm/llvm-project/pull/113394 >From 8cf5032a5580b97c4c4965e577374f627fbe0643 Mon Sep 17 00:00:00 2001 From: Adam Yang <31109344+adam-y...@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:35:45 -0700 Subject: [PATCH 1/4] Added the intrins

[clang] [clang][modules] Shrink the size of `Module::Headers` (PR #113395)

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113395 This patch shrinks the size of the `Module` class from 2112B to 1624B. I wasn't able to get a good data on the actual impact on memory usage, but given my `clang-scan-deps` workload at hand (with tens of t

[clang] [clang][modules] Shrink the size of `Module::Headers` (PR #113395)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Jan Svoboda (jansvoboda11) Changes This patch shrinks the size of the `Module` class from 2112B to 1624B. I wasn't able to get a good data on the actual impact on memory usage, but given my `clang-scan-deps` workload at hand (with

[clang] [clang][modules] Shrink the size of `Module::Headers` (PR #113395)

2024-10-22 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 2e0506f83bfde6db93454bdf28e4a71c160d4f5b 09246d11c8663c0b2b31317eddc297c1d29fcd60 --e

[clang] [llvm] [RISCV] Inline Assembly Support for GPR Pairs ('Pr') (PR #112983)

2024-10-22 Thread Sam Elliott via cfe-commits
lenary wrote: Sorry, got the rebase slightly wrong. Will re-do it tomorrow. Tests will likely fail in the meantime. This only really affects the branch-relaxation tests. https://github.com/llvm/llvm-project/pull/112983 ___ cfe-commits mailing list cfe

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-22 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai approved this pull request. https://github.com/llvm/llvm-project/pull/112452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libunwind Author: Daniel Kiss (DanielKristofKiss) Changes Libunwind manages the registers/context including the program counter which is used effectively as a return address. __libunwind_Registers_arm64_jumpto can go anywhere where the given buffer 's P

[clang] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it accessible outside of Sema (PR #113206)

2024-10-22 Thread Helena Kotas via cfe-commits
@@ -5030,6 +5030,29 @@ bool Type::hasSizedVLAType() const { return false; } +bool Type::isHLSLIntangibleType() const { + const Type *Ty = getUnqualifiedDesugaredType(); + + // check if it's a builtin type first (simple check, no need to cache it) hekota wr

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

2024-10-22 Thread Sarah Spall via cfe-commits
@@ -808,6 +835,20 @@ bool SPIRVInstructionSelector::selectExtInst(Register ResVReg, return false; } +bool SPIRVInstructionSelector::selectNAryOpWithSrcs(Register ResVReg, +const SPIRVType *ResType, +

[clang] [HLSL] get inout/out ABI for array parameters working (PR #111047)

2024-10-22 Thread Eli Friedman via cfe-commits
@@ -5811,9 +5811,12 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { // This function implements trivial copy assignment for HLSL's // assignable constant arrays. LValue CodeGenFunction::EmitHLSLArrayAssignLValue(const BinaryOperator *E) { - LVal

[clang] [HLSL] get inout/out ABI for array parameters working (PR #111047)

2024-10-22 Thread Eli Friedman via cfe-commits
@@ -4690,8 +4690,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, return emitWritebackArg(*this, args, CRE); } - assert(type->isReferenceType() == E->isGLValue() && - "reference binding to unmaterialized r-value!"); + assert(type->isArr

[clang] [HLSL] get inout/out ABI for array parameters working (PR #111047)

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

[clang] [HLSL] get inout/out ABI for array parameters working (PR #111047)

2024-10-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: I'd like to see a testcase for passing an array parameter to another function which takes an array parameter. https://github.com/llvm/llvm-project/pull/111047 ___ cfe-commits mailing list cfe-commits@lists.l

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

2024-10-22 Thread Sarah Spall via cfe-commits
@@ -424,7 +424,7 @@ Register SPIRVGlobalRegistry::getOrCreateCompositeOrNull( LLT LLTy = LLT::scalar(64); Register SpvVecConst = CurMF->getRegInfo().createGenericVirtualRegister(LLTy); -CurMF->getRegInfo().setRegClass(SpvVecConst, &SPIRV::iIDRegClass); +

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-22 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, static_cast(std::__to_ad

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -18952,6 +18955,142 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: { CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0}, nullptr, "hlsl.radians"); } + case Builtin::BI__builtin_hlsl_splitdouble: { + +assert((E->getArg(0)->getType()->hasFlo

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

2024-10-22 Thread Farzon Lotfi via cfe-commits
@@ -424,7 +424,7 @@ Register SPIRVGlobalRegistry::getOrCreateCompositeOrNull( LLT LLTy = LLT::scalar(64); Register SpvVecConst = CurMF->getRegInfo().createGenericVirtualRegister(LLTy); -CurMF->getRegInfo().setRegClass(SpvVecConst, &SPIRV::iIDRegClass); +

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -2074,6 +2083,35 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { return true; break; } + case Builtin::BI__builtin_hlsl_elementwise_splitdouble: { +if (SemaRef.checkArgCount(TheCall, 3)) + return true; + +Expr *O

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2024-10-22 Thread Daniel Kiss via cfe-commits
https://github.com/DanielKristofKiss created https://github.com/llvm/llvm-project/pull/113368 Libunwind manages the registers/context including the program counter which is used effectively as a return address. __libunwind_Registers_arm64_jumpto can go anywhere where the given buffer 's PC poi

[clang] [llvm] [Support] Add VirtualOutputBackends to virtualize the output from tools (PR #68447)

2024-10-22 Thread Steven Wu via cfe-commits
https://github.com/cachemeifyoucan closed https://github.com/llvm/llvm-project/pull/68447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [RISCV][compiler-rt] Update __init_riscv_feature_bits prototype (PR #101472)

2024-10-22 Thread Jessica Clarke via cfe-commits
@@ -280,14 +280,18 @@ static void initRISCVFeature(struct riscv_hwprobe Hwprobes[]) { static int FeaturesBitCached = 0; -void __init_riscv_feature_bits() CONSTRUCTOR_ATTRIBUTE; +void __init_riscv_feature_bits(void *) CONSTRUCTOR_ATTRIBUTE; // A constructor function that s

[clang] [PS5][Driver] Pass default -z options to PS5 linker (PR #113162)

2024-10-22 Thread Edd Dawson via cfe-commits
https://github.com/playstation-edd updated https://github.com/llvm/llvm-project/pull/113162 >From 0d931fb93485472e2e7263496eb6d2bc71a9ae73 Mon Sep 17 00:00:00 2001 From: Edd Dawson Date: Mon, 21 Oct 2024 13:08:31 +0100 Subject: [PATCH 1/3] [PS5][Driver] Pass default -z options to PS5 linker Un

[clang] [compiler-rt] [libcxx] [llvm] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends by a new LIBCXX_CXX_ABI choice (PR #112978)

2024-10-22 Thread Louis Dionne via cfe-commits
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/112978 >From 85bac5f281c3d6038eda67eb8c0faf356a51c621 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 13 May 2022 09:26:01 -0400 Subject: [PATCH 1/4] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends

[clang] [compiler-rt] [llvm] [rtsan][llvm][NFC] Rename sanitize_realtime_unsafe attr to sanitize_realtime_blocking (PR #113155)

2024-10-22 Thread via cfe-commits
https://github.com/davidtrevelyan updated https://github.com/llvm/llvm-project/pull/113155 >From bf6c3c2a7953aff02549b0d03ef84fb846ad9d12 Mon Sep 17 00:00:00 2001 From: David Trevelyan Date: Mon, 21 Oct 2024 12:04:22 +0100 Subject: [PATCH 1/2] [rtsan][llvm][NFC] Rename sanitize_realtime_unsafe

[clang] [Clang] Add a flag to include GPU startup files (PR #112025)

2024-10-22 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/112025 >From a02a27171801ad3f5618099b5035ef8185c2f835 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 11 Oct 2024 12:21:49 -0500 Subject: [PATCH 1/3] [Clang] Add a flag to include GPU startup files Summary: The

[clang] [llvm] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic (PR #113382)

2024-10-22 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/113382 - add codegen for llvm builtin to spirv/directx intrinsic in CGBuiltin.cpp - add lowering of spirv intrinsic to spirv backend in SPIRVInstructionSelector.cpp - add lowering of directx intrinsic to dxil op

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -0,0 +1,102 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple spirv-vulkan-library %s -fnative-half-type -emit-l

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -0,0 +1,50 @@ +; 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 %} + +; Make sure lowering is correctly generating spirv code. + +; CH

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

2024-10-22 Thread Tex Riddell via cfe-commits
@@ -18952,6 +18955,142 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: { CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0}, nullptr, "hlsl.radians"); } + case Builtin::BI__builtin_hlsl_splitdouble: { + +assert((E->getArg(0)->getType()->hasFlo

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-10-22 Thread Tom Honermann via cfe-commits
tahonermann wrote: There is some interesting MSVC behavior that I'm not planning to replicate with the changes being done for this issue but that I thought are worth documenting (here at least, perhaps in Clang docs as well). MSVC documentation for the [`/external`](https://learn.microsoft.co

[clang] [llvm] [Support] Add VirtualOutputBackends to virtualize the output from tools (PR #68447)

2024-10-22 Thread Steven Wu via cfe-commits
cachemeifyoucan wrote: Close as moving to new stacked PR for easy review. https://github.com/llvm/llvm-project/pull/68447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PS5][Driver] Pass default -z options to PS5 linker (PR #113162)

2024-10-22 Thread Edd Dawson via cfe-commits
@@ -240,11 +242,32 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back( Args.MakeArgString("--sysroot=" + TC.getSDKLibraryRootDir())); - // Default to PIE for non-static executables. - const bool PIE = - !Args.hasA

[clang-tools-extra] [clang-tidy] Stop linking against clangSema (PR #113373)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Vlad Serebrennikov (Endilll) Changes This is bad layering-wise. The only fix needed now is to anchor `SemaConsumer` vtable, which is also done in this patch. --- Full diff: https://github.com/llvm/llvm-project/pull/113373.diff 2 Fi

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-10-22 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/106036 >From d4b07c7ff65ca64a5a434818ce09ecd289401340 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 10 Sep 2024 02:35:43 +0300 Subject: [PATCH] [Clang] restrict use of attribute names reserved by the C++ st

[clang] 03fef62 - [AMDGPU] Relax __builtin_amdgcn_update_dpp sema check (#113341)

2024-10-22 Thread via cfe-commits
Author: Stanislav Mekhanoshin Date: 2024-10-22T12:32:08-07:00 New Revision: 03fef62b84469c5dbbed04235c30eb96b6b48369 URL: https://github.com/llvm/llvm-project/commit/03fef62b84469c5dbbed04235c30eb96b6b48369 DIFF: https://github.com/llvm/llvm-project/commit/03fef62b84469c5dbbed04235c30eb96b6b483

[clang-tools-extra] [clang-tidy] Stop linking against clangSema (PR #113373)

2024-10-22 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks for this! https://github.com/llvm/llvm-project/pull/113373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Re-implement countbits with the correct return type (PR #113189)

2024-10-22 Thread Sarah Spall via cfe-commits
@@ -461,6 +461,67 @@ class OpLowerer { }); } + [[nodiscard]] bool lowerCtpopToCBits(Function &F) { +IRBuilder<> &IRB = OpBuilder.getIRB(); +Type *Int32Ty = IRB.getInt32Ty(); + +return replaceFunction(F, [&](CallInst *CI) -> Error { + IRB.SetInsertPoint(

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-22 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I've (unfortunately) stumbled upon a crash caused by this patch: ```cpp template struct A { template static constexpr bool f() requires U { return true; } }; template<> template constexpr bool A::f() requires U { return A::f(); } template<> templat

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-22 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: > > What are the implications/requirements for users of DataflowAnalysis? Every > > instance specifices it's own lattice, which is converted to/from llvm::Any. > > Will every lattice definition require these new declarations? > > If you think they will be used from external from t

[clang] [llvm] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic (PR #113382)

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

[clang] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it accessible outside of Sema (PR #113206)

2024-10-22 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/113206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic (PR #113382)

2024-10-22 Thread Finn Plummer via cfe-commits
inbelic wrote: Failing testcase is unrelated. Will need to rebase on review changes. https://github.com/llvm/llvm-project/pull/113382 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Added clamp intrinsic (PR #113394)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-spir-v Author: Adam Yang (adam-yang) Changes Fixes #88052 - Added the following intrinsics: - `int_spv_uclamp` - `int_spv_sclamp` - `int_spv_fclamp` - Update the clamp.hlsl unit tests to include SPIRV - Added the SPIRV specific tests ---

[clang] [llvm] [HLSL][SPIRV] Added clamp intrinsic (PR #113394)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-clang-codegen Author: Adam Yang (adam-yang) Changes Fixes #88052 - Added the following intrinsics: - `int_spv_uclamp` - `int_spv_sclamp` - `int_spv_fclamp` - Update the clamp.hlsl unit tests to include SPIRV - Added th

[clang] [HLSL] Change StructuredBuffer resource class to SRV (PR #113397)

2024-10-22 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113397 Changes `StructuredBuffer` resource class to SRV (read-only) according to existing [DXC](https://godbolt.org/z/EjY9jbv4W) implementation and [Proposal for mapping resource attributes](https://github.com/llvm/wg-

[clang] [HLSL] Change StructuredBuffer resource class to SRV (PR #113397)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Helena Kotas (hekota) Changes Changes `StructuredBuffer` resource class to SRV (read-only) according to existing [DXC](https://godbolt.org/z/EjY9jbv4W) implementation and [Proposal for mapping resource attributes](https://github.com/llvm/

[clang] [llvm] [HLSL][SPIRV] Added clamp intrinsic (PR #113394)

2024-10-22 Thread Adam Yang via cfe-commits
https://github.com/adam-yang ready_for_review https://github.com/llvm/llvm-project/pull/113394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9b98455 - [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it accessible outside of Sema (#113206)

2024-10-22 Thread via cfe-commits
Author: Helena Kotas Date: 2024-10-22T16:32:09-07:00 New Revision: 9b984554d769f1f81adb654345aa9ef37d5e5b44 URL: https://github.com/llvm/llvm-project/commit/9b984554d769f1f81adb654345aa9ef37d5e5b44 DIFF: https://github.com/llvm/llvm-project/commit/9b984554d769f1f81adb654345aa9ef37d5e5b44.diff

[clang] [llvm] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic (PR #113382)

2024-10-22 Thread Finn Plummer via cfe-commits
@@ -1762,6 +1765,36 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveActiveCountBits( +Register ResVReg, const SPIRVType *ResType, MachineInstr &I) const { + assert(I.getNumOperands() == 3); + as

[clang] [lld] [llvm] [WebAssembly] Define a new "Trail1" CPU (PR #112035)

2024-10-22 Thread Dan Gohman via cfe-commits
https://github.com/sunfishcode updated https://github.com/llvm/llvm-project/pull/112035 >From 8db1c6225cb938433f57414594cc3accae39f03c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 11 Oct 2024 04:30:32 -0700 Subject: [PATCH 1/7] [WebAssembly] Define a new "Trail1" CPU First, define some

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-22 Thread via cfe-commits
@@ -0,0 +1,33 @@ +#ifndef _SIM_STL_PAIR +#define _SIM_STL_PAIR + +#pragma clang system_header + +#include "sim_type_traits" + +namespace std { + + EugeneZelenko wrote: Ditto. https://github.com/llvm/llvm-project/pull/110471 __

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-22 Thread via cfe-commits
@@ -0,0 +1,34 @@ +#ifndef _SIM_UNORDERED_MAP +#define _SIM_UNORDERED_MAP + + EugeneZelenko wrote: Excessive newline. https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-22 Thread via cfe-commits
https://github.com/vabridgers updated https://github.com/llvm/llvm-project/pull/110471 >From 6b6f57823a1f788df25211c5131f5760efa54140 Mon Sep 17 00:00:00 2001 From: einvbri Date: Thu, 26 Sep 2024 16:24:59 +0200 Subject: [PATCH] [clang-tidy] [analyzer] Move nondeterministic pointer usage check

[clang-tools-extra] [clang-tidy] Fix for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-10-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank closed https://github.com/llvm/llvm-project/pull/104540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 0fbf91a - [clang-tidy] Fix cppcoreguidelines-pro-type-union-access if memLoc is invalid (#104540)

2024-10-22 Thread via cfe-commits
Author: Konstantin Romanov Date: 2024-10-22T17:05:00-07:00 New Revision: 0fbf91ab8e395717ed886c6827ca572c5baaa7a0 URL: https://github.com/llvm/llvm-project/commit/0fbf91ab8e395717ed886c6827ca572c5baaa7a0 DIFF: https://github.com/llvm/llvm-project/commit/0fbf91ab8e395717ed886c6827ca572c5baaa7a0.

[clang-tools-extra] [clang-tidy] Fix for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-10-22 Thread via cfe-commits
github-actions[bot] wrote: @ksromanov 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] [TBAA] Extend pointer TBAA to pointers of non-builtin types. (PR #110569)

2024-10-22 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/110569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4334f31 - [TBAA] Extend pointer TBAA to pointers of non-builtin types. (#110569)

2024-10-22 Thread via cfe-commits
Author: Florian Hahn Date: 2024-10-22T16:23:34-07:00 New Revision: 4334f317e7fb2bdeaa15e912bbe0cd3162faf02c URL: https://github.com/llvm/llvm-project/commit/4334f317e7fb2bdeaa15e912bbe0cd3162faf02c DIFF: https://github.com/llvm/llvm-project/commit/4334f317e7fb2bdeaa15e912bbe0cd3162faf02c.diff

[clang] [llvm] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic (PR #113382)

2024-10-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Finn Plummer (inbelic) Changes - add codegen for llvm builtin to spirv/directx intrinsic in CGBuiltin.cpp - add lowering of spirv intrinsic to spirv backend in SPIRVInstructionSelector.cpp - add lowering of directx intrinsic

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-22 Thread via cfe-commits
https://github.com/vabridgers updated https://github.com/llvm/llvm-project/pull/110471 >From ec58222f317c07615d64732b2d822b0b888a2aad Mon Sep 17 00:00:00 2001 From: einvbri Date: Thu, 26 Sep 2024 16:24:59 +0200 Subject: [PATCH] [clang-tidy] [analyzer] Move nondeterministic pointer usage check

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-10-22 Thread via cfe-commits
@@ -0,0 +1,83 @@ +// RUN: %check_clang_tidy %s bugprone-nondeterministic-pointer-iteration-order %t -- -- -I%S -std=c++!4 + +#include "Inputs/system-header-simulator/sim_set" +#include "Inputs/system-header-simulator/sim_unordered_set" +#include "Inputs/system-header-simulator/si

[clang] [llvm] [AMDGPU] Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor (PR #94647)

2024-10-22 Thread Jun Wang via cfe-commits
@@ -683,6 +706,59 @@ struct AAAMDAttributesFunction : public AAAMDAttributes { return !A.checkForAllCallLikeInstructions(DoesNotRetrieve, *this, UsedAssumedInformation); } + + // Returns true if FlatScratchInit is needed, i.e

[clang] [llvm] [mlir] [OpenMP][OMPIRBuilder] Error propagation across callbacks (PR #112533)

2024-10-22 Thread Tom Eccles via cfe-commits
@@ -1171,12 +1179,15 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, // post finalization block that is known to the FiniCB callback. Builder.SetInsertPoint(CancellationBlock); if (ExitCB) -ExitCB(Builder.saveIP()); +if (Error Err = ExitCB(Bu

[clang] [llvm] [mlir] [OpenMP][OMPIRBuilder] Error propagation across callbacks (PR #112533)

2024-10-22 Thread Tom Eccles via cfe-commits
@@ -1496,7 +1507,8 @@ IRBuilder<>::InsertPoint OpenMPIRBuilder::createParallel( // Let the caller create the body. assert(BodyGenCB && "Expected body generation callback!"); InsertPointTy CodeGenIP(PRegBodyBB, PRegBodyBB->begin()); - BodyGenCB(InnerAllocaIP, CodeGenIP);

  1   2   3   4   5   >