[llvm] [MIR] Serialize MachineFrameInfo::isCalleeSavedInfoValid() (PR #90561)
David Tellenbach via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 30 18:28:44 PDT 2024
================
@@ -0,0 +1,158 @@
+
+# RUN: llc -run-pass=none -o - %s | FileCheck %s
+
+--- |
+
+ ; No stack, no callee-saved info -> no callee-saved info
+ define i32 @no_stack_no_calleesavedinfo(i32 noundef %0) #0 {
+ %2 = tail call i32 @f4(i32 noundef %0)
+ ret i32 %2
+ }
+
+ ; No stack but callee-saved info -> still callee-saved info
+ define i32 @no_stack_calleesavedinfo(i32 noundef %0) #0 {
+ %2 = tail call i32 @f4(i32 noundef %0)
+ ret i32 %2
+ }
+
+ ; Stack but no callee-saved info -> still callee-saved info
+ define i32 @stack_no_calleesavedinfo(i32 noundef %0) #0 {
+ %2 = call i32 @f4(i32 noundef %0)
+ %3 = add i32 %0, %2
+ ret i32 %3
+ }
+
+ ; Stack and callee-saved info -> still callee-saved info
+ define i32 @stack_calleesavedinfo(i32 noundef %0) #0 {
+ %2 = call i32 @f4(i32 noundef %0)
+ %3 = add i32 %0, %2
+ ret i32 %3
+ }
+
+ declare i32 @f4(i32 noundef)
+
+ attributes #0 = { nounwind }
+
+...
+---
+# CHECK-LABEL: name: no_stack_no_calleesavedinfo
+# CHECK: isCalleeSavedInfoValid: false
+name: no_stack_no_calleesavedinfo
+alignment: 4
+tracksRegLiveness: true
+tracksDebugUserValues: true
+liveins:
+ - { reg: '$w0' }
+frameInfo:
+ maxAlignment: 1
+ maxCallFrameSize: 0
+ hasTailCall: true
+ isCalleeSavedInfoValid: false
+stack: []
+machineFunctionInfo:
+ hasRedZone: false
+body: |
+ bb.0 (%ir-block.1):
+ liveins: $w0
+
+ TCRETURNdi @f4, 0, csr_darwin_aarch64_aapcs, implicit $sp, implicit $w0
----------------
dtellenbach wrote:
Oh right, since this uses `-run-pass=none` it doesn't need anything. Should be good now.
https://github.com/llvm/llvm-project/pull/90561
More information about the llvm-commits
mailing list