File: pointer-comparison.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (38 lines) | stat: -rw-r--r-- 1,313 bytes parent folder | download | duplicates (4)
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
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
;
; TODO: FIXME: Investigate why we need a InvalidContext here.
;
;    void f(int *A, int *B) {
;      while (A != B) {
;        *A = *A + 1;
;        A++;
;      }
;    }
;
; CHECK:      Invalid Context:
; CHECK-NEXT:   [A, B] -> { : (4*floor((A - B)/4) < A - B) or (4*floor((-A + B)/4) = -A + B and B >= 9223372036854775808 + A) or (4*floor((-A + B)/4) = -A + B and B <= -4 + A) }
;
; CHECK:      Domain :=
; CHECK-NEXT:   [A, B] -> { Stmt_while_body[i0] : 4*floor((-A + B)/4) = -A + B and i0 >= 0 and 4i0 <= -4 - A + B }
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A, i32* %B) {
entry:
  br label %while.cond

while.cond:                                       ; preds = %while.body, %entry
  %A.addr.0 = phi i32* [ %A, %entry ], [ %incdec.ptr, %while.body ]
  %cmp = icmp eq i32* %A.addr.0, %B
  br i1 %cmp, label %while.end, label %while.body

while.body:                                       ; preds = %while.cond
  %tmp = load i32, i32* %A.addr.0, align 4
  %add = add nsw i32 %tmp, 1
  store i32 %add, i32* %A.addr.0, align 4
  %incdec.ptr = getelementptr inbounds i32, i32* %A.addr.0, i64 1
  br label %while.cond

while.end:                                        ; preds = %while.cond
  ret void
}