Skip to content

Commit e28870b

Browse files
Add a couple of comments about a possible optmisation
1 parent 603d90a commit e28870b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

llvm/lib/Target/AArch64/AArch64FrameLowering.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,9 @@ void AArch64FrameLowering::allocateStackSpace(
803803
return;
804804
}
805805

806-
// Emit a variable-length allocation probing loop.
806+
// Emit a variable-length allocation probing loop.
807+
// TODO: As an optimisation, the loop can be "unrolled" into a few parts,
808+
// each of them guaranteed to adjust the stack by less than the probe size.
807809
Register TargetReg = findScratchNonCalleeSaveRegister(&MBB);
808810
assert(TargetReg != AArch64::NoRegister);
809811
// SUB Xd, SP, AllocSize

llvm/test/CodeGen/AArch64/stack-probing-sve.ll

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ entry:
9494
; As above, but with 17 SVE vectors of stack space. Now we need
9595
; a probing loops since stack adjustment may be greater than
9696
; the probe size (17 x 256 = 4354 bytes)
97+
; TODO: Allocating `k*16+r` SVE vectors can be unrolled into
98+
; emiting the `k + r` sequences of `addvl sp, sp, #-N; str xzr, [sp]`
9799
define void @sve_17_vector(ptr %out) #0 {
98100
; CHECK-LABEL: sve_17_vector:
99101
; CHECK: // %bb.0: // %entry

0 commit comments

Comments
 (0)