[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-06-06 Thread Jon Chesterfield via cfe-commits
https://github.com/JonChesterfield closed https://github.com/llvm/llvm-project/pull/89007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-31 Thread Matt Arsenault via cfe-commits
arsenm wrote: > I think the comments here are fed into #93362 successfully, will go through > the list again to check. So #93362 is the replacement, and not the sequential next piece? Can we close this one then? https://github.com/llvm/llvm-project/pull/89007

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-24 Thread Jon Chesterfield via cfe-commits
@@ -115,7 +115,13 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo ) const { Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction , Address VAListAddr, QualType Ty) const { - llvm_unreachable("AMDGPU does not support varargs"); + const bool

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-24 Thread Jon Chesterfield via cfe-commits
JonChesterfield wrote: I think the comments here are fed into https://github.com/llvm/llvm-project/pull/93362 successfully, will go through the list again to check. https://github.com/llvm/llvm-project/pull/89007 ___ cfe-commits mailing list

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-08 Thread Matt Arsenault via cfe-commits
@@ -247,7 +247,7 @@ Address CodeGen::emitMergePHI(CodeGenFunction , Address Addr1, bool CodeGen::isEmptyField(ASTContext , const FieldDecl *FD, bool AllowArrays, bool AsIfNoUniqueAddr) { - if (FD->isUnnamedBitField()) + if

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-08 Thread Matt Arsenault via cfe-commits
@@ -157,7 +157,7 @@ llvm::Value *CodeGen::emitRoundPointerUpToAlignment(CodeGenFunction , llvm::Value *RoundUp = CGF.Builder.CreateConstInBoundsGEP1_32( CGF.Builder.getInt8Ty(), Ptr, Align.getQuantity() - 1); return CGF.Builder.CreateIntrinsic( -

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-05-08 Thread Matt Arsenault via cfe-commits
@@ -24,6 +24,7 @@ MODULE_PASS("amdgpu-lower-ctor-dtor", AMDGPUCtorDtorLoweringPass()) MODULE_PASS("amdgpu-lower-module-lds", AMDGPULowerModuleLDSPass(*this)) MODULE_PASS("amdgpu-printf-runtime-binding", AMDGPUPrintfRuntimeBindingPass()) MODULE_PASS("amdgpu-unify-metadata",

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: I just read over this and left some comments. https://github.com/llvm/llvm-project/pull/89007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert edited https://github.com/llvm/llvm-project/pull/89007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-18 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-18 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 c6e01627acf8591830ee1d211cff4d5388095f3d 0245f901d1abd3a0e5b859921585d250868e8e90 --

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Jon Chesterfield via cfe-commits
JonChesterfield wrote: Drive by fixes to some of Matt's comments. Caught a missing line in a .def file for NVPTX through luck due to the enum rename which means the Other/new-pm-thinlto-postlink-samplepgo-defaults.ll style tests need to be patched again - leaving that for now as I want to

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Jon Chesterfield via cfe-commits
@@ -115,7 +115,13 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo ) const { Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction , Address VAListAddr, QualType Ty) const { - llvm_unreachable("AMDGPU does not support varargs"); + const bool

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -115,7 +115,13 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo ) const { Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction , Address VAListAddr, QualType Ty) const { - llvm_unreachable("AMDGPU does not support varargs"); + const bool

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Jon Chesterfield via cfe-commits
@@ -115,7 +115,13 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo ) const { Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction , Address VAListAddr, QualType Ty) const { - llvm_unreachable("AMDGPU does not support varargs"); + const bool

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,43 @@ +//===- ExpandVariadics.h - expand variadic functions *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -115,7 +115,13 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo ) const { Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction , Address VAListAddr, QualType Ty) const { - llvm_unreachable("AMDGPU does not support varargs"); + const bool

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -154,11 +154,20 @@ llvm::Value *CodeGen::emitRoundPointerUpToAlignment(CodeGenFunction , llvm::Value *Ptr, CharUnits Align) { // OverflowArgArea = (OverflowArgArea +

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-17 Thread Matt Arsenault via cfe-commits
@@ -154,11 +154,20 @@ llvm::Value *CodeGen::emitRoundPointerUpToAlignment(CodeGenFunction , llvm::Value *Ptr, CharUnits Align) { // OverflowArgArea = (OverflowArgArea +

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Jon Chesterfield via cfe-commits
@@ -154,11 +154,20 @@ llvm::Value *CodeGen::emitRoundPointerUpToAlignment(CodeGenFunction , llvm::Value *Ptr, CharUnits Align) { // OverflowArgArea = (OverflowArgArea +

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Eli Friedman via cfe-commits
@@ -154,11 +154,20 @@ llvm::Value *CodeGen::emitRoundPointerUpToAlignment(CodeGenFunction , llvm::Value *Ptr, CharUnits Align) { // OverflowArgArea = (OverflowArgArea +

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-transforms Author: Jon Chesterfield (JonChesterfield) Changes Rewrite calls to variadic functions into calls to an equivalent non-variadic function. This makes calls to known variadic functions a zero cost abstraction. The GPUs use it as a

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Jon Chesterfield (JonChesterfield) Changes Rewrite calls to variadic functions into calls to an equivalent non-variadic function. This makes calls to known variadic functions a zero cost abstraction. The GPUs use it as a backend