33 lines · plain
1; RUN: opt -S -passes=loop-vectorize -force-vector-width=2 -force-vector-interleave=1 < %s | FileCheck %s2 3target 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-S128"4 5; Make sure we can vectorize loops with functions to math library functions.6; They might read the rounding mode but we are only vectorizing loops that7; contain a limited set of function calls and none of them sets the rounding8; mode, so vectorizing them is safe.9 10; CHECK-LABEL: @test(11; CHECK: <2 x double>12 13define void @test(ptr %d, double %t) {14entry:15 br label %for.body16 17for.body:18 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]19 %arrayidx = getelementptr inbounds double, ptr %d, i64 %indvars.iv20 %0 = load double, ptr %arrayidx, align 821 %1 = tail call double @llvm.pow.f64(double %0, double %t)22 store double %1, ptr %arrayidx, align 823 %indvars.iv.next = add i64 %indvars.iv, 124 %lftr.wideiv = trunc i64 %indvars.iv.next to i3225 %exitcond = icmp ne i32 %lftr.wideiv, 12826 br i1 %exitcond, label %for.body, label %for.end27 28for.end:29 ret void30}31 32declare double @llvm.pow.f64(double, double)33