1 ; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-vector -dce -S %s | FileCheck %s
2 ; Obtained from C source as:
3 ; clang -S -emit-llvm -O0 O3-vect-pr32243.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer O3-vect-pr32243.s > O3-vect-pr32243.ll
6 ; ModuleID = 'O3-vect-pr32243.s'
7 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
8 target triple = "x86_64-unknown-linux-gnu"
10 %struct.__GLcontextRec = type opaque
11 %struct.gl_renderbuffer = type { %struct.gl_renderbuffer*, {}* }
13 define void @put_mono_values_s8(%struct.__GLcontextRec* %ctx, %struct.gl_renderbuffer* %s8rb, i32 %count, i32* %x, i32* %y, i8* %value, i8* %mask) nounwind uwtable {
15 %temp = alloca [4096 x i32], align 16
16 %Wrapped = getelementptr inbounds %struct.gl_renderbuffer* %s8rb, i64 0, i32 0
17 %tmp1 = load %struct.gl_renderbuffer** %Wrapped, align 8
18 %tmp6 = load i8* %value, align 1
19 %tmp = icmp sgt i32 %count, 0
20 %smax = select i1 %tmp, i32 %count, i32 0
21 %tmp2 = zext i32 %smax to i64
24 for.cond: ; preds = %for.inc, %entry
25 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
26 %arrayidx16 = getelementptr [4096 x i32]* %temp, i64 0, i64 %indvar
27 %arrayidx = getelementptr i8* %mask, i64 %indvar
28 %exitcond = icmp ne i64 %indvar, %tmp2
29 br i1 %exitcond, label %for.body, label %for.end
31 for.body: ; preds = %for.cond
32 %tobool = icmp eq i8* %mask, null
33 br i1 %tobool, label %if.then, label %lor.lhs.false
35 lor.lhs.false: ; preds = %for.body
36 %tmp12 = load i8* %arrayidx, align 1
37 %tobool13 = icmp eq i8 %tmp12, 0
38 br i1 %tobool13, label %if.end, label %if.then
40 if.then: ; preds = %lor.lhs.false, %for.body
41 %tmp17 = load i32* %arrayidx16, align 4
42 %and = and i32 %tmp17, 16777215
43 %conv19 = sext i8 %tmp6 to i32
44 %or = or i32 %and, %conv19
45 store i32 %or, i32* %arrayidx16, align 4
48 if.end: ; preds = %lor.lhs.false, %if.then
51 for.inc: ; preds = %if.end
52 %indvar.next = add i64 %indvar, 1
55 for.end: ; preds = %for.cond
56 %PutValues = getelementptr inbounds %struct.gl_renderbuffer* %tmp1, i64 0, i32 1
57 %PutValues251 = load {}** %PutValues, align 8
58 %tmp26 = bitcast {}* %PutValues251 to void (%struct.__GLcontextRec*, %struct.gl_renderbuffer*, i32, i32*, i32*, i8*, i8*)*
59 %tmp4 = bitcast [4096 x i32]* %temp to i8*
60 call void %tmp26(%struct.__GLcontextRec* %ctx, %struct.gl_renderbuffer* %tmp1, i32 %count, i32* %x, i32* %y, i8* %tmp4, i8* %mask) nounwind