2015-10-06 23:36:44 +08:00
; RUN: opt %loadPolly -polly-detect -polly-report -disable-output < %s 2>&1 | FileCheck %s
2013-12-18 18:49:53 +08:00
target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128"
; Function Attrs: nounwind uwtable
2015-11-06 14:27:39 +08:00
define void @foo ( float * %A ) #0 !dbg !4 {
2013-12-18 18:49:53 +08:00
entry:
br label %entry.split
entry.split: ; preds = %entry
br label %for.body , !dbg !11
for.body: ; preds = %entry.split, %for.body
%indvar = phi i64 [ 0 , %entry.split ] , [ %indvar.next , %for.body ]
%i.01 = trunc i64 %indvar to i32 , !dbg !13
2015-02-28 03:20:19 +08:00
%arrayidx = getelementptr float , float * %A , i64 %indvar , !dbg !13
2013-12-18 18:49:53 +08:00
%conv = sitofp i32 %i.01 to float , !dbg !13
store float %conv , float * %arrayidx , align 4 , !dbg !13
%indvar.next = add i64 %indvar , 1 , !dbg !11
%exitcond = icmp ne i64 %indvar.next , 100 , !dbg !11
br i1 %exitcond , label %for.body , label %for.end , !dbg !11
for.end: ; preds = %for.body
ret void , !dbg !14
}
; CHECK: note: Polly detected an optimizable loop region (scop) in function 'foo'
; CHECK: test.c:2: Start of scop
; CHECK: test.c:3: End of scop
; Function Attrs: nounwind uwtable
2015-11-06 14:27:39 +08:00
define void @bar ( float * %A ) #0 !dbg !7 {
2013-12-18 18:49:53 +08:00
entry:
br label %entry.split
entry.split: ; preds = %entry
br label %for.body , !dbg !15
for.body: ; preds = %entry.split, %for.body
%indvar = phi i64 [ 0 , %entry.split ] , [ %indvar.next , %for.body ]
%i.01 = trunc i64 %indvar to i32 , !dbg !17
2015-02-28 03:20:19 +08:00
%arrayidx = getelementptr float , float * %A , i64 %indvar , !dbg !17
2013-12-18 18:49:53 +08:00
%conv = sitofp i32 %i.01 to float , !dbg !17
store float %conv , float * %arrayidx , align 4 , !dbg !17
%indvar.next = add i64 %indvar , 1 , !dbg !15
%exitcond = icmp ne i64 %indvar.next , 100 , !dbg !15
br i1 %exitcond , label %for.body , label %for.end , !dbg !15
for.end: ; preds = %for.body
ret void , !dbg !18
}
; CHECK: note: Polly detected an optimizable loop region (scop) in function 'bar'
; CHECK: test.c:9: Start of scop
; CHECK: test.c:13: End of scop
attributes #0 = { nounwind uwtable "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !8 , !9 }
!llvm.ident = ! { !10 }
2016-04-16 04:51:27 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.5 " , isOptimized: false , emissionKind: 0 , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
2015-04-30 01:02:14 +08:00
!1 = !DIFile ( filename: "test.c" , directory: "/home/grosser/Projects/polly/git/tools/polly" )
2015-03-18 02:23:38 +08:00
!2 = ! { }
2016-04-16 04:51:27 +08:00
!4 = distinct !DISubprogram ( name: "foo" , line: 1 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , unit: !0 , scopeLine: 1 , file: !1 , scope: !5 , type: !6 , variables: !2 )
2015-04-30 01:02:14 +08:00
!5 = !DIFile ( filename: "test.c" , directory: "/home/grosser/Projects/polly/git/tools/polly" )
!6 = !DISubroutineType ( types: ! { null } )
2016-04-16 04:51:27 +08:00
!7 = distinct !DISubprogram ( name: "bar" , line: 6 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , unit: !0 , scopeLine: 6 , file: !1 , scope: !5 , type: !6 , variables: !2 )
2014-12-16 04:28:50 +08:00
!8 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-04 02:17:26 +08:00
!9 = ! { i32 1 , !"Debug Info Version" , i32 3 }
2014-12-16 04:28:50 +08:00
!10 = ! { !"clang version 3.5 " }
2015-04-30 01:02:14 +08:00
!11 = !DILocation ( line: 2 , scope: !12 )
!12 = distinct !DILexicalBlock ( line: 2 , column: 0 , file: !1 , scope: !4 )
!13 = !DILocation ( line: 3 , scope: !12 )
!14 = !DILocation ( line: 4 , scope: !4 )
!15 = !DILocation ( line: 9 , scope: !16 )
!16 = distinct !DILexicalBlock ( line: 9 , column: 0 , file: !1 , scope: !7 )
!17 = !DILocation ( line: 13 , scope: !16 )
!18 = !DILocation ( line: 14 , scope: !7 )
2013-12-18 18:49:53 +08:00