brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 57ab371 Raw
71 lines · plain
1; RUN: llc -stop-after=amdgpu-isel -mtriple=amdgcn-- -mcpu=gfx1100 -verify-machineinstrs -o - %s | FileCheck --check-prefixes=CHECK,ISEL %s2; RUN: not --crash llc -mtriple=amdgcn--amdhsa -mcpu=gfx1100 -verify-machineinstrs < %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR %s3 4; FIXME: Merge these tests with existing lane op tests (llvm.amdgcn.readlane.ll, llvm.amdgcn.writelane.ll ...) once the crash is fixed.5 6; CHECK-LABEL: name:            basic_readfirstlane_i647;       CHECK:    [[TOKEN:%[0-9]+]]{{[^ ]*}} = CONVERGENCECTRL_ANCHOR8;        ISEL:    CONVERGENCECTRL_GLUE [[TOKEN]]9;        ISEL:    {{.*}} = V_READFIRSTLANE_B32 {{.*}}, implicit [[TOKEN]]10;        ISEL:    CONVERGENCECTRL_GLUE [[TOKEN]]11;        ISEL:    {{.*}} = V_READFIRSTLANE_B32 {{.*}}, implicit [[TOKEN]]12define i64 @basic_readfirstlane_i64(i64 %src, i1 %cond) #0 {13entry:14  %t = call token @llvm.experimental.convergence.anchor()15  %x = add i64 %src, 116  br i1 %cond, label %then, label %else17 18then:19; CHECK-ERROR: Cannot mix controlled and uncontrolled convergence in the same function.20; CHECK-ERROR: V_READFIRSTLANE_B3221  %r = call i64 @llvm.amdgcn.readfirstlane.i64(i64 %x) [ "convergencectrl"(token %t) ]22  br label %else23 24else:25  %p = phi i64 [%r, %then], [%x, %entry]26  ret i64 %p27}28 29; CHECK-LABEL: name:            basic_readlane_i6430;       CHECK:    [[TOKEN:%[0-9]+]]{{[^ ]*}} = CONVERGENCECTRL_ANCHOR31;        ISEL:    CONVERGENCECTRL_GLUE [[TOKEN]]32;        ISEL:    {{.*}} = V_READLANE_B32 {{.*}}, implicit [[TOKEN]]33;        ISEL:    CONVERGENCECTRL_GLUE [[TOKEN]]34;        ISEL:    {{.*}} = V_READLANE_B32 {{.*}}, implicit [[TOKEN]]35define i64 @basic_readlane_i64(i64 %src, i32 %lane, i1 %cond) #0 {36entry:37  %t = call token @llvm.experimental.convergence.anchor()38  %x = add i64 %src, 139  br i1 %cond, label %then, label %else40 41then:42  %r = call i64 @llvm.amdgcn.readlane.i64(i64 %x, i32 %lane) [ "convergencectrl"(token %t) ]43  br label %else44 45else:46  %p = phi i64 [%r, %then], [%x, %entry]47  ret i64 %p48}49 50; CHECK-LABEL: name:            basic_writelane_i6451;       CHECK:    [[TOKEN:%[0-9]+]]{{[^ ]*}} = CONVERGENCECTRL_ANCHOR52;        ISEL:    CONVERGENCECTRL_GLUE [[TOKEN]]53;        ISEL:    {{.*}} = V_WRITELANE_B32 {{.*}}, implicit [[TOKEN]]54;        ISEL:    CONVERGENCECTRL_GLUE [[TOKEN]]55;        ISEL:    {{.*}} = V_WRITELANE_B32 {{.*}}, implicit [[TOKEN]]56define i64 @basic_writelane_i64(i64 %src, i1 %cond, i32 %lane, ptr addrspace(1) %out) #0 {57entry:58  %old = load i64, ptr addrspace(1) %out59  %t = call token @llvm.experimental.convergence.anchor()60  %x = add i64 %src, 161  br i1 %cond, label %then, label %else62 63then:64  %r = call i64 @llvm.amdgcn.writelane.i64(i64 %x, i32 %lane, i64 %old) [ "convergencectrl"(token %t) ]65  br label %else66 67else:68  %p = phi i64 [%r, %then], [%x, %entry]69  ret i64 %p70}71