fwinter

module.ll

Jan 23rd, 2021 (edited)
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 0.85 KB | None | 0 0
  1. define amdgpu_kernel void @test( i32 %N , float* %out , float* %in ) {
  2. entrypoint:
  3.   %1 = icmp sge i32 %0, %N
  4.   br i1 %1, label %L0, label %L1
  5.  
  6. L0:
  7.   ret void
  8.  
  9. L1:
  10.   ;
  11.   ; read float from %in
  12.   ;
  13.   %2 = getelementptr float, float* %in, i32 %0
  14.   %3 = load float, float* %2, align 4
  15.   ;
  16.   ; put float onto stack
  17.   ;
  18.   %4 = alloca float, align 4, addrspace(5)
  19.   %5 = getelementptr float, float addrspace(5)* %4, i32 0
  20.   store float %3, float addrspace(5)* %5, align 4
  21.   ;
  22.   ; read float back from stack
  23.   ;
  24.   %6 = getelementptr float, float addrspace(5)* %4, i32 0
  25.   %7 = load float, float addrspace(5)* %6, align 4
  26.   ;
  27.   ; store float into %out
  28.   ;
  29.   %8 = getelementptr float, float* %out, i32 %0
  30.   store float %7, float* %8, align 4
  31.   ret void
  32. }
  33.  
  34.  
Add Comment
Please, Sign In to add comment