Skip to content

Commit

Permalink
Add a couple of comments about a possible optmisation
Browse files Browse the repository at this point in the history
  • Loading branch information
momchil-velikov committed Nov 30, 2023
1 parent 603d90a commit e28870b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,9 @@ void AArch64FrameLowering::allocateStackSpace(
return;
}

// Emit a variable-length allocation probing loop.
// Emit a variable-length allocation probing loop.
// TODO: As an optimisation, the loop can be "unrolled" into a few parts,
// each of them guaranteed to adjust the stack by less than the probe size.
Register TargetReg = findScratchNonCalleeSaveRegister(&MBB);
assert(TargetReg != AArch64::NoRegister);
// SUB Xd, SP, AllocSize
Expand Down
2 changes: 2 additions & 0 deletions llvm/test/CodeGen/AArch64/stack-probing-sve.ll
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ entry:
; As above, but with 17 SVE vectors of stack space. Now we need
; a probing loops since stack adjustment may be greater than
; the probe size (17 x 256 = 4354 bytes)
; TODO: Allocating `k*16+r` SVE vectors can be unrolled into
; emiting the `k + r` sequences of `addvl sp, sp, #-N; str xzr, [sp]`
define void @sve_17_vector(ptr %out) #0 {
; CHECK-LABEL: sve_17_vector:
; CHECK: // %bb.0: // %entry
Expand Down

0 comments on commit e28870b

Please sign in to comment.