brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 391ca7c Raw
39 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -passes=amdgpu-promote-alloca < %s | FileCheck %s3 4; Check that promoting an alloca to a vector form works correctly when a variable5; vector index is used.6 7define amdgpu_kernel void @non_constant_index(i32 %arg) {8; CHECK-LABEL: define amdgpu_kernel void @non_constant_index(9; CHECK-SAME: i32 [[ARG:%.*]]) {10; CHECK-NEXT:  bb:11; CHECK-NEXT:    [[I:%.*]] = freeze <2 x float> poison12; CHECK-NEXT:    br label [[BB1:%.*]]13; CHECK:       bb1:14; CHECK-NEXT:    br label [[BB1]]15; CHECK:       bb2:16; CHECK-NEXT:    br label [[BB3:%.*]]17; CHECK:       bb3:18; CHECK-NEXT:    [[PROMOTEALLOCA:%.*]] = phi <2 x float> [ [[TMP2:%.*]], [[BB3]] ], [ poison, [[BB2:%.*]] ]19; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x float> [[PROMOTEALLOCA]], float 0.000000e+00, i32 [[ARG]]20; CHECK-NEXT:    [[TMP1:%.*]] = add i32 [[ARG]], 121; CHECK-NEXT:    [[TMP2]] = insertelement <2 x float> [[TMP0]], float 0.000000e+00, i32 [[TMP1]]22; CHECK-NEXT:    br label [[BB3]]23;24bb:25  %i = alloca [2 x float], align 4, addrspace(5)26  br label %bb127 28bb1:29  br label %bb130 31bb2:32  br label %bb333 34bb3:35  %i4 = getelementptr float, ptr addrspace(5) %i, i32 %arg36  store <2 x float> zeroinitializer, ptr addrspace(5) %i4, align 837  br label %bb338}39