[llvm] [regalloc][basic] Change spill weight for optsize funcs (PR #112960)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 18 12:39:31 PDT 2024
================
@@ -0,0 +1,168 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+
+; RUN: llc < %s -mtriple=aarch64 -regalloc=basic | FileCheck %s
+
+; Test that the register allocator behaves differently with minsize functions.
+
+declare void @foo(i32, ptr)
+
+define void @optsize(i32 %arg, i32 %arg1, ptr %arg2, ptr %arg3, ptr %arg4, i32 %arg5, i1 %arg6) minsize {
+; CHECK-LABEL: optsize:
+; CHECK: // %bb.0: // %bb
+; CHECK-NEXT: stp x30, x23, [sp, #-48]! // 16-byte Folded Spill
+; CHECK-NEXT: stp x22, x21, [sp, #16] // 16-byte Folded Spill
+; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
+; CHECK-NEXT: .cfi_def_cfa_offset 48
+; CHECK-NEXT: .cfi_offset w19, -8
+; CHECK-NEXT: .cfi_offset w20, -16
+; CHECK-NEXT: .cfi_offset w21, -24
+; CHECK-NEXT: .cfi_offset w22, -32
+; CHECK-NEXT: .cfi_offset w23, -40
+; CHECK-NEXT: .cfi_offset w30, -48
+; CHECK-NEXT: mov w23, w5
+; CHECK-NEXT: mov x22, x4
+; CHECK-NEXT: mov x21, x3
+; CHECK-NEXT: mov x20, x2
+; CHECK-NEXT: mov w19, w1
----------------
ellishg wrote:
It's interesting that the minsize spill weight seems to produce more regular assembly. This might improve outlining which would explain the size win.
https://github.com/llvm/llvm-project/pull/112960
More information about the llvm-commits
mailing list