2015-02-19 13:31:07 +08:00
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-use-runtime-alias-checks=false -pass-remarks-missed="polly-detect" -polly-detect-track-failures -polly-detect -analyze < %s 2>&1| FileCheck %s
2014-08-17 18:09:07 +08:00
;void f(int A[], int B[]) {
; for (int i=0; i<42; i++)
; A[i] = B[i];
;}
; CHECK: remark: ReportAlias-01.c:2:8: The following errors keep this region from being a Scop.
2014-09-18 22:45:43 +08:00
; CHECK: remark: ReportAlias-01.c:3:5: Accesses to the arrays "B", "A" may access the same memory.
2014-08-17 18:09:07 +08:00
; CHECK: remark: ReportAlias-01.c:3:5: Invalid Scop candidate ends here.
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f ( i32 * %A , i32 * %B ) {
entry:
br label %entry.split
entry.split: ; preds = %entry
2015-04-30 01:02:14 +08:00
tail call void @llvm.dbg.value ( metadata i32 * %A , i64 0 , metadata !13 , metadata !DIExpression ( ) ) , !dbg !14
tail call void @llvm.dbg.value ( metadata i32 * %B , i64 0 , metadata !15 , metadata !DIExpression ( ) ) , !dbg !16
tail call void @llvm.dbg.value ( metadata i32 0 , i64 0 , metadata !18 , metadata !DIExpression ( ) ) , !dbg !20
2014-08-17 18:09:07 +08:00
br label %for.body , !dbg !21
for.body: ; preds = %entry.split, %for.body
%indvar = phi i64 [ 0 , %entry.split ] , [ %indvar.next , %for.body ]
2015-02-28 03:20:19 +08:00
%arrayidx = getelementptr i32 , i32 * %B , i64 %indvar , !dbg !22
%arrayidx2 = getelementptr i32 , i32 * %A , i64 %indvar , !dbg !22
2015-02-28 05:22:50 +08:00
%0 = load i32 , i32 * %arrayidx , align 4 , !dbg !22
2014-08-17 18:09:07 +08:00
store i32 %0 , i32 * %arrayidx2 , align 4 , !dbg !22
2015-04-30 01:02:14 +08:00
tail call void @llvm.dbg.value ( metadata ! { null } , i64 0 , metadata !18 , metadata !DIExpression ( ) ) , !dbg !20
2014-08-17 18:09:07 +08:00
%indvar.next = add i64 %indvar , 1 , !dbg !21
%exitcond = icmp ne i64 %indvar.next , 42 , !dbg !21
br i1 %exitcond , label %for.body , label %for.end , !dbg !21
for.end: ; preds = %for.body
ret void , !dbg !23
}
2015-04-07 02:25:51 +08:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata )
declare void @llvm.dbg.value ( metadata , i64 , metadata , metadata )
2014-08-17 18:09:07 +08:00
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !10 , !11 }
!llvm.ident = ! { !12 }
2015-04-30 01:02:14 +08:00
!0 = !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.6.0 " , isOptimized: false , emissionKind: 1 , file: !1 , enums: !2 , retainedTypes: !2 , subprograms: !3 , globals: !2 , imports: !2 )
!1 = !DIFile ( filename: "ReportAlias-01.c" , directory: "test/ScopDetectionDiagnostic/" )
2014-12-16 04:28:50 +08:00
!2 = ! { }
!3 = ! { !4 }
2015-04-30 01:02:14 +08:00
!4 = !DISubprogram ( name: "f" , 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 , scopeLine: 1 , file: !1 , scope: !5 , type: !6 , function: void ( i32 * , i32 * ) * @f , variables: !2 )
!5 = !DIFile ( filename: "ReportAlias-01.c" , directory: "test/ScopDetectionDiagnostic/" )
!6 = !DISubroutineType ( types: !7 )
2014-12-16 04:28:50 +08:00
!7 = ! { null , !8 , !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: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
2014-12-16 04:28:50 +08:00
!10 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-04 02:17:26 +08:00
!11 = ! { i32 2 , !"Debug Info Version" , i32 3 }
2014-12-16 04:28:50 +08:00
!12 = ! { !"clang version 3.6.0 " }
2015-04-30 01:02:14 +08:00
!13 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , name: "A" , line: 1 , arg: 1 , scope: !4 , file: !5 , type: !8 )
!14 = !DILocation ( line: 1 , column: 12 , scope: !4 )
!15 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , name: "B" , line: 1 , arg: 2 , scope: !4 , file: !5 , type: !8 )
!16 = !DILocation ( line: 1 , column: 21 , scope: !4 )
2014-12-16 04:28:50 +08:00
!17 = ! { i32 0 }
2015-04-30 01:02:14 +08:00
!18 = !DILocalVariable ( tag: D W _ T A G _ a u t o _ v a r i a b l e , name: "i" , line: 2 , scope: !19 , file: !5 , type: !9 )
!19 = distinct !DILexicalBlock ( line: 2 , column: 3 , file: !1 , scope: !4 )
!20 = !DILocation ( line: 2 , column: 12 , scope: !19 )
!21 = !DILocation ( line: 2 , column: 8 , scope: !19 )
!22 = !DILocation ( line: 3 , column: 5 , scope: !19 )
!23 = !DILocation ( line: 4 , column: 1 , scope: !4 )