[clang] [win][arm64ec] XFAIL x64 intrinsic tests on Arm64EC (PR #153474)

2025-08-14 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/153474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix MSVC warning in CompilerInvocation.cpp (PR #152809)

2025-08-10 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/152809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix MSVC warning in CompilerInvocation.cpp (PR #152809)

2025-08-09 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > Can we simply change `unsigned` to `int` in Line ? What do you think? Yep, that works. https://github.com/llvm/llvm-project/pull/152809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] Fix MSVC warning in CompilerInvocation.cpp (PR #152809)

2025-08-09 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/152809 >From 5377e6907af9cbfb339a49d0a37f590cdc8f3d17 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Fri, 8 Aug 2025 15:37:17 -0700 Subject: [PATCH] Fix MSVC warning in CompilerInvocation.cpp --- clang/lib/

[clang] Fix MSVC warning in CompilerInvocation.cpp (PR #152809)

2025-08-08 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/152809 >From 75c3807d187492cb481bd08c8c1eada8552b54b6 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Fri, 8 Aug 2025 15:37:17 -0700 Subject: [PATCH] Fix MSVC warning in CompilerInvocation.cpp --- clang/lib/

[clang] Fix MSVC warning in CompilerInvocation.cpp (PR #152809)

2025-08-08 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/152809 Building Clang using MSVC was resulting in the following warning: ``` tuple(791): warning C4018: '<': signed/unsigned mismatch ``` I traced this to CompilerInvocation.cpp where it was creating a `std::tuple`

[clang] [Arm64EC][clang] Implement varargs support in clang. (PR #152411)

2025-08-08 Thread Daniel Paoliello via cfe-commits
@@ -132,6 +132,10 @@ class ABIInfo { virtual llvm::FixedVectorType * getOptimalVectorMemoryType(llvm::FixedVectorType *T, const LangOptions &Opt) const; + + /// Used by Arm64EC calling convention code to call into x86 calling + /// convention

[clang] [Arm64EC][clang] Implement varargs support in clang. (PR #152411)

2025-08-08 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. https://github.com/llvm/llvm-project/pull/152411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Arm64EC][clang] Implement varargs support in clang. (PR #152411)

2025-08-08 Thread Daniel Paoliello via cfe-commits
@@ -132,6 +132,10 @@ class ABIInfo { virtual llvm::FixedVectorType * getOptimalVectorMemoryType(llvm::FixedVectorType *T, const LangOptions &Opt) const; + + /// Used by Arm64EC calling convention code to call into x86 calling + /// convention

[clang] [Arm64EC][clang] Implement varargs support in clang. (PR #152411)

2025-08-08 Thread Daniel Paoliello via cfe-commits
@@ -1409,6 +1409,12 @@ class WinX86_64ABIInfo : public ABIInfo { return isX86VectorCallAggregateSmallEnough(NumMembers); } + ABIArgInfo classifyArgForArm64ECVarArg(QualType Ty) const override { dpaoliello wrote: Let's add some comments to explain this

[clang] [llvm] [win][arm64ec] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-31 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/150068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-24 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/150068 >From 8e6ec9a09cda6ffdbfd91250fae186ba8585dbf4 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Tue, 22 Jul 2025 10:17:02 -0700 Subject: [PATCH] Fixes to unblock building LLVM and Clang as Arm64EC ---

[clang] [llvm] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-24 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello edited https://github.com/llvm/llvm-project/pull/150068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-24 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/150068 >From 7c573fb412a0701e7e5573d989c42ff14d906129 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Tue, 22 Jul 2025 10:17:02 -0700 Subject: [PATCH] Fixes to unblock building LLVM and Clang as Arm64EC ---

[clang] [llvm] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-24 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > ``` > -DCMAKE_EXE_LINKER_FLAGS="-Xlinker /MACHINE:ARM64EC" > -DCMAKE_SHARED_LINKER_FLAGS="-Xlinker /MACHINE:ARM64EC" > ``` > > Does clang not pick the right MACHINE automatically? I thought we had code > for that. Trying it out now, it looks like it is working fine without

[clang] [llvm] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-24 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/150068 >From 0231022256d5e600853bec6a511f413a011801a6 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Tue, 22 Jul 2025 10:17:02 -0700 Subject: [PATCH] Fixes to unblock building LLVM and Clang as Arm64EC ---

[clang] [llvm] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-22 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/150068 >From 3c087665701751fb4733060551b04542c419cb46 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Tue, 22 Jul 2025 10:17:02 -0700 Subject: [PATCH] Fixes to unblock building LLVM and Clang as Arm64EC ---

[clang] [llvm] Fixes to unblock building LLVM and Clang as Arm64EC (PR #150068)

2025-07-22 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/150068 These changes allow LLVM and Clang to be built with Clang targeting Arm64EC using the MSVC linker. Built with these options: ``` -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_HOST_TRIPLE=arm64ec-pc-windows-msvc -DCM

[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

2025-07-22 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/144745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows, take 2 (PR #147354)

2025-07-10 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > Thanks for the fix. But Clang::frame-pointer-elim.c test also started failing > on Windows on ARM with this PR: > > * https://lab.llvm.org/buildbot/#/builders/161/builds/6951 > > Can you please take a look? PR to fix: #148000 https://github.com/llvm/llvm-project/pull/1473

[clang] [clang] Use a specific target when testing that `-fomit-frame-pointer` and `-pg` are mutually exclusive (PR #148000)

2025-07-10 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/148000 Some targets, such as `aarch64-pc-windows-msvc`, always require that Frame Pointer be reserved even when `-fomit-frame-pointer` is provided, thus it is always valid to use `-pg` on those targets. This test

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows, take 2 (PR #147354)

2025-07-09 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: Fix: #147837 https://github.com/llvm/llvm-project/pull/147354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows, take 2 (PR #147354)

2025-07-09 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > Is anybody working on a fix or reversion? I can work on a fix: should be trivial. https://github.com/llvm/llvm-project/pull/147354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows (PR #146582)

2025-07-03 Thread Daniel Paoliello via cfe-commits
@@ -518,6 +518,27 @@ bool AArch64FrameLowering::hasFPImpl(const MachineFunction &MF) const { return false; } +/// Should the Frame Pointer be reserved for the current function? +bool AArch64FrameLowering::isFPReserved(const MachineFunction &MF) const { + const TargetMachin

[clang] __sys builtin support for AArch64 (PR #146456)

2025-07-02 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/146456 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [win][aarch64] Always reserve frame pointers for Arm64 Windows (PR #146582)

2025-07-01 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > Do we generate appropriate diagnostics for inline asm? Good call, I'll have to look into that. > Does the AArch64 backend actually support this flag? I briefly tried, and it > looks like this doesn't actually do anything. I think we only implemented > support for 32-bit Ar

[clang] [win][aarch64] Always reserve frame pointers for Arm64 Windows (PR #146582)

2025-07-01 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/146582 There is no way in Arm64 Windows to indicate that a given function has used the Frame Pointer as a General Purpose Register, as such stack walks will always assume that the frame chain is valid and will foll

[clang] __sys builtin support for AArch64 (PR #146456)

2025-07-01 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. https://github.com/llvm/llvm-project/pull/146456 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

2025-06-26 Thread Daniel Paoliello via cfe-commits
@@ -151,6 +151,8 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter { MCSymbol *LazyPointer) override; void emitCallInstruction(const llvm::MCInst &MCI); + bool needsNopAfterCallForWindowsEH(const MachineInstr *MI); + vo

[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

2025-06-26 Thread Daniel Paoliello via cfe-commits
@@ -2538,26 +2539,6 @@ void X86AsmPrinter::emitInstruction(const MachineInstr *MI) { case X86::SEH_BeginEpilogue: { dpaoliello wrote: Can this be folded into the case statement above, or will they fail on this assert? https://github.com/llvm/llvm-project/

[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

2025-06-26 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello edited https://github.com/llvm/llvm-project/pull/144745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

2025-06-26 Thread Daniel Paoliello via cfe-commits
@@ -0,0 +1,182 @@ +// REQUIRES: x86-registered-target + +// RUN: %clang_cl -c --target=x86_64-windows-msvc /EHa -O2 /GS- \ +// RUN: -Xclang=-import-call-optimization \ +// RUN: /clang:-S /clang:-o- %s 2>&1 \ dpaoliello wrote: Does this need the `--` before th

[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

2025-06-26 Thread Daniel Paoliello via cfe-commits
@@ -0,0 +1,182 @@ +// REQUIRES: x86-registered-target + +// RUN: %clang_cl -c --target=x86_64-windows-msvc /EHa -O2 /GS- \ +// RUN: -Xclang=-import-call-optimization \ +// RUN: /clang:-S /clang:-o- %s 2>&1 \ +// RUN: | FileCheck %s + +#ifdef __clang__ +#define NO_TAIL __attr

[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

2025-06-26 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. A few minor comments, but otherwise LGTM https://github.com/llvm/llvm-project/pull/144745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] InterlockedAdd_*, InterlockedAdd64_* support for AArch64 (PR #145607)

2025-06-25 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/145607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix Solaris buildbot (PR #145737)

2025-06-25 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/145737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix Solaris buildbot (PR #145737)

2025-06-25 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. https://github.com/llvm/llvm-project/pull/145737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-24 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] __sys builtin support (PR #145079)

2025-06-23 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. https://github.com/llvm/llvm-project/pull/145079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] __sys builtin support (PR #145079)

2025-06-20 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello edited https://github.com/llvm/llvm-project/pull/145079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] __sys builtin support (PR #145079)

2025-06-20 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. Couple of minor cleanups. Would like to hear from @efriedma-quic since I'm not familiar with the architecture specifics. https://github.com/llvm/llvm-project/pull/145079 ___ cfe-commits mailin

[clang] __sys builtin support (PR #145079)

2025-06-20 Thread Daniel Paoliello via cfe-commits
@@ -5500,8 +5502,13 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID, llvm::Function *F = CGM.getIntrinsic(Intrinsic::write_register, Types); llvm::Value *ArgValue = EmitScalarExpr(E->getArg(1)); - -return Builder.CreateCall(F, { Metadata, ArgV

[clang] __sys builtin support (PR #145079)

2025-06-20 Thread Daniel Paoliello via cfe-commits
@@ -5471,19 +5471,21 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID, } if (BuiltinID == clang::AArch64::BI_ReadStatusReg || - BuiltinID == clang::AArch64::BI_WriteStatusReg) { + BuiltinID == clang::AArch64::BI_WriteStatusReg || + Built

[clang] [lld] Use the Windows SDK arguments over the environment (PR #144805)

2025-06-19 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: Just to confirm, does this make clang-cl line up with cl's behavior? https://github.com/llvm/llvm-project/pull/144805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for requiring unwind v2 to be used (equivalent to MSVC's /d2epilogunwindrequirev2) (PR #143577)

2025-06-12 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/143577 >From 082514ffe8cd9086d82cbe0a114dfc736b0518dc Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Fri, 6 Jun 2025 16:39:07 -0700 Subject: [PATCH 1/2] Add support for requiring Win x64 Unwind V2 --- clang

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for requiring unwind v2 to be used (equivalent to MSVC's /d2epilogunwindrequirev2) (PR #143577)

2025-06-12 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/143577 >From 082514ffe8cd9086d82cbe0a114dfc736b0518dc Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Fri, 6 Jun 2025 16:39:07 -0700 Subject: [PATCH] Add support for requiring Win x64 Unwind V2 --- clang/inc

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for requiring unwind v2 to be used (equivalent to MSVC's /d2epilogunwindrequirev2) (PR #143577)

2025-06-11 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/143577 >From 07390317820324535fc75f7bd9dd53c2e65bda41 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Fri, 6 Jun 2025 16:39:07 -0700 Subject: [PATCH] Add support for requiring Win x64 Unwind V2 --- clang/inc

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for requiring unwind v2 to be used (equivalent to MSVC's /d2epilogunwindrequirev2) (PR #143577)

2025-06-10 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: I'm happy to change these back to `llvm_unreachable` or `reportFatalInternalError`. Is it possible for something other than LLVM to emit the prolog and epilog, like hand-written assembly or a frontend (e.g., for a custom calling convention). I'll change the too many epilog e

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-10 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for requiring unwind v2 to be used (equivalent to MSVC's /d2epilogunwindrequirev2) (PR #143577)

2025-06-10 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/143577 >From 9a8ab617682ac3bdb13818b6625fe4bd00aacd20 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Fri, 6 Jun 2025 16:39:07 -0700 Subject: [PATCH] Add support for requiring Win x64 Unwind V2 --- clang/inc

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for requiring unwind v2 to be used (equivalent to MSVC's /d2epilogunwindrequirev2) (PR #143577)

2025-06-10 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/143577 #129142 added support for emitting Windows x64 unwind v2 information, but it was "best effort". If any function didn't follow the requirements for v2 it was silently downgraded to v1. There are some parts o

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-09 Thread Daniel Paoliello via cfe-commits
@@ -0,0 +1,599 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// 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] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-09 Thread Daniel Paoliello via cfe-commits
@@ -0,0 +1,599 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// 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] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-09 Thread Daniel Paoliello via cfe-commits
@@ -389,6 +389,17 @@ def CoroDestroyOnlyWhenComplete : EnumAttr<"coro_only_destroy_when_complete", In /// pipeline to perform elide on the call or invoke instruction. def CoroElideSafe : EnumAttr<"coro_elide_safe", IntersectPreserve, [FnAttr]>; +/// Function is marked for Win

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-09 Thread Daniel Paoliello via cfe-commits
@@ -0,0 +1,599 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// 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] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-09 Thread Daniel Paoliello via cfe-commits
@@ -798,6 +798,8 @@ enum AttributeKindCodes { ATTR_KIND_NO_DIVERGENCE_SOURCE = 100, ATTR_KIND_SANITIZE_TYPE = 101, ATTR_KIND_CAPTURES = 102, + ATTR_KIND_ALLOW_DIRECT_ACCESS_IN_HOT_PATCH_FUNCTION = 103, + ATTR_KIND_MARKED_FOR_WINDOWS_HOT_PATCHING = 104,

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-09 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello commented: Can you please add tests for the constant expression rewriting stuff, and not redirecting constant GVs without pointers? https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-06-09 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeGen][COFF] Always emit CodeView compiler info on Windows targets (PR #142970)

2025-06-09 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello approved this pull request. https://github.com/llvm/llvm-project/pull/142970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeGen][COFF] Always emit CodeView compiler info on Windows targets (PR #142970)

2025-06-06 Thread Daniel Paoliello via cfe-commits
@@ -16,7 +16,7 @@ ; argc is the first debug location. ; ASM: .Ldebug_loc1: ; ASM-NEXT: .quad .Lfunc_begin0-.Lfunc_begin0 -; ASM-NEXT: .quad [[argc_range_end]]-.Lfunc_begin0 +; ASM-NEXT: .quad .Ltmp3-.Lfunc_begin0 dpaoliello wrote: Do you understand what

[clang] [llvm] [CodeGen][COFF] Always emit CodeView compiler info on Windows targets (PR #142970)

2025-06-06 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello requested changes to this pull request. https://github.com/llvm/llvm-project/pull/142970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeGen][COFF] Always emit CodeView compiler info on Windows targets (PR #142970)

2025-06-06 Thread Daniel Paoliello via cfe-commits
@@ -560,11 +560,12 @@ bool AsmPrinter::doInitialization(Module &M) { } if (MAI->doesSupportDebugInformation()) { -bool EmitCodeView = M.getCodeViewFlag(); -if (EmitCodeView && -(TM.getTargetTriple().isOSWindows() || TM.getTargetTriple().isUEFI())) +// O

[clang] [llvm] [CodeGen][COFF] Always emit CodeView compiler info on Windows targets (PR #142970)

2025-06-06 Thread Daniel Paoliello via cfe-commits
@@ -613,19 +613,30 @@ static SourceLanguage MapDWLangToCVLang(unsigned DWLang) { void CodeViewDebug::beginModule(Module *M) { // If module doesn't have named metadata anchors or COFF debug section // is not available, skip any debug info related stuff. - if (!Asm->hasDebug

[clang] [llvm] [CodeGen][COFF] Always emit CodeView compiler info on Windows targets (PR #142970)

2025-06-06 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello requested changes to this pull request. https://github.com/llvm/llvm-project/pull/142970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeGen][COFF] Always emit CodeView compiler info when hotpatch option is enabled (PR #142970)

2025-06-05 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > MSVC emits this debug section at all times (S_OBJNAME and S_COMPILE3). Can't > we do the same without checking for the `getModuleFlag("ms-hotpatch")` flag? I would much rather do this: we have other internal tooling withing Microsoft that relies on being able to check what

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-20 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: @efriedma-quic @mstorsjo any objections to merging? https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-05-09 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/125320 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-05-09 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From f429ad43fa0f56240721f071607b196ad970a6a0 Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-05-09 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/129142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-05-08 Thread Daniel Paoliello via cfe-commits
@@ -163,20 +206,90 @@ static void EmitRuntimeFunction(MCStreamer &streamer, context), 4); } +static std::optional +GetOptionalAbsDifference(const MCAssembler &Assembler, const MCSymbol *LHS, + const MCSymbol

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-05-08 Thread Daniel Paoliello via cfe-commits
@@ -7788,6 +7788,10 @@ def import_call_optimization : Flag<["-"], "import-call-optimization">, "by the Windows kernel to enable import call optimization">, MarshallingInfoFlag>; +def epilog_unwind : Flag<["-"], "winx64-eh-unwindv2">, + HelpText<"Enable unwin

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-05-08 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From 0fc8343ec561c5b64957008c40800e8335451b9d Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-08 Thread Daniel Paoliello via cfe-commits
@@ -0,0 +1,251 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// 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] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-05-07 Thread Daniel Paoliello via cfe-commits
@@ -7613,6 +7613,9 @@ def import_call_optimization : Flag<["-"], "import-call-optimization">, "by the Windows kernel to enable import call optimization">, MarshallingInfoFlag>; +def replaceable_function: Joined<["-"], "loader-replaceable-function=">, + Marsh

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-03-21 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/129142 >From ac5609c09e6423ab30b77cc9a18d24a33ba16048 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Thu, 27 Feb 2025 15:08:36 -0800 Subject: [PATCH] [win][x64] Unwind v2 3/n: Add support for emitting unwind

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-03-19 Thread Daniel Paoliello via cfe-commits
@@ -500,7 +500,8 @@ MCSymbol *MCStreamer::emitLineTableLabel() { MCSymbol *MCStreamer::emitCFILabel() { // Return a dummy non-null value so that label fields appear filled in when // generating textual assembly. - return (MCSymbol *)1; + static size_t DummyLabelValue = 0;

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-03-19 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/129142 >From 151e8f8e3204a0a7ef6c43ce99a7a60774cb041b Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Thu, 27 Feb 2025 15:08:36 -0800 Subject: [PATCH] [win][x64] Unwind v2 3/n: Add support for emitting unwind

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-03-05 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: Thanks for the info! For the different terminators, I'd prefer to keep to my current "assume 1-byte" trick: the implementation is simple, and it will reduce the amount of unwind data we need to emit. But for the "too many unwind codes" and "too far from the end" scenarios, i

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-02-28 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > Any further thoughts on splitting unwind info, as we discussed in #110338? Unfortunately, this isn't going to work. @pmsjt informs me that we can't have epilogs in chained unwind tables, since they are only for additional savereg codes. Using the "assume terminator is 1-byt

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-02-28 Thread Daniel Paoliello via cfe-commits
@@ -500,7 +500,8 @@ MCSymbol *MCStreamer::emitLineTableLabel() { MCSymbol *MCStreamer::emitCFILabel() { // Return a dummy non-null value so that label fields appear filled in when // generating textual assembly. - return (MCSymbol *)1; + static size_t DummyLabelValue = 0;

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-02-27 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/129142 Adds support for emitting Windows x64 Unwind V2 information, includes support `/d2epilogunwind` in clang-cl. Unwind v2 adds information about the epilogs in functions such that the unwinder can unwind even

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-02-13 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From 7e68b84f5d2ebdc8d4ac35af97b163f10bcaf455 Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-02-11 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From fe5b7ada3eae41bac26639d90e3d0d105a30be8f Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-02-05 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From dc48eeb8b8ae51a8ee5a5289de4d0b6eb8cd0b68 Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-02-03 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From f6b91ae8062ce1b8d1b6bb39b631a6971c06612b Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-01-31 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/125320 >From 061d2521e8db70c591e9c0d8f2e6348120cb55c1 Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Fri, 31 Jan 2025 16:47:23 -0800 Subject: [PATCH] [aarch64][x86][win] Add support for MSVC's /fun

[clang] [llvm] [aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (PR #125320)

2025-01-31 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/125320 Adds support for MSVC's undocumented `/funcoverride` flag, which marks functions as being replaceable by the Windows kernel loader. This is used to allow functions to be upgraded depending on the capabilitie

[clang] [llvm] [clang][llvm][aarch64][win] Add a clang flag and module attribute for import call optimization, and remove LLVM flag (PR #122831)

2025-01-30 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/122831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][llvm][aarch64][win] Add a clang flag and module attribute for import call optimization, and remove LLVM flag (PR #122831)

2025-01-29 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/122831 >From 91aa313945ee120d4e4d0c984e04159e29689fd6 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Mon, 13 Jan 2025 15:28:11 -0800 Subject: [PATCH] [aarch64][win] Add a clang flag and module attribute for

[clang] [llvm] [clang][llvm][aarch64][win] Add a clang flag and module attribute for import call optimization, and remove LLVM flag (PR #122831)

2025-01-29 Thread Daniel Paoliello via cfe-commits
@@ -945,7 +944,7 @@ void AArch64AsmPrinter::emitEndOfAsmFile(Module &M) { // If import call optimization is enabled, emit the appropriate section. // We do this whether or not we recorded any import calls. - if (EnableImportCallOptimization && TT.isOSBinFormatCOFF()) { +

[clang] [llvm] [clang][llvm][aarch64][win] Add a clang flag and module attribute for import call optimization, and remove LLVM flag (PR #122831)

2025-01-29 Thread Daniel Paoliello via cfe-commits
@@ -945,7 +944,7 @@ void AArch64AsmPrinter::emitEndOfAsmFile(Module &M) { // If import call optimization is enabled, emit the appropriate section. // We do this whether or not we recorded any import calls. - if (EnableImportCallOptimization && TT.isOSBinFormatCOFF()) { +

[clang] [aarch64] Add support for the __{inc|add}x18{byte|word|dword|qword intrinsics (PR #117752)

2024-12-04 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/117752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [aarch64] Add support for the __{inc|add}x18{byte|word|dword|qword intrinsics (PR #117752)

2024-12-03 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: > Sorry, just spotted an issue: I don't think you're emitting the operations in > the correct order. You need to emit both arguments before you read the > register or load the value. > > If you have some non-trivial operation like a call in one of the arguments, > you don't

[clang] [aarch64] Add support for the __{inc|add}x18{byte|word|dword|qword intrinsics (PR #117752)

2024-12-03 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/117752 >From acbd8132ac9d9156abcaac1ab3bb2e1e2e434216 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Tue, 26 Nov 2024 09:27:54 -0800 Subject: [PATCH] [AArch64] Add support for the __{inc|add}x18{byte|word|dw

[clang] [aarch64] Add support for the __{inc|add}x18{byte|word|dword|qword intrinsics (PR #117752)

2024-11-26 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello edited https://github.com/llvm/llvm-project/pull/117752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Add support for the __{inc|add}x18{byte|word|dword|qword intrinsics (PR #117752)

2024-11-26 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/117752 Adds support for the following MSVC intrinsics: * `__addx18byte` * `__addx18word` * `__addx18dword` * `__addx18qword` * `__incx18byte` * `__incx18word` * `__incx18dword` * `__incx18qword` These are documented

[clang] [aarch64][arm] Add support for the _Interlocked[Compare]ExchangePointer_{acq|nf|rel} MS intrinsics (PR #117645)

2024-11-25 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/117645 Adds support for the following MSVC intrinsics: * `_InterlockedCompareExchangePointer_acq` * `_InterlockedCompareExchangePointer_rel` * `_InterlockedExchangePointer_acq` * `_InterlockedExchangePointer_nf` * `_

[clang] [clang] Add support for `__declspec(no_init_all)` (PR #116847)

2024-11-20 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello closed https://github.com/llvm/llvm-project/pull/116847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add support for `__declspec(no_init_all)` (PR #116847)

2024-11-19 Thread Daniel Paoliello via cfe-commits
@@ -8719,6 +8719,18 @@ Attribute used by `clspv`_ (OpenCL-C to Vulkan SPIR-V compiler) to identify func }]; } +def NoTrivialAutoVarInitDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``__declspec(no_init_all)`` attribute disables the automatic i

[clang] [clang] Add support for `__declspec(no_init_all)` (PR #116847)

2024-11-19 Thread Daniel Paoliello via cfe-commits
https://github.com/dpaoliello updated https://github.com/llvm/llvm-project/pull/116847 >From d14059d2d7cb529fc0315c2cb1fbe869ebaab58d Mon Sep 17 00:00:00 2001 From: "Daniel Paoliello (HE/HIM)" Date: Tue, 19 Nov 2024 09:34:51 -0800 Subject: [PATCH] [clang] Add support for __declspec(no_init_all)

  1   2   >