File: pointer_rem.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (47 lines) | stat: -rw-r--r-- 1,687 bytes parent folder | download | duplicates (5)
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
38
39
40
41
42
43
44
45
46
47
; RUN: opt %loadPolly -polly-process-unprofitable -polly-scops -polly-print-ast -disable-output -S < %s | FileCheck %s --check-prefix=AST
; RUN: opt %loadPolly -polly-process-unprofitable -polly-scops -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN

target datalayout = "e-m:e-i64:64-i128:128-n8:16:32:64-S128"
target triple = "aarch64--linux-gnu"

; This test is to ensure that for we generate signed remainder for
; the polly.cond check.

; AST: isl ast :: foo1
; AST: if ((a1 - b1) % 24 == 0)

; CODEGEN: define void @foo1
; CODEGEN: polly.cond:
; CODEGEN: %pexp.zdiv_r = srem {{.*}}, 24

%struct.A = type { i32, i64, i8 }

; Function Attrs: norecurse nounwind
define void @foo1(ptr %a1, ptr readnone %b1) #0 {
entry:
  br label %entry.split

entry.split:                                      ; preds = %entry
  %cmp4 = icmp eq ptr %a1, %b1
  br i1 %cmp4, label %for.cond.cleanup, label %for.body.preheader

for.body.preheader:                               ; preds = %entry.split
  br label %for.body

for.cond.cleanup.loopexit:                        ; preds = %for.body
  br label %for.cond.cleanup

for.cond.cleanup:                                 ; preds = %for.cond.cleanup.loopexit, %entry.split
  ret void

for.body:                                         ; preds = %for.body.preheader, %for.body
  %start.05 = phi ptr [ %incdec.ptr, %for.body ], [ %a1, %for.body.preheader ]
  %0 = load i32, ptr %start.05, align 8
  %add = add nsw i32 %0, 1
  store i32 %add, ptr %start.05, align 8
  %incdec.ptr = getelementptr inbounds %struct.A, ptr %start.05, i64 1
  %cmp = icmp eq ptr %incdec.ptr, %b1
  br i1 %cmp, label %for.cond.cleanup.loopexit, label %for.body
}