[libclc] [libclc] Move min/max/clamp into the CLC builtins library (PR #114386)

2024-10-31 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,11 @@ +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_max(__CLC_GENTYPE a, + __CLC_GENTYPE b) { + return (a > b ? a : b); +} + +#ifndef __CLC_SCALAR +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_max(__CLC_GENTYPE a, +

[clang] [clang][CodeGen][OpenCL] Fix `alloca` handling & `sret`when compiling for (PR #113930)

2024-10-30 Thread Matt Arsenault via cfe-commits
@@ -108,11 +108,15 @@ RawAddress CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align, if (AllocaAddr) *AllocaAddr = Alloca; llvm::Value *V = Alloca.getPointer(); + assert((!getLangOpts().OpenCL || + CGM.getTarget().getTargetAddressSpace(getASTAl

[clang] [NFC] [clang] Use std::string instead of StringRef to reduce stack usage (PR #114285)

2024-10-30 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: If you really want to work around MSVC's bug, you could change tablegen to emit the string literals as constant globals / StringLiteral https://github.com/llvm/llvm-project/pull/114285 ___ cfe-commits mailing list

[clang] [NFC] [clang] Use std::string instead of StringRef to reduce stack usage (PR #114285)

2024-10-30 Thread Matt Arsenault via cfe-commits
arsenm wrote: That sounds like MSVC's problem to solve. Why does the amount of stack size matter https://github.com/llvm/llvm-project/pull/114285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-10-30 Thread Matt Arsenault via cfe-commits
@@ -722,6 +722,36 @@ static Value *emitFrexpBuiltin(CodeGenFunction &CGF, const CallExpr *E, return CGF.Builder.CreateExtractValue(Call, 0); } +static void emitSincosBuiltin(CodeGenFunction &CGF, const CallExpr *E, + llvm::Intrinsic::ID Intrinsi

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-10-30 Thread Matt Arsenault via cfe-commits
@@ -722,6 +722,38 @@ static Value *emitFrexpBuiltin(CodeGenFunction &CGF, const CallExpr *E, return CGF.Builder.CreateExtractValue(Call, 0); } +static void emitSincosBuiltin(CodeGenFunction &CGF, const CallExpr *E, + llvm::Intrinsic::ID Intrinsi

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

2024-10-29 Thread Matt Arsenault via cfe-commits
@@ -23,8 +25,10 @@ X Test() // sret argument. // CHECK-CXX98: call void @_ZN1XC1ERKS_( // CHECK-CXX11: call void @_ZN1XC1EOS_( + // CHECK-CXX11-NONZEROALLOCAAS: call void @_ZN1XC1EOS_( arsenm wrote: Can you add more context checks here? https://github.

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

2024-10-29 Thread Matt Arsenault via cfe-commits
@@ -5390,11 +5391,19 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, V->getType()->isIntegerTy()) V = Builder.CreateZExt(V, ArgInfo.getCoerceToType()); -// If the argument doesn't match, perform a bitcast to coerce it. This -

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

2024-10-29 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/114062 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-10-29 Thread Matt Arsenault via cfe-commits
@@ -5390,11 +5391,19 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, V->getType()->isIntegerTy()) V = Builder.CreateZExt(V, ArgInfo.getCoerceToType()); -// If the argument doesn't match, perform a bitcast to coerce it. This -

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

2024-10-29 Thread Matt Arsenault via cfe-commits
@@ -5390,11 +5391,19 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, V->getType()->isIntegerTy()) V = Builder.CreateZExt(V, ArgInfo.getCoerceToType()); -// If the argument doesn't match, perform a bitcast to coerce it. This -

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

2024-10-29 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: I agree that in theory a target could want to do something else, but that would be an ABI lowering decision. It doesn't naturally come from a source level type. Supporting such a target would require more work, but given the current state of the world just

[clang] need to pass executable name as arg[0] (PR #114067)

2024-10-29 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: Should fix commit description https://github.com/llvm/llvm-project/pull/114067 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Create an internal 'clc' builtins library (PR #109985)

2024-10-28 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/109985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov_dpp8 (PR #113610)

2024-10-28 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/113610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen][OpenCL] Fix `alloca` handling & `sret`when compiling for (PR #113930)

2024-10-28 Thread Matt Arsenault via cfe-commits
@@ -108,11 +108,15 @@ RawAddress CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align, if (AllocaAddr) *AllocaAddr = Alloca; llvm::Value *V = Alloca.getPointer(); + assert((!getLangOpts().OpenCL || + CGM.getTarget().getTargetAddressSpace(getASTAl

[clang] clang: Remove requires system-linux from some driver tests (PR #111976)

2024-10-28 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/111976 >From 91c2f46274f83603552b12317c2fb87a8633ccc3 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 11 Oct 2024 14:33:32 +0400 Subject: [PATCH 1/7] clang: Remove requires system-linux from some driver tests

[clang] [clang][CodeGen][OpenCL] Fix `alloca` handling & `sret`when compiling for (PR #113930)

2024-10-28 Thread Matt Arsenault via cfe-commits
@@ -108,11 +108,15 @@ RawAddress CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align, if (AllocaAddr) *AllocaAddr = Alloca; llvm::Value *V = Alloca.getPointer(); + assert((!getLangOpts().OpenCL || + CGM.getTarget().getTargetAddressSpace(getASTAl

[clang] [clang][CodeGen][OpenCL] Fix `alloca` handling & `sret`when compiling for (PR #113930)

2024-10-28 Thread Matt Arsenault via cfe-commits
@@ -1648,6 +1648,8 @@ CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI) { // Add type for sret argument. if (IRFunctionArgs.hasSRetArg()) { QualType Ret = FI.getReturnType(); +if (CGM.getLangOpts().OpenCL) + Ret = getContext().getAddrSpaceQualType(Ret, La

[clang] [clang][CodeGen][OpenCL] Fix `alloca` handling & `sret`when compiling for (PR #113930)

2024-10-28 Thread Matt Arsenault via cfe-commits
@@ -108,11 +108,15 @@ RawAddress CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align, if (AllocaAddr) *AllocaAddr = Alloca; llvm::Value *V = Alloca.getPointer(); + assert((!getLangOpts().OpenCL || + CGM.getTarget().getTargetAddressSpace(getASTAl

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

2024-10-26 Thread Matt Arsenault via cfe-commits
@@ -703,6 +715,39 @@ SDValue BPFTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { return DAG.getNode(BPFISD::SELECT_CC, DL, VTs, Ops); } +SDValue BPFTargetLowering::LowerATOMIC_LOAD(SDValue Op, +SelectionDAG &D

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov_dpp8 (PR #113610)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -152,6 +115,44 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, return false; } +bool SemaAMDGPU::CheckMovDPPFunctionCall(CallExpr *TheCall, unsigned NumArgs, arsenm wrote: Start with lowercase https://github.com/llvm/llvm-projec

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

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -703,6 +715,39 @@ SDValue BPFTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { return DAG.getNode(BPFISD::SELECT_CC, DL, VTs, Ops); } +SDValue BPFTargetLowering::LowerATOMIC_LOAD(SDValue Op, +SelectionDAG &D

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

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -703,6 +715,39 @@ SDValue BPFTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { return DAG.getNode(BPFISD::SELECT_CC, DL, VTs, Ops); } +SDValue BPFTargetLowering::LowerATOMIC_LOAD(SDValue Op, +SelectionDAG &D

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

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

2024-10-25 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

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

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -648,6 +648,17 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, Args.MakeArgString("-plugin-opt=-mattr=" + llvm::join(Features, ","))); } + if (Args.hasArg(options::OPT_stdlib)) +CmdArgs.append({"-lc", "-lm"}); + if (Args.hasArg(opt

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov_dpp8 (PR #113610)

2024-10-25 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/113610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,76 @@ +//===-- gpuintrin.h - Generic GPU intrinsic functions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -703,6 +715,39 @@ SDValue BPFTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { return DAG.getNode(BPFISD::SELECT_CC, DL, VTs, Ops); } +SDValue BPFTargetLowering::LowerATOMIC_LOAD(SDValue Op, +SelectionDAG &D

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

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -703,6 +715,39 @@ SDValue BPFTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { return DAG.getNode(BPFISD::SELECT_CC, DL, VTs, Ops); } +SDValue BPFTargetLowering::LowerATOMIC_LOAD(SDValue Op, +SelectionDAG &D

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

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -703,6 +715,39 @@ SDValue BPFTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { return DAG.getNode(BPFISD::SELECT_CC, DL, VTs, Ops); } +SDValue BPFTargetLowering::LowerATOMIC_LOAD(SDValue Op, +SelectionDAG &D

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-10-25 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang][HIP] Deprecate the AMDGCN_WAVEFRONT_SIZE macros (PR #112849)

2024-10-21 Thread Matt Arsenault via cfe-commits
arsenm wrote: > We already do this during legalisation / legacy ISEL; there might be merit > into doing it as early as possible though. Yes, we definitely need to start folding this out much earlier. https://github.com/llvm/llvm-project/pull/112849 _

[clang] [Clang][HIP] Deprecate the AMDGCN_WAVEFRONT_SIZE macros (PR #112849)

2024-10-21 Thread Matt Arsenault via cfe-commits
@@ -337,9 +337,12 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts, if (hasFastFMA()) Builder.defineMacro("FP_FAST_FMA"); - Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE__", Twine(WavefrontSize)); - // ToDo: deprecate this macro for naming consistency

[clang] [lld] [llvm] [mlir] [IR] Introduce `U` to `DataLayout` to represent undesirable address space if a target has it (PR #108786)

2024-10-21 Thread Matt Arsenault via cfe-commits
arsenm wrote: > So your solution here is to simply "infect" every language with full address > space awareness? It's similar to, but a simpler version of the ABI emission problem. The frontend has to know properties of the target to emit the IR for it. It's infeasible to encode all of the po

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov/update_dpp (PR #112447)

2024-10-21 Thread Matt Arsenault via cfe-commits
arsenm wrote: > I actually wish a better way to have overloaded builtins in clang. I do not > believe any user of these builtins is expecting that a wide integer will be > silently truncated, and any fp will go through fptosi and backwards after, > like we do now. Yes, C was a mistake http

[clang] [llvm] APFloat: Fix maxnum and minnum with sNaN (PR #112854)

2024-10-21 Thread Matt Arsenault via cfe-commits
@@ -15338,16 +15338,11 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { case Builtin::BI__builtin_fmaxl: case Builtin::BI__builtin_fmaxf16: case Builtin::BI__builtin_fmaxf128: { -// TODO: Handle sNaN. APFloat RHS(0.); if (!EvaluateFloat(E->get

[clang] [llvm] APFloat: Fix maxnum and minnum with sNaN (PR #112854)

2024-10-21 Thread Matt Arsenault via cfe-commits
@@ -582,7 +582,46 @@ TEST(APFloatTest, MinNum) { APFloat zp(0.0); APFloat zn(-0.0); EXPECT_EQ(-0.0, minnum(zp, zn).convertToDouble()); - EXPECT_EQ(-0.0, minnum(zn, zp).convertToDouble()); + + APInt intPayload_89ab(64, 0x89ab); arsenm wrote: Can / shoul

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK + +float fminf (float, float); +double fmin (double, double); +long double fminl (long double, long double); +float fmaxf (float, float); +double fmax (double, double);

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread Matt Arsenault via cfe-commits
@@ -2858,10 +2862,13 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__builtin_fminf: case Builtin::BI__builtin_fminf16: case Builtin::BI__builtin_fminl: -case Builtin::BI__builtin_fminf128: - return RVal

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK + +float fminf (float, float); +double fmin (double, double); +long double fminl (long double, long double); +float fmaxf (float, float); +double fmax (double, double);

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK + +float fminf (float, float); +double fmin (double, double); +long double fminl (long double, long double); +float fmaxf (float, float); +double fmax (double, double);

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: We should also add new builtins (with the minnum/maxnum names) to get the stronger 2019 behavior https://github.com/llvm/llvm-project/pull/113133 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [lld] [llvm] [mlir] [IR] Introduce `U` to `DataLayout` to represent undesirable address space if a target has it (PR #108786)

2024-10-20 Thread Matt Arsenault via cfe-commits
arsenm wrote: > More specifically, how do you expect Clang to figure this out when e.g. > compiling C++ for some AS rich target that decided to default to something > odd I do not expect clang to be using the datalayout to decide anything. That is not really the purpose of the datalayout. It

[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

2024-10-19 Thread Matt Arsenault via cfe-commits
@@ -1,12 +1,14 @@ ; This test aims to check ability to support "Arithmetic with Overflow" intrinsics ; in the special case when those intrinsics are being generated by the CodeGenPrepare; -; pass during translations with optimization (note -O3 in llc arguments). +; pass during

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov/update_dpp (PR #112447)

2024-10-19 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][HIP] Deprecate the AMDGCN_WAVEFRONT_SIZE macros (PR #112849)

2024-10-18 Thread Matt Arsenault via cfe-commits
@@ -26,8 +27,14 @@ class MacroBuilder { MacroBuilder(raw_ostream &Output) : Out(Output) {} /// Append a \#define line for macro of the form "\#define Name Value\n". - void defineMacro(const Twine &Name, const Twine &Value = "1") { + /// If DeprecationMsg is provided, als

[clang] [Clang][HIP] Deprecate the AMDGCN_WAVEFRONT_SIZE macros (PR #112849)

2024-10-18 Thread Matt Arsenault via cfe-commits
@@ -337,9 +337,12 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts, if (hasFastFMA()) Builder.defineMacro("FP_FAST_FMA"); - Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE__", Twine(WavefrontSize)); - // ToDo: deprecate this macro for naming consistency

[clang] clang: Remove requires system-linux from some driver tests (PR #111976)

2024-10-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/111976 >From baa479b12bcbe8456bfef79315ad8ee9a2dcb533 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 11 Oct 2024 14:33:32 +0400 Subject: [PATCH 1/6] clang: Remove requires system-linux from some driver tests

[clang] [llvm] [mlir] [LLVM][TableGen] Change all `Init` pointers to const (PR #112705)

2024-10-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112705 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [TLI] Add support for the `ilogb` libcall. (PR #112725)

2024-10-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [LLVM][TableGen] Change all `Init` pointers to const (PR #112705)

2024-10-17 Thread Matt Arsenault via cfe-commits
arsenm wrote: I think const should always be used in all situations https://github.com/llvm/llvm-project/pull/112705 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenCL] Replace a CreatePointerCast call; NFC (PR #112676)

2024-10-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/AMDGPU: Set noalias.addrspace metadata on atomicrmw (PR #102462)

2024-10-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/102462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/HIP: Remove REQUIRES windows from a test (PR #112411)

2024-10-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/112411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/HIP: Remove REQUIRES libgcc from a test (PR #112412)

2024-10-17 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/112412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov/update_dpp (PR #112447)

2024-10-16 Thread Matt Arsenault via cfe-commits
@@ -7,3 +7,37 @@ void test_gfx9_fmed3h(global half *out, half a, half b, half c) { *out = __builtin_amdgcn_fmed3h(a, b, c); // expected-error {{'__builtin_amdgcn_fmed3h' needs target feature gfx9-insts}} } + +void test_mov_dpp(global int* out, int src, int i) +{ + *out = __

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov/update_dpp (PR #112447)

2024-10-16 Thread Matt Arsenault via cfe-commits
@@ -102,20 +102,66 @@ void test_s_dcache_wb() __builtin_amdgcn_s_dcache_wb(); } -// CHECK-LABEL: @test_mov_dpp +// CHECK-LABEL: @test_mov_dpp_int // CHECK: {{.*}}call{{.*}} i32 @llvm.amdgcn.update.dpp.i32(i32 poison, i32 %src, i32 0, i32 0, i32 0, i1 false) -void test_mov_

[clang] [clang][OpenCL][CodeGen][AMDGPU] Do not use `private` as the default AS for when `generic` is available (PR #112442)

2024-10-16 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang: Remove requires system-linux from some driver tests (PR #111976)

2024-10-16 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/111976 >From cf55bacc51b83c42320607c10eeb173e3a917e8c Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 11 Oct 2024 14:33:32 +0400 Subject: [PATCH 1/5] clang: Remove requires system-linux from some driver tests

[clang] clang/HIP: Remove REQUIRES windows from a test (PR #112411)

2024-10-16 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/112411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/HIP: Remove REQUIRES libgcc from a test (PR #112412)

2024-10-16 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/112412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenCL][NFC] Switch two tests to being generated (PR #112554)

2024-10-16 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenCL][NFC] Switch two tests to being generated (PR #112554)

2024-10-16 Thread Matt Arsenault via cfe-commits
@@ -1,67 +1,107 @@ -// RUN: %clang_cc1 -O0 -cl-std=CL1.2 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL12 %s -// RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL20 %s +// NOTE:

[clang] [llvm] [llvm][opt][Transforms][SPIR-V] Enable `InferAddressSpaces` for SPIR-V (PR #110897)

2024-10-16 Thread Matt Arsenault via cfe-commits
@@ -91,6 +97,88 @@ SPIRVTargetMachine::SPIRVTargetMachine(const Target &T, const Triple &TT, setRequiresStructuredCFG(false); } +enum AddressSpace { + Function = storageClassToAddressSpace(SPIRV::StorageClass::Function), + CrossWorkgroup = + storageClassToAddressSpac

[clang] [clang][OpenCL][CodeGen][AMDGPU] Do not use `private` as the default AS for when `generic` is available (PR #112442)

2024-10-16 Thread Matt Arsenault via cfe-commits
@@ -5903,7 +5904,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, auto Call = RValue::get( EmitRuntimeCall(CGM.CreateRuntimeFunction(FTy, Name), Args)); if (TmpSize) -EmitLifetimeEnd(TmpSize, TmpPtr); +

[clang] [OpenCL] Restore addrspacecast for pipe builtins and update test (PR #112514)

2024-10-16 Thread Matt Arsenault via cfe-commits
@@ -1,69 +1,67 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=clc++ -o - %s | FileCheck %s -// FIXME: Add MS ABI manglings of OpenCL things and remove %itanium_abi_triple arsenm wrote: It's 2 different paths t

[clang] [OpenCL] Restore addrspacecast for pipe builtins and update test (PR #112514)

2024-10-16 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenCL] Restore addrspacecast for pipe builtins and update test (PR #112514)

2024-10-16 Thread Matt Arsenault via cfe-commits
@@ -1,69 +1,67 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=clc++ -o - %s | FileCheck %s -// FIXME: Add MS ABI manglings of OpenCL things and remove %itanium_abi_triple arsenm wrote: Test both run lines? ht

[clang] [AMDGPU] Allow overload of __builtin_amdgcn_mov/update_dpp (PR #112447)

2024-10-15 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: This needs some sema type restrictions to make sure it's something sensible https://github.com/llvm/llvm-project/pull/112447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] clang: Remove some pointer bitcasts (PR #112324)

2024-10-15 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/112324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang: Remove requires system-linux from some driver tests (PR #111976)

2024-10-15 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/111976 >From a8e3a3ddeae1ba406b6f64d8b71e302a907cdc51 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 11 Oct 2024 14:33:32 +0400 Subject: [PATCH 1/2] clang: Remove requires system-linux from some driver tests

[clang] [Clang] Allow all address spaces to be converted to the default (PR #112248)

2024-10-15 Thread Matt Arsenault via cfe-commits
arsenm wrote: > They should not "just work" if you're compiling for vanilla C/C++ (so not > CUDA C++, or SYCL, or OpenCL C/C++ etc.) because neither of those defines > such a notion. a6a237f2046ad8993db30481c8b61aeb2f73a5ad added an explicit addrspace_cast operator. It would be better to use

[clang] clang/AMDGPU: Set noalias.addrspace metadata on atomicrmw (PR #102462)

2024-10-14 Thread Matt Arsenault via cfe-commits
arsenm wrote: ping https://github.com/llvm/llvm-project/pull/102462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang: Remove requires system-linux from some driver tests (PR #111976)

2024-10-14 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/111976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang: Fix hipstdpar test relying on default target (PR #111975)

2024-10-14 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/111975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow all address spaces to be converted to the default (PR #112248)

2024-10-14 Thread Matt Arsenault via cfe-commits
arsenm wrote: > I'm thinking we could have a language option like > `-fimplicit-default-addrspace-cast` that allows all conversions to default. > Then if we want users to be aware that this even exists we could suggest it > in the error message if it would fix it. > > I do understand that the

[clang] [Clang] Allow all address spaces to be converted to the default (PR #112248)

2024-10-14 Thread Matt Arsenault via cfe-commits
@@ -721,7 +721,9 @@ class Qualifiers { // to implicitly cast into the default address space. (A == LangAS::Default && (B == LangAS::cuda_constant || B == LangAS::cuda_device || - B == LangAS::cuda_shared)); + B == LangAS

[clang] [llvm] [llvm][opt][Transforms][SPIR-V] Enable `InferAddressSpaces` for SPIR-V (PR #110897)

2024-10-14 Thread Matt Arsenault via cfe-commits
@@ -91,6 +97,100 @@ SPIRVTargetMachine::SPIRVTargetMachine(const Target &T, const Triple &TT, setRequiresStructuredCFG(false); } +enum AddressSpace { + Function = storageClassToAddressSpace(SPIRV::StorageClass::Function), + CrossWorkgroup = + storageClassToAddressSpa

[clang] [llvm] [llvm][opt][Transforms][SPIR-V] Enable `InferAddressSpaces` for SPIR-V (PR #110897)

2024-10-14 Thread Matt Arsenault via cfe-commits
@@ -91,6 +97,100 @@ SPIRVTargetMachine::SPIRVTargetMachine(const Target &T, const Triple &TT, setRequiresStructuredCFG(false); } +enum AddressSpace { + Function = storageClassToAddressSpace(SPIRV::StorageClass::Function), + CrossWorkgroup = + storageClassToAddressSpa

[clang] [HIP] Replace use of `llvm-mc` with `clang` (PR #112041)

2024-10-14 Thread Matt Arsenault via cfe-commits
arsenm wrote: > > I fixed an apparent missing test dependency in > > [1ac6ef5](https://github.com/llvm/llvm-project/commit/1ac6ef5af28b72e534496a9833a2b75a2aba66cc) > > and this commit removed the llvm-mc dependency > > I probably should've remembered to include removing that in this patch. I

[clang] [HIP] Replace use of `llvm-mc` with `clang` (PR #112041)

2024-10-14 Thread Matt Arsenault via cfe-commits
arsenm wrote: I fixed an apparent missing test dependency in 1ac6ef5af28b72e534496a9833a2b75a2aba66cc and this commit removed the llvm-mc dependency https://github.com/llvm/llvm-project/pull/112041 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s +// FIXME: %clang_cc1 -std=c++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s +// expected-no-diagnostics + +constexpr double NaN = __builtin_nan(""); +constexpr double Inf = __builtin_in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
arsenm wrote: Maybe should add support for elementwise builtins next https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s +// FIXME: %clang_cc1 -std=c++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s +// expected-no-diagnostics + +constexpr double NaN = __builtin_nan(""); +constexpr double Inf = __builtin_in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread Matt Arsenault via cfe-commits
@@ -372,6 +372,31 @@ void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) { // HAS_MAYTRAP: declare float @llvm.experimental.constrained.minnum.f32( // HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.minnum.f80( + fmaximum_num(*d,*d);

[clang] [HIP] Replace use of `llvm-mc` with `clang` (PR #112041)

2024-10-11 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/112041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] Replace use of `llvm-mc` with `clang` (PR #112041)

2024-10-11 Thread Matt Arsenault via cfe-commits
@@ -463,10 +463,11 @@ void HIP::constructGenerateObjFileFromHIPFatBinary( Objf << ObjBuffer; - ArgStringList McArgs{"-triple", Args.MakeArgString(HostTriple.normalize()), + ArgStringList McArgs{"-target", Args.MakeArgString(HostTriple.normalize()),

[clang] [HIP] Replace use of `llvm-mc` with `clang` (PR #112041)

2024-10-11 Thread Matt Arsenault via cfe-commits
@@ -463,10 +463,11 @@ void HIP::constructGenerateObjFileFromHIPFatBinary( Objf << ObjBuffer; - ArgStringList McArgs{"-triple", Args.MakeArgString(HostTriple.normalize()), + ArgStringList McArgs{"-target", Args.MakeArgString(HostTriple.normalize()),

[clang] [HIP] Replace use of `llvm-mc` with `clang` (PR #112041)

2024-10-11 Thread Matt Arsenault via cfe-commits
@@ -463,10 +463,11 @@ void HIP::constructGenerateObjFileFromHIPFatBinary( Objf << ObjBuffer; - ArgStringList McArgs{"-triple", Args.MakeArgString(HostTriple.normalize()), + ArgStringList McArgs{"-target", Args.MakeArgString(HostTriple.normalize()),

[clang] clang: Add llvm-mc to CLANG_TEST_DEPS (PR #112032)

2024-10-11 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/112032 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang: Add llvm-mc to CLANG_TEST_DEPS (PR #112032)

2024-10-11 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm ready_for_review https://github.com/llvm/llvm-project/pull/112032 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang: Add llvm-mc to CLANG_TEST_DEPS (PR #112032)

2024-10-11 Thread Matt Arsenault via cfe-commits
arsenm wrote: * **#112032** https://app.graphite.dev/github/pr/llvm/llvm-project/112032?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 * `main` This stack of pull requests is managed by Graphi

<    1   2   3   4   5   6   7   8   9   10   >