1 ; RUN: opt < %s -passes='print<loop-cache-cost>' -disable-output 2>&1 | FileCheck %s
3 target datalayout = "e-m:e-i64:64-n32:64"
4 target triple = "powerpc64le-unknown-linux-gnu"
6 ; Check IndexedReference::computeRefCost can handle type differences between
9 ; CHECK: Loop 'for.cond' has cost = 64
11 %struct._Handleitem = type { %struct._Handleitem* }
13 define void @handle_to_ptr(%struct._Handleitem** %blocks) {
19 for.cond: ; preds = %for.body, %entry
20 %i.0 = phi i32 [ 1, %entry ], [ %inc, %for.body ]
21 %cmp = icmp ult i32 %i.0, 1024
22 br i1 %cmp, label %for.body, label %for.end
24 for.body: ; preds = %for.cond
25 %idxprom = zext i32 %i.0 to i64
26 %arrayidx = getelementptr inbounds %struct._Handleitem*, %struct._Handleitem** %blocks, i64 %idxprom
27 store %struct._Handleitem* null, %struct._Handleitem** %arrayidx, align 8
28 %inc = add nuw nsw i32 %i.0, 1
32 for.end: ; preds = %for.cond