Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / aliasing_different_pointer_types.ll
blobcfa8238c1f97b2dfa1a8d9b9f833fb8f75eeb8ef
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-code-generator=isl -polly-codegen-isl -S < %s | FileCheck %s
3 ; Check that we cast the different pointer types correctly before we compare
4 ; them in the RTC's. We use i8* as max pointer type.
6 ; CHECK: entry:
7 ; CHECK:   %polly.access.B = getelementptr float*, float** %B, i64 1024
8 ; CHECK:   %polly.access.A = getelementptr double*, double** %A, i64 0
9 ; CHECK:   %[[paBb:[._a-zA-Z0-9]]] = bitcast float** %polly.access.B to i8*
10 ; CHECK:   %[[paAb:[._a-zA-Z0-9]]] = bitcast double** %polly.access.A to i8*
11 ; CHECK:   %[[ALeB:[._a-zA-Z0-9]]] = icmp ule i8* %[[paBb]], %[[paAb]]
12 ; CHECK:   %polly.access.A1 = getelementptr double*, double** %A, i64 1024
13 ; CHECK:   %polly.access.B2 = getelementptr float*, float** %B, i64 0
14 ; CHECK:   %[[paA1b:[._a-zA-Z0-9]]] = bitcast double** %polly.access.A1 to i8*
15 ; CHECK:   %[[paB2b:[._a-zA-Z0-9]]] = bitcast float** %polly.access.B2 to i8*
16 ; CHECK:   %[[A1LeB2:[._a-zA-Z0-9]]] = icmp ule i8* %[[paA1b]], %[[paB2b]]
17 ; CHECK:   %[[le1OrLe2:[._a-zA-Z0-9]]] = or i1 %[[ALeB]], %[[A1LeB2]]
18 ; CHECK:   %[[orAndTrue:[._a-zA-Z0-9]]] = and i1 true, %[[le1OrLe2]]
19 ; CHECK:   br label %polly.split_new_and_old
21 ;    void jd(double **A, float **B) {
22 ;      for (int i = 0; i < 1024; i++)
23 ;        A[i] = (double *)B[i];
24 ;    }
26 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
28 define void @jd(double** %A, float** %B) {
29 entry:
30   br label %for.cond
32 for.cond:                                         ; preds = %for.inc, %entry
33   %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
34   %exitcond = icmp ne i64 %indvars.iv, 1024
35   br i1 %exitcond, label %for.body, label %for.end
37 for.body:                                         ; preds = %for.cond
38   %arrayidx = getelementptr inbounds float*, float** %B, i64 %indvars.iv
39   %tmp = load float** %arrayidx, align 8
40   %tmp1 = bitcast float* %tmp to double*
41   %arrayidx2 = getelementptr inbounds double*, double** %A, i64 %indvars.iv
42   store double* %tmp1, double** %arrayidx2, align 8
43   br label %for.inc
45 for.inc:                                          ; preds = %for.body
46   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
47   br label %for.cond
49 for.end:                                          ; preds = %for.cond
50   ret void