[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-04 Thread Diego Russo via cfe-commits
diegorusso wrote: We (CPython project) will use it for the new JIT. I'll be testing the current implementation and report back any issue. I don't think you need to revert the PR but please let me know when you create the new one to address the post-merge comments so I can test it again.

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-03 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Since nothing should be using preserve_none on aarch64 yet, it's probably fine to just fix forward. > I'm not sure under what conditions issues present for this We only allocate a base pointer under restricted circumstances (primarily, functions with dynamic allocation),

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-03 Thread via cfe-commits
antangelo wrote: Thank you for catching these. > X19 is the base register; can we actually allocate arguments in it in > general? This seems hard to fix. I will remove X19 from the argument passing list. `ghccc` also uses X19 for argument passing, and I didn't run into issues while testing

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-03 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: X19 is the base register; can we actually allocate arguments in it in general? This seems hard to fix. It looks like frame lowering assumes X9 is available; that's probably fixable, but the code needs to be reworked, I think. X15 is used on Windows for stack allocation;

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-03 Thread via cfe-commits
https://github.com/antangelo closed https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-01 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/91046 >From 767173a0dfde9858c90867cc5d476da90e5ba898 Mon Sep 17 00:00:00 2001 From: Antonio Abbatangelo Date: Tue, 30 Apr 2024 22:58:18 -0400 Subject: [PATCH 1/8] [AArch64] Support preserve_none calling convention

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-01 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/91046 >From 767173a0dfde9858c90867cc5d476da90e5ba898 Mon Sep 17 00:00:00 2001 From: Antonio Abbatangelo Date: Tue, 30 Apr 2024 22:58:18 -0400 Subject: [PATCH 1/7] [AArch64] Support preserve_none calling convention

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-31 Thread Daniel Kiss via cfe-commits
@@ -0,0 +1,92 @@ +; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s +; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s +; RUN: sed -e

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-31 Thread Daniel Kiss via cfe-commits
https://github.com/DanielKristofKiss edited https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-31 Thread Daniel Kiss via cfe-commits
@@ -7949,9 +7966,10 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo , ++NumTailCalls; } - if (!IsTailCall && CLI.CB && CLI.CB->isMustTailCall()) + if (!IsTailCall && CLI.CB && CLI.CB->isMustTailCall()) { DanielKristofKiss wrote: if with 1

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-31 Thread Daniel Kiss via cfe-commits
@@ -494,6 +494,32 @@ def CC_AArch64_GHC : CallingConv<[ CCIfType<[i64], CCAssignToReg<[X19, X20, X21, X22, X23, X24, X25, X26, X27, X28]>> ]>; +let Entry = 1 in +def CC_AArch64_Preserve_None : CallingConv<[ +// We can pass arguments in all general registers, except: +

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-31 Thread Daniel Kiss via cfe-commits
https://github.com/DanielKristofKiss approved this pull request. Thanks for the PR, just NITS otherwise LGTM https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-30 Thread via cfe-commits
antangelo wrote: Friendly ping https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-22 Thread via cfe-commits
antangelo wrote: Friendly ping https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-15 Thread via cfe-commits
https://github.com/weiguozhi commented: Looks good to me. Please wait for AArch64 maintainer's approval. https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-14 Thread via cfe-commits
antangelo wrote: Friendly ping https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-10 Thread via cfe-commits
https://github.com/antangelo edited https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-09 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/91046 >From 767173a0dfde9858c90867cc5d476da90e5ba898 Mon Sep 17 00:00:00 2001 From: Antonio Abbatangelo Date: Tue, 30 Apr 2024 22:58:18 -0400 Subject: [PATCH 1/6] [AArch64] Support preserve_none calling convention

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-08 Thread via cfe-commits
@@ -494,6 +494,29 @@ def CC_AArch64_GHC : CallingConv<[ CCIfType<[i64], CCAssignToReg<[X19, X20, X21, X22, X23, X24, X25, X26, X27, X28]>> ]>; +let Entry = 1 in +def CC_AArch64_Preserve_None : CallingConv<[ +// We only preserve: +// - X18, which is used for the

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-08 Thread via cfe-commits
https://github.com/weiguozhi requested changes to this pull request. https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-08 Thread via cfe-commits
https://github.com/weiguozhi edited https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-06 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/91046 >From 767173a0dfde9858c90867cc5d476da90e5ba898 Mon Sep 17 00:00:00 2001 From: Antonio Abbatangelo Date: Tue, 30 Apr 2024 22:58:18 -0400 Subject: [PATCH 1/5] [AArch64] Support preserve_none calling convention

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-05 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/91046 >From 767173a0dfde9858c90867cc5d476da90e5ba898 Mon Sep 17 00:00:00 2001 From: Antonio Abbatangelo Date: Tue, 30 Apr 2024 22:58:18 -0400 Subject: [PATCH 1/5] [AArch64] Support preserve_none calling convention

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-05 Thread Andrew Pinski via cfe-commits
@@ -5658,17 +5658,20 @@ experimental at this time. def PreserveNoneDocs : Documentation { let Category = DocCatCallingConvs; let Content = [{ -On X86-64 target, this attribute changes the calling convention of a function. +On X86-64 and AArch64 targets, this attribute

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-05 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/91046 >From 767173a0dfde9858c90867cc5d476da90e5ba898 Mon Sep 17 00:00:00 2001 From: Antonio Abbatangelo Date: Tue, 30 Apr 2024 22:58:18 -0400 Subject: [PATCH 1/3] [AArch64] Support preserve_none calling convention

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread via cfe-commits
https://github.com/antangelo edited https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread via cfe-commits
antangelo wrote: > I don't think you can use x16 and x17 for argument passing due to them being > reserved for PLTs and call veneers. That is if the linker decides to create a > branch island or if the function is called via a PLT, x16 and x17 will be > clobbered on the call so arguments

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: None (antangelo) Changes Adds AArch64 support for the `preserve_none` calling convention. Registers X0-X17 and X19-X28 are caller save, and can be used to pass arguments. Delegates to AAPCS for all other registers. Closes #87423 ---

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (antangelo) Changes Adds AArch64 support for the `preserve_none` calling convention. Registers X0-X17 and X19-X28 are caller save, and can be used to pass arguments. Delegates to AAPCS for all other registers. Closes #87423 ---

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/91046 >From 767173a0dfde9858c90867cc5d476da90e5ba898 Mon Sep 17 00:00:00 2001 From: Antonio Abbatangelo Date: Tue, 30 Apr 2024 22:58:18 -0400 Subject: [PATCH 1/2] [AArch64] Support preserve_none calling convention

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread Brandt Bucher via cfe-commits
brandtbucher wrote: Aw, but that means we only have *twenty-six* registers for argument-passing... ;) https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread Andrew Pinski via cfe-commits
pinskia wrote: I don't think you can use x16 and x17 for argument passing due to them being reserved for PLTs and call veneers. https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-03 Thread via cfe-commits
https://github.com/antangelo created https://github.com/llvm/llvm-project/pull/91046 Adds AArch64 support for the `preserve_none` calling convention. Registers X0-X17 and X19-X28 are caller save, and can be used to pass arguments. Delegates to AAPCS for all other registers. Closes #87423