[PATCH] D33768: [Polly] Exclude Ignored Intrinsics from explicit instruction list
Nandini Singhal via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 1 03:44:36 PDT 2017
nandini12396 added a comment.
Sir, sorry but I still didnt understand why the polly generated code for this test case (`opt -polly-codegen -polly-process-unprofitable`), more intrinsics are generated :
; ModuleID = '../llvm/tools/polly/test/Isl/CodeGen/intrinsics_misc.ll'
source_filename = "../llvm/tools/polly/test/Isl/CodeGen/intrinsics_misc.ll"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@A = common global [1024 x i32] zeroinitializer, align 16
; Function Attrs: nounwind uwtable
define void @jd() #0 {
entry:
%exitcond.s2a = alloca i1
%tmp = alloca [1024 x i32], align 16
%tmp3 = bitcast [1024 x i32]* @A to i8*
br label %polly.split_new_and_old
polly.split_new_and_old: ; preds = %entry
br i1 true, label %polly.start, label %for.cond.pre_entry_bb
for.cond.pre_entry_bb: ; preds = %polly.split_new_and_old
br label %for.cond
for.cond: ; preds = %for.cond.pre_entry_bb, %for.inc11
%indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc11 ], [ 0, %for.cond.pre_entry_bb ]
%exitcond5 = icmp ne i64 %indvars.iv3, 1024
br i1 %exitcond5, label %for.body, label %polly.merge_new_and_old
for.body: ; preds = %for.cond
%lis = call {}* @llvm.invariant.start.p0i8(i64 4096, i8* %tmp3)
br label %for.cond2
for.cond2: ; preds = %for.inc, %for.body
%indvars.iv1 = phi i64 [ %indvars.iv.next2, %for.inc ], [ %indvars.iv3, %for.body ]
%lftr.wideiv = trunc i64 %indvars.iv1 to i32
%exitcond = icmp ne i32 %lftr.wideiv, 1024
br i1 %exitcond, label %for.body4, label %for.end
for.body4: ; preds = %for.cond2
call void @llvm.assume(i1 %exitcond)
%0 = call i1 @llvm.expect.i1(i1 %exitcond, i1 true)
%arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv1
%tmp6 = load i32, i32* %arrayidx, align 4
%arrayidx6 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
call void @llvm.donothing()
%tmp7 = load i32, i32* %arrayidx6, align 4
%add = add nsw i32 %tmp7, %tmp6
store i32 %add, i32* %arrayidx6, align 4
br label %for.inc
for.inc: ; preds = %for.body4
%indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
br label %for.cond2
for.end: ; preds = %for.cond2
%arrayidx8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
%tmp8 = load i32, i32* %arrayidx8, align 4
%arrayidx10 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv3
call void @llvm.invariant.end.p0i8({}* %lis, i64 4096, i8* %tmp3)
store i32 %tmp8, i32* %arrayidx10, align 4
br label %for.inc11
for.inc11: ; preds = %for.end
%indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1
br label %for.cond
polly.merge_new_and_old: ; preds = %polly.exiting, %for.cond
br label %for.end13
for.end13: ; preds = %polly.merge_new_and_old
ret void
polly.start: ; preds = %polly.split_new_and_old
br label %polly.loop_preheader
polly.loop_exit: ; preds = %polly.stmt.for.end
br label %polly.exiting
polly.exiting: ; preds = %polly.loop_exit
br label %polly.merge_new_and_old
polly.loop_header: ; preds = %polly.stmt.for.end, %polly.loop_preheader
%polly.indvar = phi i64 [ 0, %polly.loop_preheader ], [ %polly.indvar_next, %polly.stmt.for.end ]
%1 = sub nsw i64 0, %polly.indvar
%2 = add nsw i64 %1, 1024
br label %polly.loop_preheader2
polly.loop_exit3: ; preds = %polly.merge
br label %polly.stmt.for.end
polly.stmt.for.end: ; preds = %polly.loop_exit3
%scevgep9 = getelementptr [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %polly.indvar
%tmp8_p_scalar_ = load i32, i32* %scevgep9, align 4, !alias.scope !0, !noalias !2
%scevgep10 = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %polly.indvar
store i32 %tmp8_p_scalar_, i32* %scevgep10, align 4, !alias.scope !4, !noalias !5
%polly.indvar_next = add nsw i64 %polly.indvar, 1
%polly.loop_cond = icmp sle i64 %polly.indvar_next, 1023
br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit
polly.loop_preheader: ; preds = %polly.start
br label %polly.loop_header
polly.loop_header1: ; preds = %polly.merge, %polly.loop_preheader2
%polly.indvar4 = phi i64 [ 0, %polly.loop_preheader2 ], [ %polly.indvar_next5, %polly.merge ]
br label %polly.stmt.for.cond2
polly.stmt.for.cond2: ; preds = %polly.loop_header1
%3 = trunc i64 %polly.indvar4 to i32
%4 = add i32 %7, %3
%p_exitcond = icmp ne i32 %4, 1024
store i1 %p_exitcond, i1* %exitcond.s2a
br label %polly.cond
polly.cond: ; preds = %polly.stmt.for.cond2
%5 = add nsw i64 %polly.indvar, %polly.indvar4
%6 = icmp sle i64 %5, 1023
br i1 %6, label %polly.then, label %polly.else
polly.merge: ; preds = %polly.else, %polly.stmt.for.body4
%polly.indvar_next5 = add nsw i64 %polly.indvar4, 1
%polly.loop_cond6 = icmp sle i64 %polly.indvar_next5, %2
br i1 %polly.loop_cond6, label %polly.loop_header1, label %polly.loop_exit3
polly.loop_preheader2: ; preds = %polly.loop_header
%7 = trunc i64 %polly.indvar to i32
%scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %polly.indvar
%scevgep8 = getelementptr [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %polly.indvar
br label %polly.loop_header1
polly.then: ; preds = %polly.cond
br label %polly.stmt.for.body4
polly.stmt.for.body4: ; preds = %polly.then
%scevgep7 = getelementptr i32, i32* %scevgep, i64 %polly.indvar4
%tmp6_p_scalar_ = load i32, i32* %scevgep7, align 4, !alias.scope !4, !noalias !5
%tmp7_p_scalar_ = load i32, i32* %scevgep8, align 4, !alias.scope !0, !noalias !2
%p_add = add nsw i32 %tmp7_p_scalar_, %tmp6_p_scalar_
store i32 %p_add, i32* %scevgep8, align 4, !alias.scope !0, !noalias !2
br label %polly.merge
polly.else: ; preds = %polly.cond
br label %polly.merge
}
; Function Attrs: nounwind readnone
declare void @llvm.donothing() #1
; Function Attrs: nounwind
declare void @llvm.assume(i1) #2
; Function Attrs: nounwind readnone
declare i1 @llvm.expect.i1(i1, i1) #1
; Function Attrs: argmemonly nounwind
declare {}* @llvm.invariant.start.p0i8(i64, i8* nocapture) #3
; Function Attrs: argmemonly nounwind
declare void @llvm.invariant.end.p0i8({}*, i64, i8* nocapture) #3
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "polly-optimized" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
attributes #2 = { nounwind }
attributes #3 = { argmemonly nounwind }
!0 = distinct !{!0, !1, !"polly.alias.scope.MemRef2"}
!1 = distinct !{!1, !"polly.alias.scope.domain"}
!2 = !{!3, !4}
!3 = distinct !{!3, !1, !"polly.alias.scope.MemRef0"}
!4 = distinct !{!4, !1, !"polly.alias.scope.MemRef1"}
!5 = !{!3, !0}
https://reviews.llvm.org/D33768
More information about the llvm-commits
mailing list