Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / pointer-type-pointer-type-comparison.ll
blob301b4f0cc132a8145e99fa8e3b5f2f691e633f5b
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-ast -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen-isl -S < %s | FileCheck %s -check-prefix=CODEGEN
4 ;    void f(int a[], int N, float *P, float *Q) {
5 ;      int i;
6 ;      for (i = 0; i < N; ++i)
7 ;        if (P != Q)
8 ;          a[i] = i;
9 ;    }
11 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13 define void @f(i64* nocapture %a, i64 %N, float * %P, float * %Q) nounwind {
14 entry:
15   br label %bb
17 bb:
18   %i = phi i64 [ 0, %entry ], [ %i.inc, %bb.backedge ]
19   %brcond = icmp ne float* %P, %Q
20   br i1 %brcond, label %store, label %bb.backedge
22 store:
23   %scevgep = getelementptr i64, i64* %a, i64 %i
24   store i64 %i, i64* %scevgep
25   br label %bb.backedge
27 bb.backedge:
28   %i.inc = add nsw i64 %i, 1
29   %exitcond = icmp eq i64 %i.inc, %N
30   br i1 %exitcond, label %return, label %bb
32 return:
33   ret void
36 ; CHECK: if (Q >= P + 1) {
37 ; CHECK:   for (int c0 = 0; c0 < N; c0 += 1)
38 ; CHECK:     Stmt_store(c0);
39 ; CHECK: } else if (P >= Q + 1)
40 ; CHECK:   for (int c0 = 0; c0 < N; c0 += 1)
41 ; CHECK:     Stmt_store(c0);
42 ; CHECK: }
44 ; CODEGEN:       %[[Pinc:[_a-zA-Z0-9]+]] = getelementptr float, float* %P, i64 1
45 ; CODEGEN-NEXT:                             icmp uge float* %Q, %[[Pinc]]
46 ; CODEGEN:       %[[Qinc:[_a-zA-Z0-9]+]] = getelementptr float, float* %Q, i64 1
47 ; CODEGEN-NEXT:                             icmp uge float* %P, %[[Qinc]]