aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/AMDGPU/promote-alloca-pointer-array.ll
blob: aa526ab96a53430ca784068731a0ca4b3a62453d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=amdgcn-- -mcpu=fiji -data-layout=A5 -passes=amdgpu-promote-alloca < %s | FileCheck -check-prefix=OPT %s

define i64 @test_pointer_array(i64 %v) {
; OPT-LABEL: @test_pointer_array(
; OPT-NEXT:  entry:
; OPT-NEXT:    [[A:%.*]] = freeze <3 x ptr> poison
; OPT-NEXT:    [[TMP0:%.*]] = inttoptr i64 [[V:%.*]] to ptr
; OPT-NEXT:    [[TMP1:%.*]] = insertelement <3 x ptr> [[A]], ptr [[TMP0]], i32 0
; OPT-NEXT:    ret i64 [[V]]
;
entry:
  %a = alloca [3 x ptr], align 16, addrspace(5)
  store i64 %v, ptr addrspace(5) %a, align 16
  %ld = load i64, ptr addrspace(5) %a, align 16
  ret i64 %ld
}