[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,722 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple aarch64-none-eabi < %s -verify-machineinstrs | FileCheck %s +; RUN: llc -mtriple aarch64-none-eabi < %s -verify-machineinstrs -global-isel -global-isel-abort=2 |

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -1757,46 +1826,55 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF, } } - StackOffset AllocateBefore = SVEStackSize, AllocateAfter = {}; + StackOffset SVECalleeSavedSize = {}, SVELocalsSize = SVEStackSize; MachineBasicBlock::iterator CalleeSavesBeg

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: I only now noticed I had a bunch of comments sitting for a few weeks in "Pending" state :/ https://github.com/llvm/llvm-project/pull/66524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -1757,46 +1826,55 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF, } } - StackOffset AllocateBefore = SVEStackSize, AllocateAfter = {}; + StackOffset SVECalleeSavedSize = {}, SVELocalsSize = SVEStackSize; MachineBasicBlock::iterator CalleeSavesBeg

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -1827,12 +1908,36 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF, // FIXME: in the case of dynamic re-alignment, NumBytes doesn't have // the correct value here, as NumBytes also includes padding bytes, // which shouldn't be counted here. -

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -672,6 +673,74 @@ void AArch64FrameLowering::emitCalleeSavedSVERestores( emitCalleeSavedRestores(MBB, MBBI, true); } +void AArch64FrameLowering::allocateSVEStackSpace( +MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, +StackOffset AllocSize, StackOffset I

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -97,14 +97,45 @@ AArch64FunctionInfo::AArch64FunctionInfo(const Function &F, if (const auto *BTE = mdconst::extract_or_null( F.getParent()->getModuleFlag("branch-target-enforcement"))) BranchTargetEnforcement = BTE->getZExtValue(); -return; + } els

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Eli Friedman via cfe-commits
@@ -1076,6 +1076,16 @@ void CodeGenModule::Release() { "sign-return-address-with-bkey", 1); } + if (Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_be) { +auto *InlineAsm = llvm::MDString::get(TheModule.getContext(), "inli

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,722 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple aarch64-none-eabi < %s -verify-machineinstrs | FileCheck %s +; RUN: llc -mtriple aarch64-none-eabi < %s -verify-machineinstrs -global-isel -global-isel-abort=2 |

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-14 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Latest update adds this patch: https://github.com/llvm/llvm-project/pull/66524/commits/ff16f798d747ec9c16ebeeccbf4ef7ddd77f4636 https://github.com/llvm/llvm-project/pull/66524 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-13 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: In the last update: - do not set the `FrameSetup` flag for dynamic allocations - avoid back to back probing loops for allocation of SVE locals and non-SVE locals - fold the allocations together and emit a single loop (or no loop) https://github.com/llvm/llvm-project/pul

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-11 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: I'm going to squash the commits which belong to this PR as I don't believe they are useful in isolation anymore and they get in the way of refactoring/rebasing. (Long story short, I did a patch to avoid having two back to back probing loops, then factored out a stack pr

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-01 Thread Oskar Wirga via cfe-commits
@@ -688,6 +689,68 @@ void AArch64FrameLowering::emitCalleeSavedSVERestores( emitCalleeSavedRestores(MBB, MBBI, true); } +void AArch64FrameLowering::allocateSVEStackSpace( +MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, +StackOffset AllocSize, StackOffset I

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-01 Thread Oskar Wirga via cfe-commits
https://github.com/oskarwirga edited https://github.com/llvm/llvm-project/pull/66524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-01 Thread Oskar Wirga via cfe-commits
https://github.com/oskarwirga approved this pull request. Testing this patch set on a complex application (including later PRs) yielded no issues :) Thank you for your work on this, I appreciate it! https://github.com/llvm/llvm-project/pull/66524 __