[llvm] [KernelInfo] Implement new LLVM IR pass for GPU code analysis (PR #102944)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 14 08:36:45 PDT 2024
================
@@ -0,0 +1,78 @@
+; Check info on allocas.
+
+; RUN: opt -pass-remarks=kernel-info -passes=kernel-info \
+; RUN: -disable-output %s 2>&1 | \
+; RUN: FileCheck -match-full-lines %s
+
+target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
+target triple = "nvptx64-nvidia-cuda"
+
+define void @h() !dbg !3 {
+entry:
+ ; CHECK: remark: test.c:0:0: in artificial function 'h', artificial alloca 'dyn_ptr' with static size of 8 bytes
+ %dyn_ptr.addr = alloca ptr, align 8
+ ; CHECK: remark: test.c:14:9: in artificial function 'h', alloca 'i' with static size of 4 bytes
+ %i = alloca i32, align 4
+ ; CHECK: remark: test.c:15:9: in artificial function 'h', alloca 'a' with static size of 8 bytes
+ %a = alloca [2 x i32], align 4
+ tail call void @llvm.dbg.declare(metadata ptr %dyn_ptr.addr, metadata !7, metadata !DIExpression()), !dbg !11
----------------
arsenm wrote:
Test variable alloca? Also consider alloca outside of the entry block as dynamic
https://github.com/llvm/llvm-project/pull/102944
More information about the llvm-commits
mailing list