30 lines · plain
1; RUN: opt -mtriple=s390x-unknown-linux -mcpu=z13 -passes=loop-vectorize \2; RUN: -force-vector-width=2 -debug-only=loop-vectorize \3; RUN: -disable-output < %s 2>&1 | FileCheck %s4; REQUIRES: asserts5;6; Check that a scalarized load does not get operands scalarization costs added.7 8define void @fun(ptr %data, i64 %n, i64 %s, ptr %Src) {9entry:10 br label %for.body11 12for.body:13 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]14 %mul = mul nsw i64 %iv, %s15 %gep.src = getelementptr inbounds double, ptr %Src, i64 %mul16 %bct = bitcast ptr %gep.src to ptr17 %ld = load i64, ptr %bct18 %gep.data = getelementptr inbounds i64, ptr %data, i64 %iv19 store i64 %ld, ptr %gep.data20 %iv.next = add nuw nsw i64 %iv, 121 %cmp110.us = icmp slt i64 %iv.next, %n22 br i1 %cmp110.us, label %for.body, label %for.end23 24for.end:25 ret void26 27; CHECK: LV: Found an estimated cost of 2 for VF 2 For instruction: %mul = mul nsw i64 %iv, %s28; CHECK: LV: Found an estimated cost of 2 for VF 2 For instruction: %ld = load i64, ptr %bct29}30