File: dynamic_alloca.ll

package info (click to toggle)
intel-graphics-compiler2 2.24.13-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 113,504 kB
  • sloc: cpp: 812,849; lisp: 288,219; ansic: 102,423; python: 4,010; yacc: 2,588; lex: 1,666; pascal: 318; sh: 162; makefile: 38
file content (28 lines) | stat: -rw-r--r-- 882 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2025 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
; REQUIRES: llvm-14-plus
;
; RUN: igc_opt --opaque-pointers --igc-module-alloca-info -S < %s 2>&1 | FileCheck %s
; ------------------------------------------------
; ModuleAllocaAnalysis
; ------------------------------------------------
;
; CHECK: define void @test_dynamic_alloca(i64 %size, i64 %index) #0
; CHECK: attributes #0 = { "hasVLA" }
define void @test_dynamic_alloca(i64 %size, i64 %index) {
entry:
  %alloc_var = alloca i32, i64 %size, align 4
  %0 = getelementptr inbounds i32, ptr %alloc_var, i64 %index
  %1 = load i32, ptr %0, align 4
  call void @use.i32(i32 %1)
  ret void
}

declare void @use.i32(i32)

!igc.functions = !{}