2015-10-06 23:19:35 +08:00
; RUN: opt %loadPolly -pass-remarks-missed="polly-detect" \
; RUN: -polly-detect-track-failures -polly-detect -analyze \
2015-10-07 00:10:29 +08:00
; RUN: -polly-process-unprofitable=false < %s 2>&1| FileCheck %s
2017-07-18 07:58:33 +08:00
; RUN: opt %loadPolly -pass-remarks-missed="polly-detect" \
; RUN: -polly-detect-track-failures -polly-detect -analyze \
; RUN: -polly-process-unprofitable=false < %s 2>&1 -pass-remarks-output=%t.yaml
; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s
2015-02-19 13:31:07 +08:00
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; void onlyWrite(float *A) {
; for (long i = 0; i < 100; i++)
; A[i] = 0;
; }
2017-07-18 07:58:33 +08:00
;
2015-02-19 13:31:07 +08:00
; void onlyRead(float *A) {
; for (long i = 0; i < 100; i++)
; A[i];
; }
; CHECK: remark: /tmp/test.c:2:3: The following errors keep this region from being a Scop.
2015-03-09 14:59:16 +08:00
; CHECK: remark: /tmp/test.c:2:3: No profitable polyhedral optimization found
2015-02-19 13:31:07 +08:00
; CHECK: remark: /tmp/test.c:3:10: Invalid Scop candidate ends here.
; CHECK: remark: /tmp/test.c:7:3: The following errors keep this region from being a Scop.
2015-03-09 14:59:16 +08:00
; CHECK: remark: /tmp/test.c:7:3: No profitable polyhedral optimization found
2015-02-19 13:31:07 +08:00
; CHECK: remark: /tmp/test.c:8:10: Invalid Scop candidate ends here.
2017-07-18 07:58:33 +08:00
; YAML: --- !Missed
; YAML: Pass: polly-detect
; YAML: Name: RejectionErrors
2018-10-13 01:28:39 +08:00
; YAML: DebugLoc: { File: '/tmp/test.c', Line: 2, Column: 3 }
2017-07-18 07:58:33 +08:00
; YAML: Function: onlyWrite
; YAML: Args:
; YAML: - String: The following errors keep this region from being a Scop.
; YAML: ...
; YAML: --- !Missed
; YAML: Pass: polly-detect
; YAML: Name: Unprofitable
2018-10-13 01:28:39 +08:00
; YAML: DebugLoc: { File: '/tmp/test.c', Line: 2, Column: 3 }
2017-07-18 07:58:33 +08:00
; YAML: Function: onlyWrite
; YAML: Args:
; YAML: - String: No profitable polyhedral optimization found
; YAML: ...
; YAML: --- !Missed
; YAML: Pass: polly-detect
; YAML: Name: InvalidScopEnd
2018-10-13 01:28:39 +08:00
; YAML: DebugLoc: { File: '/tmp/test.c', Line: 3, Column: 10 }
2017-07-18 07:58:33 +08:00
; YAML: Function: onlyWrite
; YAML: Args:
; YAML: - String: Invalid Scop candidate ends here.
; YAML: ...
; YAML: --- !Missed
; YAML: Pass: polly-detect
; YAML: Name: RejectionErrors
2018-10-13 01:28:39 +08:00
; YAML: DebugLoc: { File: '/tmp/test.c', Line: 7, Column: 3 }
2017-07-18 07:58:33 +08:00
; YAML: Function: onlyRead
; YAML: Args:
; YAML: - String: The following errors keep this region from being a Scop.
; YAML: ...
; YAML: --- !Missed
; YAML: Pass: polly-detect
; YAML: Name: Unprofitable
2018-10-13 01:28:39 +08:00
; YAML: DebugLoc: { File: '/tmp/test.c', Line: 7, Column: 3 }
2017-07-18 07:58:33 +08:00
; YAML: Function: onlyRead
; YAML: Args:
; YAML: - String: No profitable polyhedral optimization found
; YAML: ...
; YAML: --- !Missed
; YAML: Pass: polly-detect
; YAML: Name: InvalidScopEnd
2018-10-13 01:28:39 +08:00
; YAML: DebugLoc: { File: '/tmp/test.c', Line: 8, Column: 10 }
2017-07-18 07:58:33 +08:00
; YAML: Function: onlyRead
; YAML: Args:
; YAML: - String: Invalid Scop candidate ends here.
2015-02-19 13:31:07 +08:00
; Function Attrs: nounwind uwtable
2015-11-06 14:27:39 +08:00
define void @onlyWrite ( float * %A ) #0 !dbg !4 {
2015-02-19 13:31:07 +08:00
entry:
call void @llvm.dbg.value ( metadata float * %A , i64 0 , metadata !14 , metadata !15 ) , !dbg !16
call void @llvm.dbg.value ( metadata i64 0 , i64 0 , metadata !17 , metadata !15 ) , !dbg !20
br label %for.cond , !dbg !21
for.cond: ; preds = %for.inc, %entry
%i.0 = phi i64 [ 0 , %entry ] , [ %inc , %for.inc ]
%exitcond = icmp ne i64 %i.0 , 100 , !dbg !22
br i1 %exitcond , label %for.body , label %for.end , !dbg !22
for.body: ; preds = %for.cond
2015-02-28 03:20:19 +08:00
%arrayidx = getelementptr inbounds float , float * %A , i64 %i.0 , !dbg !23
2015-02-19 13:31:07 +08:00
store float 0.000000e+00 , float * %arrayidx , align 4 , !dbg !25
br label %for.inc , !dbg !23
for.inc: ; preds = %for.body
%inc = add nuw nsw i64 %i.0 , 1 , !dbg !26
call void @llvm.dbg.value ( metadata i64 %inc , i64 0 , metadata !17 , metadata !15 ) , !dbg !20
br label %for.cond , !dbg !27
for.end: ; preds = %for.cond
ret void , !dbg !28
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
; Function Attrs: nounwind uwtable
2015-11-06 14:27:39 +08:00
define void @onlyRead ( float * %A ) #0 !dbg !10 {
2015-02-19 13:31:07 +08:00
entry:
call void @llvm.dbg.value ( metadata float * %A , i64 0 , metadata !29 , metadata !15 ) , !dbg !30
call void @llvm.dbg.value ( metadata i64 0 , i64 0 , metadata !31 , metadata !15 ) , !dbg !33
br label %for.cond , !dbg !34
for.cond: ; preds = %for.inc, %entry
%i.0 = phi i64 [ 0 , %entry ] , [ %inc , %for.inc ]
%exitcond = icmp ne i64 %i.0 , 100 , !dbg !35
br i1 %exitcond , label %for.body , label %for.end , !dbg !35
for.body: ; preds = %for.cond
2015-02-28 03:20:19 +08:00
%arrayidx = getelementptr inbounds float , float * %A , i64 %i.0 , !dbg !36
2015-02-28 05:22:50 +08:00
%val = load float , float * %arrayidx , align 4 , !dbg !38
2015-02-19 13:31:07 +08:00
br label %for.inc , !dbg !36
for.inc: ; preds = %for.body
%inc = add nuw nsw i64 %i.0 , 1 , !dbg !39
call void @llvm.dbg.value ( metadata i64 %inc , i64 0 , metadata !31 , metadata !15 ) , !dbg !33
br label %for.cond , !dbg !40
for.end: ; preds = %for.cond
ret void , !dbg !41
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value ( metadata , i64 , metadata , metadata ) #1
2019-12-25 07:52:21 +08:00
attributes #0 = { nounwind uwtable "less-precise-fpmad" = "false" "frame-pointer" = "all" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
2015-02-19 13:31:07 +08:00
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !11 , !12 }
!llvm.ident = ! { !13 }
2016-04-16 04:51:27 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.7.0 (llvm/trunk 229257)" , isOptimized: false , emissionKind: 1 , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
2015-04-30 01:02:14 +08:00
!1 = !DIFile ( filename: "/tmp/test.c" , directory: "/home/grosser/Projects/polly/git/tools/polly" )
2015-02-19 13:31:07 +08:00
!2 = ! { }
2018-05-10 15:09:10 +08:00
!4 = distinct !DISubprogram ( name: "onlyWrite" , line: 1 , isLocal: false , isDefinition: true , 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 , retainedNodes: !2 )
2015-04-30 01:02:14 +08:00
!5 = !DIFile ( filename: "/tmp/test.c" , directory: "/home/grosser/Projects/polly/git/tools/polly" )
!6 = !DISubroutineType ( types: !7 )
2015-02-19 13:31:07 +08:00
!7 = ! { null , !8 }
2015-04-30 01:02:14 +08:00
!8 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !9 )
!9 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "float" , size: 32 , align: 32 , encoding: D W _ A T E _ float )
2018-05-10 15:09:10 +08:00
!10 = distinct !DISubprogram ( name: "onlyRead" , line: 6 , isLocal: false , isDefinition: true , 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 , retainedNodes: !2 )
2015-02-19 13:31:07 +08:00
!11 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-04 02:17:26 +08:00
!12 = ! { i32 2 , !"Debug Info Version" , i32 3 }
2015-02-19 13:31:07 +08:00
!13 = ! { !"clang version 3.7.0 (llvm/trunk 229257)" }
2015-08-01 07:58:50 +08:00
!14 = !DILocalVariable ( name: "A" , line: 1 , arg: 1 , scope: !4 , file: !5 , type: !8 )
2015-04-30 01:02:14 +08:00
!15 = !DIExpression ( )
!16 = !DILocation ( line: 1 , column: 23 , scope: !4 )
2015-08-01 07:58:50 +08:00
!17 = !DILocalVariable ( name: "i" , line: 2 , scope: !18 , file: !5 , type: !19 )
2015-04-30 01:02:14 +08:00
!18 = distinct !DILexicalBlock ( line: 2 , column: 3 , file: !1 , scope: !4 )
!19 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "long int" , size: 64 , align: 64 , encoding: D W _ A T E _ s i g n e d )
!20 = !DILocation ( line: 2 , column: 13 , scope: !18 )
!21 = !DILocation ( line: 2 , column: 8 , scope: !18 )
!22 = !DILocation ( line: 2 , column: 3 , scope: !18 )
!23 = !DILocation ( line: 3 , column: 5 , scope: !24 )
!24 = distinct !DILexicalBlock ( line: 2 , column: 3 , file: !1 , scope: !18 )
!25 = !DILocation ( line: 3 , column: 10 , scope: !24 )
!26 = !DILocation ( line: 2 , column: 30 , scope: !24 )
!27 = !DILocation ( line: 2 , column: 3 , scope: !24 )
!28 = !DILocation ( line: 4 , column: 1 , scope: !4 )
2015-08-01 07:58:50 +08:00
!29 = !DILocalVariable ( name: "A" , line: 6 , arg: 1 , scope: !10 , file: !5 , type: !8 )
2015-04-30 01:02:14 +08:00
!30 = !DILocation ( line: 6 , column: 22 , scope: !10 )
2015-08-01 07:58:50 +08:00
!31 = !DILocalVariable ( name: "i" , line: 7 , scope: !32 , file: !5 , type: !19 )
2015-04-30 01:02:14 +08:00
!32 = distinct !DILexicalBlock ( line: 7 , column: 3 , file: !1 , scope: !10 )
!33 = !DILocation ( line: 7 , column: 13 , scope: !32 )
!34 = !DILocation ( line: 7 , column: 8 , scope: !32 )
!35 = !DILocation ( line: 7 , column: 3 , scope: !32 )
!36 = !DILocation ( line: 8 , column: 5 , scope: !37 )
!37 = distinct !DILexicalBlock ( line: 7 , column: 3 , file: !1 , scope: !32 )
!38 = !DILocation ( line: 8 , column: 10 , scope: !37 )
!39 = !DILocation ( line: 7 , column: 30 , scope: !37 )
!40 = !DILocation ( line: 7 , column: 3 , scope: !37 )
!41 = !DILocation ( line: 9 , column: 1 , scope: !10 )