SHARE
TWEET

Untitled

a guest May 9th, 2013 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. target datalayout = "E-p:64:64:64-S0-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64"
  2.  
  3. ; A data buffer and a length
  4. %Vector = type { i8*, i32 }
  5.  
  6. define void @double(%Vector* noalias nocapture %src, %Vector* noalias nocapture %dst, i32 %len) nounwind {
  7. entry:
  8.   %0 = getelementptr inbounds %Vector* %src, i32 0, i32 0
  9.   %1 = load i8** %0
  10.   %src_data = bitcast i8* %1 to float*
  11.   %2 = getelementptr inbounds %Vector* %dst, i32 0, i32 0
  12.   %3 = load i8** %2
  13.   %dst_data = bitcast i8* %3 to float*
  14.   br label %loop
  15.  
  16. loop:                                 ; preds = %loop, %entry
  17.   %i = phi i32 [ 0, %entry ], [ %increment, %loop ]
  18.   %4 = getelementptr float* %src_data, i32 %i
  19.   %src_val = load float* %4, !llvm.mem.parallel_loop_access !0
  20.   %dst_val = fmul float 2.000000e+00, %src_val
  21.   %5 = getelementptr float* %dst_data, i32 %i
  22.   store float %dst_val, float* %5, !llvm.mem.parallel_loop_access !0
  23.   %increment = add i32 %i, 1
  24.   %test = icmp eq i32 %increment, %len
  25.   br i1 %test, label %exit, label %loop, !llvm.loop.parallel !0
  26.  
  27. exit:                                 ; preds = %loop
  28.   ret void
  29. }
  30.  
  31. !0 = metadata !{metadata !0}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top