Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[STACKMAPS] Document+test UINT64_MAX stack size.
When a function does a dynamic stack allocation, the function's stack size (in the stack map) is reported as UINT64_MAX. This change tests and documents this property. Differential Revision: https://reviews.llvm.org/D128525
- Loading branch information
Showing
4 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; RUN: llc < %s -mtriple=arm64-linux-gnu | FileCheck %s | ||
|
||
; When a function does a dynamic stack allocation, the function's stack size | ||
; is reported as UINT64_MAX. | ||
|
||
; CHECK-LABEL: .section .llvm_stackmaps | ||
; CHECK-NEXT: __LLVM_StackMaps: | ||
; Header | ||
; CHECK-NEXT: .byte 3 | ||
; CHECK-NEXT: .byte 0 | ||
; CHECK-NEXT: .hword 0 | ||
; Num Functions | ||
; CHECK-NEXT: .word 1 | ||
; Num LargeConstants | ||
; CHECK-NEXT: .word 0 | ||
; Num Callsites | ||
; CHECK-NEXT: .word 1 | ||
|
||
; Functions and stack size | ||
; CHECK-NEXT: .xword f | ||
; CHECK-NEXT: .xword -1 | ||
|
||
define void @f(i32 %nelems) { | ||
entry: | ||
%mem = alloca i32, i32 %nelems | ||
call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0, i32* %mem) | ||
ret void | ||
} | ||
|
||
declare void @llvm.experimental.stackmap(i64, i32, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s | ||
|
||
; When a function does a dynamic stack allocation, the function's stack size | ||
; is reported as UINT64_MAX. | ||
|
||
; CHECK: .section .llvm_stackmaps | ||
; CHECK-NEXT: __LLVM_StackMaps: | ||
; Header | ||
; CHECK-NEXT: .byte 3 | ||
; CHECK-NEXT: .byte 0 | ||
; CHECK-NEXT: .short 0 | ||
; Num Functions | ||
; CHECK-NEXT: .long 1 | ||
; Num LargeConstants | ||
; CHECK-NEXT: .long 0 | ||
; Num Callsites | ||
; CHECK-NEXT: .long 1 | ||
|
||
; Functions and stack size | ||
; CHECK-NEXT: .quad f | ||
; CHECK-NEXT: .quad -1 | ||
|
||
define void @f(i32 %nelems) { | ||
entry: | ||
%mem = alloca i32, i32 %nelems | ||
call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0, i32* %mem) | ||
ret void | ||
} | ||
|
||
declare void @llvm.experimental.stackmap(i64, i32, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s | ||
|
||
; When a function does a dynamic stack allocation, the function's stack size is | ||
; reported as UINT64_MAX. | ||
|
||
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps | ||
; CHECK-NEXT: __LLVM_StackMaps: | ||
; Header | ||
; CHECK-NEXT: .byte 3 | ||
; CHECK-NEXT: .byte 0 | ||
; CHECK-NEXT: .short 0 | ||
; Num Functions | ||
; CHECK-NEXT: .long 1 | ||
; Num LargeConstants | ||
; CHECK-NEXT: .long 0 | ||
; Num Callsites | ||
; CHECK-NEXT: .long 1 | ||
|
||
; Functions and stack size | ||
; CHECK-NEXT: .quad _f | ||
; CHECK-NEXT: .quad -1 | ||
|
||
define void @f(i32 %nelems) { | ||
entry: | ||
%mem = alloca i32, i32 %nelems | ||
call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0, i32* %mem) | ||
ret void | ||
} | ||
|
||
declare void @llvm.experimental.stackmap(i64, i32, ...) |