[clang] a96c14e - [Clang] Always forward sret parameters to musttail calls

2024-10-25 Thread Oliver Stannard via cfe-commits
Author: Kiran Date: 2024-10-25T09:34:08+01:00 New Revision: a96c14eeb8fcb1a141c0f55ed5d28dd7f1f3e38e URL: https://github.com/llvm/llvm-project/commit/a96c14eeb8fcb1a141c0f55ed5d28dd7f1f3e38e DIFF: https://github.com/llvm/llvm-project/commit/a96c14eeb8fcb1a141c0f55ed5d28dd7f1f3e38e.diff LOG: [C

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-10-25 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/109943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-10-25 Thread Oliver Stannard via cfe-commits
ostannard wrote: Merged: 376d7b27fa3d [ARM] Optimise byval arguments in tail-calls 914a3990d1a0 [ARM] Avoid clobbering byval arguments when passing to tail-calls a96c14eeb8fc [Clang] Always forward sret parameters to musttail calls 78ec2e2ed5e3 [ARM] Allow tail calls with byval args 82e64721974b

[clang] [llvm] [ARM] Fix operand order for MVE predicated VFMAS (PR #115908)

2024-11-13 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/115908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Fix operand order for MVE predicated VFMAS (PR #115908)

2024-11-13 Thread Oliver Stannard via cfe-commits
ostannard wrote: The pre-commit CI failure is an unrelated LLDB test failure, so I'm ignoring it. https://github.com/llvm/llvm-project/pull/115908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [llvm] [ARM] Fix operand order for MVE predicated VFMAS (PR #115908)

2024-11-12 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/115908 For most MVE predicated FMA instructions, disabled lanes will contain the value in the addend operand. However, The VFMAS instruction takes the addend in a GPR, and the output register is shared with the firs

[clang] [Clang][Driver] Add option to provide path for multilib's YAML config file (PR #109640)

2024-09-23 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard approved this pull request. Nice cleanup, thanks! https://github.com/llvm/llvm-project/pull/109640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-23 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/109255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
@@ -12658,10 +12658,10 @@ This instruction requires several arguments: the return value of the callee is returned to the caller's caller, even if a void return type is in use. - Both markers imply that the callee does not access allocas from the caller. - The `

[clang] [Clang][Driver] Add option to provide path for multilib's YAML config file (PR #109640)

2024-09-26 Thread Oliver Stannard via cfe-commits
@@ -1,79 +1,79 @@ -// RUN: %clang -print-multi-flags-experimental --target=aarch64-linux -fc++-abi=itanium -fsanitize=address | FileCheck --check-prefix=CHECK-LINUX %s +// RUN: %clang -multi-lib-config=%S/Inputs/multilib/empty.yaml -print-multi-flags-experimental --target=aarch6

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
@@ -0,0 +1,321 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=armv7a-none-eabi %s -o - | FileCheck %s + +declare i32 @many_args_callee(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) + +define i32 @many

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
@@ -5112,7 +5112,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, RawAddress SRetAlloca = RawAddress::invalid(); llvm::Value *UnusedReturnSizePtr = nullptr; if (RetAI.isIndirect() || RetAI.isInAlloca() || RetAI.isCoerceAndExpand()) { -if (IsVirtu

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109943 >From f96d3a1a44ade11f5a9879b49bb3d5296c4b225e Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 9 May 2024 12:58:41 +0100 Subject: [PATCH 01/11] [ARM] Re-generate a test --- llvm/test/CodeGen/ARM/fp

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109943 >From f96d3a1a44ade11f5a9879b49bb3d5296c4b225e Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 9 May 2024 12:58:41 +0100 Subject: [PATCH 01/15] [ARM] Re-generate a test --- llvm/test/CodeGen/ARM/fp

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
@@ -0,0 +1,343 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=armv7a-none-eabi %s -o - | FileCheck %s + +declare i32 @many_args_callee(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) + +define i32 @many

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109943 >From f96d3a1a44ade11f5a9879b49bb3d5296c4b225e Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 9 May 2024 12:58:41 +0100 Subject: [PATCH 01/17] [ARM] Re-generate a test --- llvm/test/CodeGen/ARM/fp

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
ostannard wrote: @rnk I've already written a patch which modifies the existing strategy of using pseudo-instructions to do memory-memory copies, adding in a temporary on the stack where needed. https://github.com/llvm/llvm-project/pull/109943 ___ cfe

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-26 Thread Oliver Stannard via cfe-commits
@@ -1,8 +1,31 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 ; RUN: llc -mtriple=arm-eabi -mattr=+neon -float-abi=soft %s -o - | FileCheck %s ; CHECK: function1 ; CHECK-NOT: vmov ostannard wrote: Don

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-27 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109943 >From f16d6e6156c2e7e5e0ea45b1d7b9f7a3ce8c8298 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 9 May 2024 12:58:41 +0100 Subject: [PATCH 1/9] [ARM] Re-generate a test --- llvm/test/CodeGen/ARM/fp-a

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-27 Thread Oliver Stannard via cfe-commits
ostannard wrote: Rebased over #110093, and squashed the fixup commits. https://github.com/llvm/llvm-project/pull/109943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-20 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109255 >From 85ac319257785f88fd27a533fffde7aab20c8d8d Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 18 Sep 2024 16:22:41 +0100 Subject: [PATCH 1/5] [clang] Lifetime of locals must end before musttail call

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-20 Thread Oliver Stannard via cfe-commits
@@ -267,3 +267,30 @@ namespace ns {} void TestCallNonValue() { [[clang::musttail]] return ns; // expected-error {{unexpected namespace name 'ns': expected expression}} } + +// Test diagnostics for lifetimes of local variables, which end earlier for a +// musttail call than f

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-20 Thread Oliver Stannard via cfe-commits
@@ -637,6 +637,11 @@ return value must be trivially destructible. The calling convention of the caller and callee must match, and they must not be variadic functions or have old style K&R C function declarations. +The lifetimes of all local variables and function parameters e

[clang] Fix #104794: Fixed sret bugs with `clang::musttail` on 32 bit targets (PR #104795)

2024-09-30 Thread Oliver Stannard via cfe-commits
ostannard wrote: Continued in #109943. https://github.com/llvm/llvm-project/pull/104795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix #104794: Fixed sret bugs with `clang::musttail` on 32 bit targets (PR #104795)

2024-09-30 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/104795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109255 >From 85ac319257785f88fd27a533fffde7aab20c8d8d Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 18 Sep 2024 16:22:41 +0100 Subject: [PATCH 1/3] [clang] Lifetime of locals must end before musttail call

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/109255 The lifetimes of local variables and function parameters must end before the call to a [[clang::musttail]] function, instead of before the return, because we will not have a stack frame to hold them when doin

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109255 >From 85ac319257785f88fd27a533fffde7aab20c8d8d Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 18 Sep 2024 16:22:41 +0100 Subject: [PATCH 1/2] [clang] Lifetime of locals must end before musttail call

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-25 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109943 >From f96d3a1a44ade11f5a9879b49bb3d5296c4b225e Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 9 May 2024 12:58:41 +0100 Subject: [PATCH 1/9] [ARM] Re-generate a test --- llvm/test/CodeGen/ARM/fp-a

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-09-25 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/102896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-09-25 Thread Oliver Stannard via cfe-commits
ostannard wrote: Superseded by #109943. https://github.com/llvm/llvm-project/pull/102896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-25 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/109943 This is a continuation of #102896 by @kiran-isaac, which gets the `[[clang::musttail]]` attribute working for as many cases as possible in the ARM backend. This includes one target-independent LangRef change

[clang] [llvm] [ARM] Fix musttail calls (PR #109943)

2024-09-25 Thread Oliver Stannard via cfe-commits
ostannard wrote: Another crash bug in ARM musttail: #109943 https://github.com/llvm/llvm-project/pull/109943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Pass -mabi option through to multilib (PR #110874)

2024-10-02 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/110874 Pass the -mabi option through to multilib, so that it can be used for library selection. >From d89ce145e529a6795291234c7d4b5c2cb5b75bc5 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 2 Oct 2024 16

[clang] [ARM] Fix NaN behaviour for MVE compare intrinsics (PR #116371)

2024-11-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/116371 >From 6bfe667f87da2551e7080af3caede272378e1e4d Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 14 Nov 2024 18:16:12 + Subject: [PATCH 1/2] [ARM] Fix NaN behaviour for MVE compare intrinsics The

[clang] [ARM] Fix NaN behaviour for MVE compare intrinsics (PR #116371)

2024-11-19 Thread Oliver Stannard via cfe-commits
@@ -118,6 +118,8 @@ def fcmp_gt: IRBuilder<"CreateFCmpOGT">; def fcmp_ge: IRBuilder<"CreateFCmpOGE">; def fcmp_lt: IRBuilder<"CreateFCmpOLT">; def fcmp_le: IRBuilder<"CreateFCmpOLE">; ostannard wrote: Done https://github.com/llvm/llvm-project/pull/116371

[clang] [ARM] Fix NaN behaviour for MVE compare intrinsics (PR #116371)

2024-11-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/116371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Emit an error when the hard-float ABI is enabled but can't be used. (PR #111334)

2024-11-20 Thread Oliver Stannard via cfe-commits
ostannard wrote: I agree with the previous comments from @davemgreen and @smithp35, user-facing diagnostics should always be emitted by clang, so that cases like LTO work correctly. If you want to reduce the duplication of the code which works out what ABIs are compatible (which I think would

[clang] [ARM] Fix undefined behaviour in bf16->float conversion (PR #116985)

2024-11-20 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/116985 This was implementing the bf16->float conversion function using a left-shift of a signed integer, so for negative floating-point values a 1 was being shifted into the sign bit of the signed integer intermedia

[clang] [llvm] [AArch64][v8.7-A] Fix inconsistency in SPE_EEF feature (PR #115296)

2024-11-08 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard approved this pull request. https://github.com/llvm/llvm-project/pull/115296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] Fix NaN behaviour for MVE compare intrinsics (PR #116371)

2024-11-15 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/116371 The MVE intrinsics are defined as having the same behaviour as the instructions which they correspond to. In particular, the vcmpleq and vcmpltq intrinsics correspond to the VCMP instruction with the LE or LT

[clang] [llvm] [ARM] Fix instruction selection for MVE vsbciq intrinsic (PR #118284)

2024-12-02 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/118284 There were two bugs in the implementation of the MVE vsbciq (subtract with carry across vector, with initial carry value) intrinsics: * The VSBCI instruction behaves as if the carry-in is always set, but we we

[clang] [llvm] [ARM] Add Cortex-A510 CPU for AArch32 (PR #118811)

2024-12-05 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/118811 This core was originally AArch64-only, but the r1p0 revision added optional support for AArch32 at EL0. TRM: https://developer.arm.com/documentation/101604/0103 >From 78abb36186afa3f46f596af201fe445a7b359fb5

[clang] [llvm] [ARM] Fix instruction selection for MVE vsbciq intrinsic (PR #118284)

2024-12-06 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/118284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Add Cortex-A510 CPU for AArch32 (PR #118811)

2024-12-06 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/118811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-09 Thread Oliver Stannard via cfe-commits
ostannard wrote: The code changes are all in llvm (not clang), so the tests need to be there too, using `llvm-mc` and `llc` instead of `clang`. I'd prefer to see the code for the assembly parser before reviewing this, because that will probably affect the API design of the streamer, since it w

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/121943 Re-write the sema and codegen for the atomic_test_and_set and atomic_clear builtin functions to go via AtomicExpr, like the other atomic builtins do. This simplifies the code, because AtomicExpr already handl

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2025-01-07 Thread Oliver Stannard via cfe-commits
ostannard wrote: Updated version: #121943 https://github.com/llvm/llvm-project/pull/120449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2025-01-07 Thread Oliver Stannard via cfe-commits
ostannard wrote: > Not added: Tests for attributes with NTBS values - currently all attributes > takes only ULEB128 as values. In order to have attributes that takes NTBS > values, new headers need to be defined. The `.aeabi_subsection` directive should accept any subsection name, only checki

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-31 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/124762 >From 4d883f068c5061e60e90e51d149a361920b431d2 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 12 Dec 2024 15:29:31 + Subject: [PATCH 1/7] [ARM] Empty structs are 1-byte for C++ ABI For C++ (but

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-31 Thread Oliver Stannard via cfe-commits
ostannard wrote: The release notes have now been cleared on main, so I'll re-add them in the llvm-20 cherry pick. https://github.com/llvm/llvm-project/pull/124762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-31 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/124762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-31 Thread Oliver Stannard via cfe-commits
ostannard wrote: /cherry-pick 97b066f4e92a0df46b9d10721e988210f0d1afb6 https://github.com/llvm/llvm-project/pull/124762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-31 Thread Oliver Stannard via cfe-commits
ostannard wrote: /cherry-pick 97b066f4e92a0df46b9d10721e988210f0d1afb6 https://github.com/llvm/llvm-project/pull/124762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-31 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard milestoned https://github.com/llvm/llvm-project/pull/124762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM, AArch64] Fix ABI bugs with over-sized bitfields (PR #126774)

2025-02-11 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/126774 This fixes two bugs in the ABI for over-sized bitfields for ARM and AArch64: The container type picked for an over-sized bitfield already contributes to the alignment of the structure, but it should also cont

[clang] [ARM] Forbid use of TLS with execute-only (PR #124806)

2025-01-29 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/124806 >From 2a1fb2ed2a91cf0a3da2c24b7e4c68fd5fc81751 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Tue, 28 Jan 2025 17:49:42 + Subject: [PATCH] [ARM] Forbid use of TLS with execute-only Thread-local code

[clang] [llvm] [ARM] Ensure FPU Selection can select mode correctly (PR #124935)

2025-01-30 Thread Oliver Stannard via cfe-commits
@@ -1013,3 +1013,41 @@ // CHECK-MVE1_2: #define __ARM_FEATURE_MVE 1 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp -x c -E -dM %s -o - | FileCheck -check-prefix=CHECK-MVE3 %s // CHECK-MVE3: #define __ARM_FEATURE_MVE 3 + +// Cortex-R52 and Cortex-R52Plus

[clang] [llvm] [ARM] Ensure FPU Selection can select mode correctly (PR #124935)

2025-01-30 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard approved this pull request. LGTM with one change to the tests, no need for re-review. https://github.com/llvm/llvm-project/pull/124935 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [llvm] [ARM] Ensure FPU Selection can select mode correctly (PR #124935)

2025-01-30 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard edited https://github.com/llvm/llvm-project/pull/124935 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-18 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/120449 >From 28174b0b54d36b070200d630bdeae64232264841 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 18 Dec 2024 15:46:02 + Subject: [PATCH 1/4] Add test for current behaviour --- clang/test/CodeGen/

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-18 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/120449 Re-write the sema and codegen for the atomic_test_and_set and atomic_clear builtin functions to go via AtomicExpr, like the other atomic builtins do. This simplifies the code, because AtomicExpr already handl

[clang] [Clang] Fix crash with implicit int-to-pointer conversion (PR #114218)

2024-12-18 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/114218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash with implicit int-to-pointer conversion (PR #114218)

2024-12-18 Thread Oliver Stannard via cfe-commits
ostannard wrote: > If __atomic_test_and_set is overloaded to have both a volatile and > non-volatile variant, it should be using custom type-checking in Sema. Looking at the code again, there's a separate system used to codegen most of the atomic builtins, so I've switched to using that. That

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-18 Thread Oliver Stannard via cfe-commits
@@ -5272,8 +5272,11 @@ bool Sema::BuiltinAssumeAligned(CallExpr *TheCall) { { ExprResult FirstArgResult = DefaultFunctionArrayLvalueConversion(FirstArg); -if (checkBuiltinArgument(*this, TheCall, 0)) ostannard wrote: Done https://github.com/

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-18 Thread Oliver Stannard via cfe-commits
@@ -74,7 +74,7 @@ int test13(int *a) { } int test14(int *a, int b) { - a = (int *)__builtin_assume_aligned(b, 32); // expected-error {{incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *}} + a = (int *)__builtin_assume_aligned(b, 32);

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-18 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/114217 >From a657d11051c95473727ca5e9f6a8e8ab195fe590 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 30 Oct 2024 12:01:56 + Subject: [PATCH 1/3] [Clang] Fix crash in __builtin_assume_aligned The CodeG

[clang] [llvm] [AArch64] Add soft-float ABI (PR #84146)

2024-12-18 Thread Oliver Stannard via cfe-commits
@@ -180,7 +180,7 @@ namespace { bool HandleTopLevelDecl(DeclGroupRef DG) override { // FIXME: Why not return false and abort parsing? - if (Diags.hasErrorOccurred()) + if (Diags.hasUnrecoverableErrorOccurred()) ostannard wrote: I think thi

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/120449 >From 28174b0b54d36b070200d630bdeae64232264841 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 18 Dec 2024 15:46:02 + Subject: [PATCH 1/5] Add test for current behaviour --- clang/test/CodeGen/

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/120449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
@@ -0,0 +1,30 @@ +// Test AArch64 build attributes to assmebly: 'aeabi_feature_and_bits' ostannard wrote: These clang tests should be removed. https://github.com/llvm/llvm-project/pull/118771 ___ cfe-commits mailing li

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard edited https://github.com/llvm/llvm-project/pull/118771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard commented: It looks like this is still missing the ability to emit build attributes by number, for future attributes the assembler does not know about. There is also still a lot of new code here not covered by tests: * Tests for pauthabi platform/version in codegen

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
@@ -793,20 +793,23 @@ void ARMTargetELFStreamer::switchVendor(StringRef Vendor) { void ARMTargetELFStreamer::emitAttribute(unsigned Attribute, unsigned Value) { getStreamer().setAttributeItem(Attribute, Value, - /* OverwriteExisting= */ true)

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
@@ -19,9 +19,74 @@ #define LLVM_SUPPORT_ARMBUILDATTRIBUTES_H #include "llvm/Support/ELFAttributes.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/TableGen/Record.h" namespace llvm { +class StringRef; + namespace ARMBuildAttrs { +// AArch64 build attributes --

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
@@ -148,13 +151,133 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer { OS << "\t.seh_save_any_reg_px\tq" << Reg << ", " << Offset << "\n"; } + void emitAttribute(unsigned VendorID, unsigned Tag, unsigned Value, + bool Override) overr

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
@@ -151,3 +151,81 @@ llvm::createAArch64ObjectTargetStreamer(MCStreamer &S, MCTargetStreamer *llvm::createAArch64NullTargetStreamer(MCStreamer &S) { return new AArch64TargetStreamer(S); } + +void AArch64TargetStreamer::emitSubsection( ostannard wrote: The te

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
@@ -783,6 +786,67 @@ void MCELFStreamer::createAttributesSection( AttrsVec.clear(); } +void MCELFStreamer::createAArch64AttributesSection( ostannard wrote: If this is AArch64 specific, it should be moved to one of the AArch64 classes, probably `AArch64Targ

[clang] [clang-tools-extra] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2024-12-19 Thread Oliver Stannard via cfe-commits
@@ -105,27 +107,55 @@ class MCELFStreamer : public MCObjectStreamer { unsigned Tag; unsigned IntValue; std::string StringValue; +AttributeItem(Types Ty, unsigned Tg, unsigned IV, std::string SV) +: Type(Ty), Tag(Tg), IntValue(IV), StringValue(SV) {} + }

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-20 Thread Oliver Stannard via cfe-commits
ostannard wrote: Thanks for the revert, I'm on holiday now so I'll have another go at fixing this in the new year. https://github.com/llvm/llvm-project/pull/120449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [ARM] Fix undefined behaviour in bf16->float conversion (PR #116985)

2024-11-21 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/116985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] FEAT_SPEv1p2 is optional in v8.7-A and v9.2-A (PR #123336)

2025-01-21 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/123336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2025-01-22 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/118771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-22 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard closed https://github.com/llvm/llvm-project/pull/121943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][AArch64] apple-m4 does not have FEAT_{SPEv1p2,SEL2,MPAM} (PR #123827)

2025-01-22 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard approved this pull request. LGTM, thanks. https://github.com/llvm/llvm-project/pull/123827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-20 Thread Oliver Stannard via cfe-commits
ostannard wrote: Ping https://github.com/llvm/llvm-project/pull/121943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] Forbid use of TLS with execute-only (PR #124806)

2025-01-28 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/124806 Thread-local code generation requires constant pools because most of the relocations needed for it operate on data, so it cannot be used with -mexecute-only (or -mpure-code, which is aliased in the driver).

[clang] [AArch64] Match GCC behaviour for zero-size structs (PR #124760)

2025-01-28 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/124760 We had a test claiming that this empty struct type consumes a register slot when passing it to a function with GCC, but that does not appear to be the case, at least with GCC versions going back to 4.8. This

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-28 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/124762 For C++ (but not C), empty structs should be passed to functions as if they are a 1 byte object with 1 byte alignment. This is defined in Arm's CPPABI32: https://github.com/ARM-software/abi-aa/blob/main/cpp

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2025-01-21 Thread Oliver Stannard via cfe-commits
@@ -7846,6 +7839,13 @@ bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) { return true; } + bool SubsectionExists = true; ostannard wrote: You don't need this extra `bool`, you can just check `if (ExistingSubsection)` below. https:

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2025-01-21 Thread Oliver Stannard via cfe-commits
@@ -7858,20 +7858,19 @@ bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) { Optionality); return true; } -if (HasActiveSubsection && -(SubsectionName == ActiveSubsection->VendorName)) { - if (IsOptional != ActiveSubs

[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

2025-01-21 Thread Oliver Stannard via cfe-commits
@@ -182,6 +182,16 @@ AArch64TargetStreamer::getActiveAtributesSubsection() { return nullptr; } +std::unique_ptr +AArch64TargetStreamer::getActiveSubsectionByName(StringRef name) { ostannard wrote: This name is misleading, because this function doesn't check

[clang] [llvm] [AArch64] FEAT_SPEv1p2 is optional in v8.7-A and v9.2-A (PR #123336)

2025-01-20 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/123336 >From 8f958b7099d9c6999731b7ce0305fcfbe4705940 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Fri, 17 Jan 2025 12:08:38 + Subject: [PATCH 1/5] [AArch64] refactor optional v9.x features inherited from

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-30 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/124762 >From 4d883f068c5061e60e90e51d149a361920b431d2 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 12 Dec 2024 15:29:31 + Subject: [PATCH 1/7] [ARM] Empty structs are 1-byte for C++ ABI For C++ (but

[clang] [llvm] [ARM] Ensure FPU Selection can select mode correctly (PR #124935)

2025-01-30 Thread Oliver Stannard via cfe-commits
@@ -1013,3 +1013,19 @@ // CHECK-MVE1_2: #define __ARM_FEATURE_MVE 1 // RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp -x c -E -dM %s -o - | FileCheck -check-prefix=CHECK-MVE3 %s // CHECK-MVE3: #define __ARM_FEATURE_MVE 3 + +// Cortex-R52 and Cortex-R52Plus

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-29 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/124762 >From 4d883f068c5061e60e90e51d149a361920b431d2 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Thu, 12 Dec 2024 15:29:31 + Subject: [PATCH 1/6] [ARM] Empty structs are 1-byte for C++ ABI For C++ (but

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-29 Thread Oliver Stannard via cfe-commits
ostannard wrote: That last commit message should have been "llvm-20", not 19. https://github.com/llvm/llvm-project/pull/124762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Match GCC behaviour for zero-size structs (PR #124760)

2025-01-29 Thread Oliver Stannard via cfe-commits
ostannard wrote: I agree with @efriedma-quic that this is a very artificial test case, and I wouldn't expect anyone to hit this in reality (I only noticed it while copying the test for #124762), so it's not worth release-noting or adding a compatibility option. https://github.com/llvm/llvm-pr

[clang] [ARM] Empty structs are 1-byte for C++ ABI (PR #124762)

2025-01-29 Thread Oliver Stannard via cfe-commits
@@ -366,9 +387,15 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic, return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory); } - // Ignore empty records. - if (isEmptyRecord(getContext(), Ty, true)) -return ABIArgInfo::ge

<    1   2   3   >