Skip to content

Instantly share code, notes, and snippets.

@annanay25
Created July 3, 2017 13:17
Show Gist options
  • Save annanay25/bc712686c33ad856b6dc1b14cafb1ece to your computer and use it in GitHub Desktop.
Save annanay25/bc712686c33ad856b6dc1b14cafb1ece to your computer and use it in GitHub Desktop.
-polly-process-unprofitable for adding a number (float 5.0) to every element of a [1,784] array.
; ModuleID = '__compute_module'
source_filename = "__compute_module"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux_gnu"
; Function Attrs: norecurse nounwind
define void @"cluster_2[_XlaCompiledKernel=true,_XlaNumConstantArgs=0].v5"(i8* nocapture align 16 dereferenceable(3136) %retval, i8* noalias nocapture readnone %run_options, i8** noalias nocapture readonly %params, i8** noalias nocapture readnone %temps, i64* noalias nocapture readnone %prof_counters) local_unnamed_addr #0 {
entry:
%0 = load i8*, i8** %params, align 8, !tbaa !0, !dereferenceable !3, !align !4
%1 = getelementptr inbounds i8*, i8** %params, i64 1
%2 = bitcast i8** %1 to float**
%3 = load float*, float** %2, align 8, !tbaa !5, !dereferenceable !7, !align !8
%polly.access..load = load float, float* %3, align 8
%broadcast.splatinsert11 = insertelement <8 x float> undef, float %polly.access..load, i32 0
%broadcast.splat12 = shufflevector <8 x float> %broadcast.splatinsert11, <8 x float> undef, <8 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.2, %vector.body ]
%4 = shl i64 %index, 2
%5 = getelementptr i8, i8* %0, i64 %4
%6 = bitcast i8* %5 to <8 x float>*
%wide.load = load <8 x float>, <8 x float>* %6, align 16, !alias.scope !9, !noalias !11
%7 = getelementptr i8, i8* %5, i64 32
%8 = bitcast i8* %7 to <8 x float>*
%wide.load8 = load <8 x float>, <8 x float>* %8, align 16, !alias.scope !9, !noalias !11
%9 = getelementptr i8, i8* %5, i64 64
%10 = bitcast i8* %9 to <8 x float>*
%wide.load9 = load <8 x float>, <8 x float>* %10, align 16, !alias.scope !9, !noalias !11
%11 = getelementptr i8, i8* %5, i64 96
%12 = bitcast i8* %11 to <8 x float>*
%wide.load10 = load <8 x float>, <8 x float>* %12, align 16, !alias.scope !9, !noalias !11
%13 = fadd fast <8 x float> %wide.load, %broadcast.splat12
%14 = fadd fast <8 x float> %wide.load8, %broadcast.splat12
%15 = fadd fast <8 x float> %wide.load9, %broadcast.splat12
%16 = fadd fast <8 x float> %wide.load10, %broadcast.splat12
%17 = getelementptr i8, i8* %retval, i64 %4
%18 = bitcast i8* %17 to <8 x float>*
store <8 x float> %13, <8 x float>* %18, align 16, !alias.scope !12, !noalias !13
%19 = getelementptr i8, i8* %17, i64 32
%20 = bitcast i8* %19 to <8 x float>*
store <8 x float> %14, <8 x float>* %20, align 16, !alias.scope !12, !noalias !13
%21 = getelementptr i8, i8* %17, i64 64
%22 = bitcast i8* %21 to <8 x float>*
store <8 x float> %15, <8 x float>* %22, align 16, !alias.scope !12, !noalias !13
%23 = getelementptr i8, i8* %17, i64 96
%24 = bitcast i8* %23 to <8 x float>*
store <8 x float> %16, <8 x float>* %24, align 16, !alias.scope !12, !noalias !13
%index.next = shl i64 %index, 2
%25 = add i64 %index.next, 128
%26 = getelementptr i8, i8* %0, i64 %25
%27 = bitcast i8* %26 to <8 x float>*
%wide.load.1 = load <8 x float>, <8 x float>* %27, align 16, !alias.scope !9, !noalias !11
%28 = getelementptr i8, i8* %26, i64 32
%29 = bitcast i8* %28 to <8 x float>*
%wide.load8.1 = load <8 x float>, <8 x float>* %29, align 16, !alias.scope !9, !noalias !11
%30 = getelementptr i8, i8* %26, i64 64
%31 = bitcast i8* %30 to <8 x float>*
%wide.load9.1 = load <8 x float>, <8 x float>* %31, align 16, !alias.scope !9, !noalias !11
%32 = getelementptr i8, i8* %26, i64 96
%33 = bitcast i8* %32 to <8 x float>*
%wide.load10.1 = load <8 x float>, <8 x float>* %33, align 16, !alias.scope !9, !noalias !11
%34 = fadd fast <8 x float> %wide.load.1, %broadcast.splat12
%35 = fadd fast <8 x float> %wide.load8.1, %broadcast.splat12
%36 = fadd fast <8 x float> %wide.load9.1, %broadcast.splat12
%37 = fadd fast <8 x float> %wide.load10.1, %broadcast.splat12
%38 = getelementptr i8, i8* %retval, i64 %25
%39 = bitcast i8* %38 to <8 x float>*
store <8 x float> %34, <8 x float>* %39, align 16, !alias.scope !12, !noalias !13
%40 = getelementptr i8, i8* %38, i64 32
%41 = bitcast i8* %40 to <8 x float>*
store <8 x float> %35, <8 x float>* %41, align 16, !alias.scope !12, !noalias !13
%42 = getelementptr i8, i8* %38, i64 64
%43 = bitcast i8* %42 to <8 x float>*
store <8 x float> %36, <8 x float>* %43, align 16, !alias.scope !12, !noalias !13
%44 = getelementptr i8, i8* %38, i64 96
%45 = bitcast i8* %44 to <8 x float>*
store <8 x float> %37, <8 x float>* %45, align 16, !alias.scope !12, !noalias !13
%index.next.1 = shl i64 %index, 2
%46 = add i64 %index.next.1, 256
%47 = getelementptr i8, i8* %0, i64 %46
%48 = bitcast i8* %47 to <8 x float>*
%wide.load.2 = load <8 x float>, <8 x float>* %48, align 16, !alias.scope !9, !noalias !11
%49 = getelementptr i8, i8* %47, i64 32
%50 = bitcast i8* %49 to <8 x float>*
%wide.load8.2 = load <8 x float>, <8 x float>* %50, align 16, !alias.scope !9, !noalias !11
%51 = getelementptr i8, i8* %47, i64 64
%52 = bitcast i8* %51 to <8 x float>*
%wide.load9.2 = load <8 x float>, <8 x float>* %52, align 16, !alias.scope !9, !noalias !11
%53 = getelementptr i8, i8* %47, i64 96
%54 = bitcast i8* %53 to <8 x float>*
%wide.load10.2 = load <8 x float>, <8 x float>* %54, align 16, !alias.scope !9, !noalias !11
%55 = fadd fast <8 x float> %wide.load.2, %broadcast.splat12
%56 = fadd fast <8 x float> %wide.load8.2, %broadcast.splat12
%57 = fadd fast <8 x float> %wide.load9.2, %broadcast.splat12
%58 = fadd fast <8 x float> %wide.load10.2, %broadcast.splat12
%59 = getelementptr i8, i8* %retval, i64 %46
%60 = bitcast i8* %59 to <8 x float>*
store <8 x float> %55, <8 x float>* %60, align 16, !alias.scope !12, !noalias !13
%61 = getelementptr i8, i8* %59, i64 32
%62 = bitcast i8* %61 to <8 x float>*
store <8 x float> %56, <8 x float>* %62, align 16, !alias.scope !12, !noalias !13
%63 = getelementptr i8, i8* %59, i64 64
%64 = bitcast i8* %63 to <8 x float>*
store <8 x float> %57, <8 x float>* %64, align 16, !alias.scope !12, !noalias !13
%65 = getelementptr i8, i8* %59, i64 96
%66 = bitcast i8* %65 to <8 x float>*
store <8 x float> %58, <8 x float>* %66, align 16, !alias.scope !12, !noalias !13
%index.next.2 = add nsw i64 %index, 96
%67 = icmp eq i64 %index.next.2, 768
br i1 %67, label %polly.loop_header.preheader, label %vector.body, !llvm.loop !14
polly.loop_header.preheader: ; preds = %vector.body
br label %polly.loop_header
polly.loop_header: ; preds = %polly.loop_header.preheader
%scevgep = getelementptr i8, i8* %0, i64 3072
%scevgep2 = bitcast i8* %scevgep to float*
%_p_scalar_ = load float, float* %scevgep2, align 16, !alias.scope !9, !noalias !11
%p_ = fadd fast float %_p_scalar_, %polly.access..load
%scevgep3 = getelementptr i8, i8* %retval, i64 3072
%scevgep34 = bitcast i8* %scevgep3 to float*
store float %p_, float* %scevgep34, align 16, !alias.scope !12, !noalias !13
%scevgep.1 = getelementptr i8, i8* %0, i64 3076
%scevgep2.1 = bitcast i8* %scevgep.1 to float*
%_p_scalar_.1 = load float, float* %scevgep2.1, align 4, !alias.scope !9, !noalias !11
%p_.1 = fadd fast float %_p_scalar_.1, %polly.access..load
%scevgep3.1 = getelementptr i8, i8* %retval, i64 3076
%scevgep34.1 = bitcast i8* %scevgep3.1 to float*
store float %p_.1, float* %scevgep34.1, align 4, !alias.scope !12, !noalias !13
%scevgep.2 = getelementptr i8, i8* %0, i64 3080
%scevgep2.2 = bitcast i8* %scevgep.2 to float*
%_p_scalar_.2 = load float, float* %scevgep2.2, align 8, !alias.scope !9, !noalias !11
%p_.2 = fadd fast float %_p_scalar_.2, %polly.access..load
%scevgep3.2 = getelementptr i8, i8* %retval, i64 3080
%scevgep34.2 = bitcast i8* %scevgep3.2 to float*
store float %p_.2, float* %scevgep34.2, align 8, !alias.scope !12, !noalias !13
%scevgep.3 = getelementptr i8, i8* %0, i64 3084
%scevgep2.3 = bitcast i8* %scevgep.3 to float*
%_p_scalar_.3 = load float, float* %scevgep2.3, align 4, !alias.scope !9, !noalias !11
%p_.3 = fadd fast float %_p_scalar_.3, %polly.access..load
%scevgep3.3 = getelementptr i8, i8* %retval, i64 3084
%scevgep34.3 = bitcast i8* %scevgep3.3 to float*
store float %p_.3, float* %scevgep34.3, align 4, !alias.scope !12, !noalias !13
%scevgep.4 = getelementptr i8, i8* %0, i64 3088
%scevgep2.4 = bitcast i8* %scevgep.4 to float*
%_p_scalar_.4 = load float, float* %scevgep2.4, align 16, !alias.scope !9, !noalias !11
%p_.4 = fadd fast float %_p_scalar_.4, %polly.access..load
%scevgep3.4 = getelementptr i8, i8* %retval, i64 3088
%scevgep34.4 = bitcast i8* %scevgep3.4 to float*
store float %p_.4, float* %scevgep34.4, align 16, !alias.scope !12, !noalias !13
%scevgep.5 = getelementptr i8, i8* %0, i64 3092
%scevgep2.5 = bitcast i8* %scevgep.5 to float*
%_p_scalar_.5 = load float, float* %scevgep2.5, align 4, !alias.scope !9, !noalias !11
%p_.5 = fadd fast float %_p_scalar_.5, %polly.access..load
%scevgep3.5 = getelementptr i8, i8* %retval, i64 3092
%scevgep34.5 = bitcast i8* %scevgep3.5 to float*
store float %p_.5, float* %scevgep34.5, align 4, !alias.scope !12, !noalias !13
%scevgep.6 = getelementptr i8, i8* %0, i64 3096
%scevgep2.6 = bitcast i8* %scevgep.6 to float*
%_p_scalar_.6 = load float, float* %scevgep2.6, align 8, !alias.scope !9, !noalias !11
%p_.6 = fadd fast float %_p_scalar_.6, %polly.access..load
%scevgep3.6 = getelementptr i8, i8* %retval, i64 3096
%scevgep34.6 = bitcast i8* %scevgep3.6 to float*
store float %p_.6, float* %scevgep34.6, align 8, !alias.scope !12, !noalias !13
%scevgep.7 = getelementptr i8, i8* %0, i64 3100
%scevgep2.7 = bitcast i8* %scevgep.7 to float*
%_p_scalar_.7 = load float, float* %scevgep2.7, align 4, !alias.scope !9, !noalias !11
%p_.7 = fadd fast float %_p_scalar_.7, %polly.access..load
%scevgep3.7 = getelementptr i8, i8* %retval, i64 3100
%scevgep34.7 = bitcast i8* %scevgep3.7 to float*
store float %p_.7, float* %scevgep34.7, align 4, !alias.scope !12, !noalias !13
%scevgep.8 = getelementptr i8, i8* %0, i64 3104
%scevgep2.8 = bitcast i8* %scevgep.8 to float*
%_p_scalar_.8 = load float, float* %scevgep2.8, align 16, !alias.scope !9, !noalias !11
%p_.8 = fadd fast float %_p_scalar_.8, %polly.access..load
%scevgep3.8 = getelementptr i8, i8* %retval, i64 3104
%scevgep34.8 = bitcast i8* %scevgep3.8 to float*
store float %p_.8, float* %scevgep34.8, align 16, !alias.scope !12, !noalias !13
%scevgep.9 = getelementptr i8, i8* %0, i64 3108
%scevgep2.9 = bitcast i8* %scevgep.9 to float*
%_p_scalar_.9 = load float, float* %scevgep2.9, align 4, !alias.scope !9, !noalias !11
%p_.9 = fadd fast float %_p_scalar_.9, %polly.access..load
%scevgep3.9 = getelementptr i8, i8* %retval, i64 3108
%scevgep34.9 = bitcast i8* %scevgep3.9 to float*
store float %p_.9, float* %scevgep34.9, align 4, !alias.scope !12, !noalias !13
%scevgep.10 = getelementptr i8, i8* %0, i64 3112
%scevgep2.10 = bitcast i8* %scevgep.10 to float*
%_p_scalar_.10 = load float, float* %scevgep2.10, align 8, !alias.scope !9, !noalias !11
%p_.10 = fadd fast float %_p_scalar_.10, %polly.access..load
%scevgep3.10 = getelementptr i8, i8* %retval, i64 3112
%scevgep34.10 = bitcast i8* %scevgep3.10 to float*
store float %p_.10, float* %scevgep34.10, align 8, !alias.scope !12, !noalias !13
%scevgep.11 = getelementptr i8, i8* %0, i64 3116
%scevgep2.11 = bitcast i8* %scevgep.11 to float*
%_p_scalar_.11 = load float, float* %scevgep2.11, align 4, !alias.scope !9, !noalias !11
%p_.11 = fadd fast float %_p_scalar_.11, %polly.access..load
%scevgep3.11 = getelementptr i8, i8* %retval, i64 3116
%scevgep34.11 = bitcast i8* %scevgep3.11 to float*
store float %p_.11, float* %scevgep34.11, align 4, !alias.scope !12, !noalias !13
%scevgep.12 = getelementptr i8, i8* %0, i64 3120
%scevgep2.12 = bitcast i8* %scevgep.12 to float*
%_p_scalar_.12 = load float, float* %scevgep2.12, align 16, !alias.scope !9, !noalias !11
%p_.12 = fadd fast float %_p_scalar_.12, %polly.access..load
%scevgep3.12 = getelementptr i8, i8* %retval, i64 3120
%scevgep34.12 = bitcast i8* %scevgep3.12 to float*
store float %p_.12, float* %scevgep34.12, align 16, !alias.scope !12, !noalias !13
%scevgep.13 = getelementptr i8, i8* %0, i64 3124
%scevgep2.13 = bitcast i8* %scevgep.13 to float*
%_p_scalar_.13 = load float, float* %scevgep2.13, align 4, !alias.scope !9, !noalias !11
%p_.13 = fadd fast float %_p_scalar_.13, %polly.access..load
%scevgep3.13 = getelementptr i8, i8* %retval, i64 3124
%scevgep34.13 = bitcast i8* %scevgep3.13 to float*
store float %p_.13, float* %scevgep34.13, align 4, !alias.scope !12, !noalias !13
%scevgep.14 = getelementptr i8, i8* %0, i64 3128
%scevgep2.14 = bitcast i8* %scevgep.14 to float*
%_p_scalar_.14 = load float, float* %scevgep2.14, align 8, !alias.scope !9, !noalias !11
%p_.14 = fadd fast float %_p_scalar_.14, %polly.access..load
%scevgep3.14 = getelementptr i8, i8* %retval, i64 3128
%scevgep34.14 = bitcast i8* %scevgep3.14 to float*
store float %p_.14, float* %scevgep34.14, align 8, !alias.scope !12, !noalias !13
%scevgep.15 = getelementptr i8, i8* %0, i64 3132
%scevgep2.15 = bitcast i8* %scevgep.15 to float*
%_p_scalar_.15 = load float, float* %scevgep2.15, align 4, !alias.scope !9, !noalias !11
%p_.15 = fadd fast float %_p_scalar_.15, %polly.access..load
%scevgep3.15 = getelementptr i8, i8* %retval, i64 3132
%scevgep34.15 = bitcast i8* %scevgep3.15 to float*
store float %p_.15, float* %scevgep34.15, align 4, !alias.scope !12, !noalias !13
ret void
}
attributes #0 = { norecurse nounwind "polly-optimized" }
!0 = !{!1, !1, i64 0}
!1 = !{!"pointer-to element_type: F32 dimensions: 1 dimensions: 784 layout { minor_to_major: 1 minor_to_major: 0 }", !2}
!2 = !{!"XLA TBAA"}
!3 = !{i64 3136}
!4 = !{i64 16}
!5 = !{!6, !6, i64 0}
!6 = !{!"pointer-to element_type: F32", !2}
!7 = !{i64 4}
!8 = !{i64 8}
!9 = distinct !{!9, !10, !"polly.alias.scope."}
!10 = distinct !{!10, !"polly.alias.scope.domain"}
!11 = !{!12}
!12 = distinct !{!12, !10, !"polly.alias.scope.retval"}
!13 = !{!9}
!14 = distinct !{!14, !15, !16}
!15 = !{!"llvm.loop.vectorize.width", i32 1}
!16 = !{!"llvm.loop.interleave.count", i32 1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment