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 pr46049.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr46049.s > pr46049.ll
6 ; ModuleID = 'pr46049.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 define void @foo(i16 signext %i, i16* %p, i16 signext %x) nounwind uwtable {
12 %tmp = zext i16 %i to i64
15 while.cond: ; preds = %while.body, %entry
16 %indvar = phi i64 [ %indvar.next, %while.body ], [ 0, %entry ]
17 %tmp3 = mul i64 %indvar, 2
18 %tmp4 = add i64 %tmp3, 1
19 %incdec.ptr = getelementptr i16* %p, i64 %tmp4
20 %p.addr.0 = getelementptr i16* %p, i64 %tmp3
21 %exitcond = icmp eq i64 %indvar, %tmp
22 br i1 %exitcond, label %while.end, label %while.body
24 while.body: ; preds = %while.cond
25 %tmp2 = load i16* %p.addr.0, align 2
26 %call = call i32 @bar(i16 signext %tmp2, i16 signext %x)
27 %shr1 = lshr i32 %call, 15
28 %conv = trunc i32 %shr1 to i16
29 store i16 %conv, i16* %p.addr.0, align 2
30 %tmp7 = load i16* %incdec.ptr, align 2
31 %call9 = call i32 @bar(i16 signext %tmp7, i16 signext %x)
32 %shr102 = lshr i32 %call9, 15
33 %conv11 = trunc i32 %shr102 to i16
34 store i16 %conv11, i16* %incdec.ptr, align 2
35 %indvar.next = add i64 %indvar, 1
38 while.end: ; preds = %while.cond
42 define internal i32 @bar(i16 signext %x, i16 signext %y) nounwind uwtable inlinehint {
44 %conv = sext i16 %x to i32
45 %conv2 = sext i16 %y to i32
46 %mul = mul nsw i32 %conv, %conv2