File: memset_null.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (37 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
; RUN: opt %loadPolly -polly-allow-modref-calls -polly-scops -analyze < %s | FileCheck %s
; RUN: opt %loadPolly -polly-allow-modref-calls -S -polly-codegen < %s
;
; Verify we can handle a memset to "null" and that we do not model it.
; TODO: FIXME: We could use the undefined memset to optimize the code further,
;              see the TODOs in the ScopInfo.cpp.
;
; CHECK:         Statements {
; CHECK-NEXT:        Stmt_for_cond5_preheader_us221
; CHECK-NEXT:            Domain :=
; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221[0] };
; CHECK-NEXT:            Schedule :=
; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221[i0] -> [0] };
; CHECK-NEXT:            MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221[i0] -> MemRef_A[0] };
; CHECK-NEXT:    }

;
target datalayout = "e-m:e-i64:64-i128:128-n8:16:32:64-S128"

define void @test(i32* %A) {
entry:
  br i1 undef, label %for.end68, label %for.cond5.preheader.lr.ph

for.cond5.preheader.lr.ph:                        ; preds = %entry
  br label %for.cond5.preheader.us221

for.cond5.preheader.us221:                        ; preds = %for.cond5.preheader.us221, %for.cond5.preheader.lr.ph
  store i32 0, i32* %A
  call void @llvm.memset.p0i8.i64(i8* null, i8 0, i64 undef, i32 1, i1 false)
  br i1 true, label %for.end68, label %for.cond5.preheader.us221

for.end68:                                        ; preds = %for.cond5.preheader.us221, %entry
  ret void
}

declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)