[JSON][PM] Port json import/export over to new pm
[polly-mirror.git] / test / ScopInfo / memset_null.ll
blobb0d0be0d3b8940cd55baec8ec57f59f1fde48888
1 ; RUN: opt %loadPolly -polly-allow-modref-calls -polly-scops -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-allow-modref-calls -S -polly-codegen < %s
4 ; Verify we can handle a memset to "null" and that we do not model it.
5 ; TODO: FIXME: We could use the undefined memset to optimize the code further,
6 ;              see the TODOs in the ScopInfo.cpp.
8 ; CHECK:         Statements {
9 ; CHECK-NEXT:        Stmt_for_cond5_preheader_us221
10 ; CHECK-NEXT:            Domain :=
11 ; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221[0] };
12 ; CHECK-NEXT:            Schedule :=
13 ; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221[i0] -> [0] };
14 ; CHECK-NEXT:            MustWriteAccess :=     [Reduction Type: NONE] [Scalar: 0]
15 ; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221[i0] -> MemRef_A[0] };
16 ; CHECK-NEXT:    }
19 target datalayout = "e-m:e-i64:64-i128:128-n8:16:32:64-S128"
21 define void @test(i32* %A) {
22 entry:
23   br i1 undef, label %for.end68, label %for.cond5.preheader.lr.ph
25 for.cond5.preheader.lr.ph:                        ; preds = %entry
26   br label %for.cond5.preheader.us221
28 for.cond5.preheader.us221:                        ; preds = %for.cond5.preheader.us221, %for.cond5.preheader.lr.ph
29   store i32 0, i32* %A
30   call void @llvm.memset.p0i8.i64(i8* null, i8 0, i64 undef, i32 1, i1 false)
31   br i1 true, label %for.end68, label %for.cond5.preheader.us221
33 for.end68:                                        ; preds = %for.cond5.preheader.us221, %entry
34   ret void
37 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)