[PATCH] D156040: [AMDGPU] Add dynamic stack bit info to kernel-resource-usage Rpass output

2023-07-23 Thread Corbin Robeck via Phabricator via cfe-commits
crobeck updated this revision to Diff 543318.
crobeck added a comment.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Update clang frontend test


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156040/new/

https://reviews.llvm.org/D156040

Files:
  clang/test/Frontend/amdgcn-machine-analysis-remarks.cl
  llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll

Index: llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
===
--- llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
+++ llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=obj -o /dev/null %s 2>&1 | FileCheck -check-prefix=STDERR %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=null %s 2>&1 | FileCheck -check-prefix=STDERR %s
 ; RUN: FileCheck -check-prefix=REMARK %s < %t
 
 ; STDERR: remark: foo.cl:27:0: Function Name: test_kernel
@@ -10,6 +10,7 @@
 ; STDERR-NEXT: remark: foo.cl:27:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:27:0: VGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:27:0: LDS Size [bytes/block]: 512
+; STDERR-NEXT: remark: foo.cl:27:0: Uses Dynamic Stack: False
 
 ; REMARK-LABEL: --- !Analysis
 ; REMARK: Pass:kernel-resource-usage
@@ -111,6 +112,7 @@
 ; STDERR-NEXT: remark: foo.cl:42:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: VGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:42:0: Uses Dynamic Stack: False
 ; STDERR-NOT: LDS Size
 define void @test_func() !dbg !6 {
   call void asm sideeffect "; clobber v17", "~{v17}"()
@@ -128,6 +130,7 @@
 ; STDERR-NEXT: remark: foo.cl:8:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: VGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: LDS Size [bytes/block]: 0
+; STDERR-NEXT: remark: foo.cl:8:0: Uses Dynamic Stack: False
 define amdgpu_kernel void @empty_kernel() !dbg !7 {
   ret void
 }
@@ -140,12 +143,33 @@
 ; STDERR-NEXT: remark: foo.cl:52:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: VGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:52:0: Uses Dynamic Stack: False
 define void @empty_func() !dbg !8 {
   ret void
 }
 
+; STDERR: remark: foo.cl:64:0: Function Name: test_indirect_call
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs: 39
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs: 32
+; STDERR-NEXT: remark: foo.cl:64:0: AGPRs: 10
+; STDERR-NEXT: remark: foo.cl:64:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:64:0: Occupancy [waves/SIMD]: 8
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: LDS Size [bytes/block]: 0
+; STDERR-NEXT: remark: foo.cl:64:0: Uses Dynamic Stack: True
+@gv.fptr0 = external hidden unnamed_addr addrspace(4) constant ptr, align 4
+
+define amdgpu_kernel void @test_indirect_call() !dbg !9 {
+  %fptr = load ptr, ptr addrspace(4) @gv.fptr0
+  call void %fptr()
+  ret void
+}
+
+
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!2}
+!llvm.module.flags = !{!10}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
 !1 = !DIFile(filename: "foo.cl", directory: "/tmp")
@@ -156,3 +180,5 @@
 !6 = distinct !DISubprogram(name: "test_func", scope: !1, file: !1, type: !4, scopeLine: 42, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
 !7 = distinct !DISubprogram(name: "empty_kernel", scope: !1, file: !1, type: !4, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
 !8 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, type: !4, scopeLine: 52, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
+!9 = distinct !DISubprogram(name: "test_indirect_call", scope: !1, file: !1, type: !4, scopeLine: 64, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
+!10 = !{i32 1, !"amdgpu_code_object_version", i32 500}
Index: llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===
--- llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -1302,4 +1302,8 @@
   if (isModuleEntryFunction)
 EmitResourceUsageRemark("BytesLDS", "LDS Size [bytes/block]",
 CurrentProgramInfo.LDSSize);
+  std::string UsesDynamicStackStr =
+  CurrentProgramInfo.DynamicCallStack ? "True" : "False";
+  EmitResourceUsageRemark("UsesDynamicStack", "Uses Dynamic Stack",
+

[PATCH] D156040: [AMDGPU] Add dynamic stack bit info to kernel-resource-usage Rpass output

2023-07-24 Thread Corbin Robeck via Phabricator via cfe-commits
crobeck updated this revision to Diff 543772.
crobeck edited the summary of this revision.
crobeck added a comment.

Change remark order and add static stack w/ indirect function call test case


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156040/new/

https://reviews.llvm.org/D156040

Files:
  clang/test/Frontend/amdgcn-machine-analysis-remarks.cl
  llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll

Index: llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
===
--- llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
+++ llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=obj -o /dev/null %s 2>&1 | FileCheck -check-prefix=STDERR %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=null %s 2>&1 | FileCheck -check-prefix=STDERR %s
 ; RUN: FileCheck -check-prefix=REMARK %s < %t
 
 ; STDERR: remark: foo.cl:27:0: Function Name: test_kernel
@@ -6,6 +6,7 @@
 ; STDERR-NEXT: remark: foo.cl:27:0: VGPRs: 9
 ; STDERR-NEXT: remark: foo.cl:27:0: AGPRs: 43
 ; STDERR-NEXT: remark: foo.cl:27:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:27:0: Uses Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:27:0: Occupancy [waves/SIMD]: 5
 ; STDERR-NEXT: remark: foo.cl:27:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:27:0: VGPRs Spill: 0
@@ -55,7 +56,16 @@
 ; REMARK-NEXT: Args:
 ; REMARK-NEXT:   - String:  'ScratchSize [bytes/lane]: '
 ; REMARK-NEXT:   - ScratchSize: '0'
-; REMARK-NEXT: ...
+; REMARK-NEXT: ..
+; REMARK-NEXT: --- !Analysis
+; REMARK-NEXT: Pass:kernel-resource-usage
+; REMARK-NEXT: Name:UsesDynamicStack
+; REMARK-NEXT: DebugLoc:{ File: foo.cl, Line: 27, Column: 0 }
+; REMARK-NEXT: Function:test_kernel
+; REMARK-NEXT: Args:
+; REMARK-NEXT:   - String: ' Uses Dynamic Stack: 
+; REMARK-NEXT:   - UsesDynamicStack: 'False' 
+; REMARK-NEXT: ..
 ; REMARK-NEXT: --- !Analysis
 ; REMARK-NEXT: Pass:kernel-resource-usage
 ; REMARK-NEXT: Name:Occupancy
@@ -108,6 +118,7 @@
 ; STDERR-NEXT: remark: foo.cl:42:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:42:0: Uses Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:42:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: VGPRs Spill: 0
@@ -124,6 +135,7 @@
 ; STDERR-NEXT: remark: foo.cl:8:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:8:0: Uses Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:8:0: Occupancy [waves/SIMD]: 8
 ; STDERR-NEXT: remark: foo.cl:8:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: VGPRs Spill: 0
@@ -137,6 +149,7 @@
 ; STDERR-NEXT: remark: foo.cl:52:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:52:0: Uses Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:52:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: VGPRs Spill: 0
@@ -144,8 +157,50 @@
   ret void
 }
 
+; STDERR: remark: foo.cl:64:0: Function Name: test_indirect_call
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs: 39
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs: 32
+; STDERR-NEXT: remark: foo.cl:64:0: AGPRs: 10
+; STDERR-NEXT: remark: foo.cl:64:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:64:0: Uses Dynamic Stack: True
+; STDERR-NEXT: remark: foo.cl:64:0: Occupancy [waves/SIMD]: 8
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: LDS Size [bytes/block]: 0
+@gv.fptr0 = external hidden unnamed_addr addrspace(4) constant ptr, align 4
+
+define amdgpu_kernel void @test_indirect_call() !dbg !9 {
+  %fptr = load ptr, ptr addrspace(4) @gv.fptr0
+  call void %fptr()
+  ret void
+}
+
+; STDERR: remark: foo.cl:74:0: Function Name: test_indirect_w_static_stack
+; STDERR-NEXT: remark: foo.cl:74:0: SGPRs: 39
+; STDERR-NEXT: remark: foo.cl:74:0: VGPRs: 32
+; STDERR-NEXT: remark: foo.cl:74:0: AGPRs: 10
+; STDERR-NEXT: remark: foo.cl:74:0: ScratchSize [bytes/lane]: 64
+; STDERR-NEXT: remark: foo.cl:74:0: Uses Dynamic Stack: True
+; STDERR-NEXT: remark: foo.cl:74:0: Occupancy [waves/SIMD]: 8
+; STD

[PATCH] D156040: [AMDGPU] Add dynamic stack bit info to kernel-resource-usage Rpass output

2023-07-25 Thread Corbin Robeck via Phabricator via cfe-commits
crobeck added a subscriber: carlo.bertolli.
crobeck added a comment.

> The openmp runtime needs to do the same if not being done already.

Should be on @carlo.bertolli's TODO list


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156040/new/

https://reviews.llvm.org/D156040

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D156040: [AMDGPU] Add dynamic stack bit info to kernel-resource-usage Rpass output

2023-07-25 Thread Corbin Robeck via Phabricator via cfe-commits
crobeck updated this revision to Diff 544049.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156040/new/

https://reviews.llvm.org/D156040

Files:
  clang/test/Frontend/amdgcn-machine-analysis-remarks.cl
  llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll

Index: llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
===
--- llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
+++ llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=obj -o /dev/null %s 2>&1 | FileCheck -check-prefix=STDERR %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=null %s 2>&1 | FileCheck -check-prefix=STDERR %s
 ; RUN: FileCheck -check-prefix=REMARK %s < %t
 
 ; STDERR: remark: foo.cl:27:0: Function Name: test_kernel
@@ -6,6 +6,7 @@
 ; STDERR-NEXT: remark: foo.cl:27:0: VGPRs: 9
 ; STDERR-NEXT: remark: foo.cl:27:0: AGPRs: 43
 ; STDERR-NEXT: remark: foo.cl:27:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:27:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:27:0: Occupancy [waves/SIMD]: 5
 ; STDERR-NEXT: remark: foo.cl:27:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:27:0: VGPRs Spill: 0
@@ -55,7 +56,16 @@
 ; REMARK-NEXT: Args:
 ; REMARK-NEXT:   - String:  'ScratchSize [bytes/lane]: '
 ; REMARK-NEXT:   - ScratchSize: '0'
-; REMARK-NEXT: ...
+; REMARK-NEXT: ..
+; REMARK-NEXT: --- !Analysis
+; REMARK-NEXT: Pass:kernel-resource-usage
+; REMARK-NEXT: Name:DynamicStack
+; REMARK-NEXT: DebugLoc:{ File: foo.cl, Line: 27, Column: 0 }
+; REMARK-NEXT: Function:test_kernel
+; REMARK-NEXT: Args:
+; REMARK-NEXT:   - String: ' Dynamic Stack: 
+; REMARK-NEXT:   - DynamicStack: 'False' 
+; REMARK-NEXT: ..
 ; REMARK-NEXT: --- !Analysis
 ; REMARK-NEXT: Pass:kernel-resource-usage
 ; REMARK-NEXT: Name:Occupancy
@@ -108,6 +118,7 @@
 ; STDERR-NEXT: remark: foo.cl:42:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:42:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:42:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: VGPRs Spill: 0
@@ -124,6 +135,7 @@
 ; STDERR-NEXT: remark: foo.cl:8:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:8:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:8:0: Occupancy [waves/SIMD]: 8
 ; STDERR-NEXT: remark: foo.cl:8:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: VGPRs Spill: 0
@@ -137,6 +149,7 @@
 ; STDERR-NEXT: remark: foo.cl:52:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:52:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:52:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: VGPRs Spill: 0
@@ -144,8 +157,48 @@
   ret void
 }
 
+; STDERR: remark: foo.cl:64:0: Function Name: test_indirect_call
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs: 39
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs: 32
+; STDERR-NEXT: remark: foo.cl:64:0: AGPRs: 10
+; STDERR-NEXT: remark: foo.cl:64:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:64:0: Dynamic Stack: True
+; STDERR-NEXT: remark: foo.cl:64:0: Occupancy [waves/SIMD]: 8
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: LDS Size [bytes/block]: 0
+@gv.fptr0 = external hidden unnamed_addr addrspace(4) constant ptr, align 4
+
+define amdgpu_kernel void @test_indirect_call() !dbg !9 {
+  %fptr = load ptr, ptr addrspace(4) @gv.fptr0
+  call void %fptr()
+  ret void
+}
+
+; STDERR: remark: foo.cl:74:0: Function Name: test_indirect_w_static_stack
+; STDERR-NEXT: remark: foo.cl:74:0: SGPRs: 39
+; STDERR-NEXT: remark: foo.cl:74:0: VGPRs: 32
+; STDERR-NEXT: remark: foo.cl:74:0: AGPRs: 10
+; STDERR-NEXT: remark: foo.cl:74:0: ScratchSize [bytes/lane]: 64
+; STDERR-NEXT: remark: foo.cl:74:0: Dynamic Stack: True
+; STDERR-NEXT: remark: foo.cl:74:0: Occupancy [waves/SIMD]: 8
+; STDERR-NEXT: remark: foo.cl:74:0: SGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:74:0: VGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:74:0: LDS Size [bytes/block]: 0
+
+declare void @ll

[PATCH] D156040: [AMDGPU] Add dynamic stack bit info to kernel-resource-usage Rpass output

2023-07-25 Thread Corbin Robeck via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7a4968b5a378: [AMDGPU] Add dynamic stack bit info to 
kernel-resource-usage Rpass output (authored by crobeck).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156040/new/

https://reviews.llvm.org/D156040

Files:
  clang/test/Frontend/amdgcn-machine-analysis-remarks.cl
  llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll

Index: llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
===
--- llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
+++ llvm/test/CodeGen/AMDGPU/resource-optimization-remarks.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=obj -o /dev/null %s 2>&1 | FileCheck -check-prefix=STDERR %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -pass-remarks-output=%t -pass-remarks-analysis=kernel-resource-usage -filetype=null %s 2>&1 | FileCheck -check-prefix=STDERR %s
 ; RUN: FileCheck -check-prefix=REMARK %s < %t
 
 ; STDERR: remark: foo.cl:27:0: Function Name: test_kernel
@@ -6,6 +6,7 @@
 ; STDERR-NEXT: remark: foo.cl:27:0: VGPRs: 9
 ; STDERR-NEXT: remark: foo.cl:27:0: AGPRs: 43
 ; STDERR-NEXT: remark: foo.cl:27:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:27:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:27:0: Occupancy [waves/SIMD]: 5
 ; STDERR-NEXT: remark: foo.cl:27:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:27:0: VGPRs Spill: 0
@@ -55,7 +56,16 @@
 ; REMARK-NEXT: Args:
 ; REMARK-NEXT:   - String:  'ScratchSize [bytes/lane]: '
 ; REMARK-NEXT:   - ScratchSize: '0'
-; REMARK-NEXT: ...
+; REMARK-NEXT: ..
+; REMARK-NEXT: --- !Analysis
+; REMARK-NEXT: Pass:kernel-resource-usage
+; REMARK-NEXT: Name:DynamicStack
+; REMARK-NEXT: DebugLoc:{ File: foo.cl, Line: 27, Column: 0 }
+; REMARK-NEXT: Function:test_kernel
+; REMARK-NEXT: Args:
+; REMARK-NEXT:   - String: ' Dynamic Stack: 
+; REMARK-NEXT:   - DynamicStack: 'False' 
+; REMARK-NEXT: ..
 ; REMARK-NEXT: --- !Analysis
 ; REMARK-NEXT: Pass:kernel-resource-usage
 ; REMARK-NEXT: Name:Occupancy
@@ -108,6 +118,7 @@
 ; STDERR-NEXT: remark: foo.cl:42:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:42:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:42:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:42:0: VGPRs Spill: 0
@@ -124,6 +135,7 @@
 ; STDERR-NEXT: remark: foo.cl:8:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:8:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:8:0: Occupancy [waves/SIMD]: 8
 ; STDERR-NEXT: remark: foo.cl:8:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:8:0: VGPRs Spill: 0
@@ -137,6 +149,7 @@
 ; STDERR-NEXT: remark: foo.cl:52:0: VGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: AGPRs: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:52:0: Dynamic Stack: False
 ; STDERR-NEXT: remark: foo.cl:52:0: Occupancy [waves/SIMD]: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: SGPRs Spill: 0
 ; STDERR-NEXT: remark: foo.cl:52:0: VGPRs Spill: 0
@@ -144,8 +157,48 @@
   ret void
 }
 
+; STDERR: remark: foo.cl:64:0: Function Name: test_indirect_call
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs: 39
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs: 32
+; STDERR-NEXT: remark: foo.cl:64:0: AGPRs: 10
+; STDERR-NEXT: remark: foo.cl:64:0: ScratchSize [bytes/lane]: 0
+; STDERR-NEXT: remark: foo.cl:64:0: Dynamic Stack: True
+; STDERR-NEXT: remark: foo.cl:64:0: Occupancy [waves/SIMD]: 8
+; STDERR-NEXT: remark: foo.cl:64:0: SGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: VGPRs Spill: 0
+; STDERR-NEXT: remark: foo.cl:64:0: LDS Size [bytes/block]: 0
+@gv.fptr0 = external hidden unnamed_addr addrspace(4) constant ptr, align 4
+
+define amdgpu_kernel void @test_indirect_call() !dbg !9 {
+  %fptr = load ptr, ptr addrspace(4) @gv.fptr0
+  call void %fptr()
+  ret void
+}
+
+; STDERR: remark: foo.cl:74:0: Function Name: test_indirect_w_static_stack
+; STDERR-NEXT: remark: foo.cl:74:0: SGPRs: 39
+; STDERR-NEXT: remark: foo.cl:74:0: VGPRs: 32
+; STDERR-NEXT: remark: foo.cl:74:0: AGPRs: 10
+; STDERR-NEXT: remark: foo.cl:74:0: ScratchSize [bytes/lane]: 64
+; STDERR-NEXT: remark: foo.cl:74:0: Dynamic Stack: True
+; STDERR-NEXT: remark: foo.cl:74:0: Occupancy