1 ; RUN: llc -verify-machineinstrs <%s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-n32:64"
3 target triple = "powerpc64le-unknown-linux-gnu"
5 ; Ensure that that the CTRLoop pass can compile intrinsics with
6 ; non-simple arguments. eg: @llvm.sqrt.v16f64.
8 ; Function Attrs: nounwind
9 define void @filter_prewitt() {
10 ; CHECK-LABEL: filter_prewitt:
14 vector.body: ; preds = %vector.body, %entry
15 %wide.load = load <16 x i8>, <16 x i8>* undef, align 1, !tbaa !1, !alias.scope !4
16 %0 = zext <16 x i8> %wide.load to <16 x i32>
17 %wide.load279 = load <16 x i8>, <16 x i8>* undef, align 1, !tbaa !1, !alias.scope !4
18 %1 = zext <16 x i8> %wide.load279 to <16 x i32>
19 %2 = add nuw nsw <16 x i32> %1, %0
20 %3 = add nuw nsw <16 x i32> %2, zeroinitializer
21 %4 = sub nsw <16 x i32> zeroinitializer, %3
22 %5 = add nsw <16 x i32> %4, zeroinitializer
23 %6 = add nsw <16 x i32> %5, zeroinitializer
24 %7 = sub nsw <16 x i32> zeroinitializer, %0
25 %8 = sub nsw <16 x i32> %7, zeroinitializer
26 %9 = add nsw <16 x i32> %8, zeroinitializer
27 %10 = sub nsw <16 x i32> %9, zeroinitializer
28 %11 = add nsw <16 x i32> %10, zeroinitializer
29 %12 = mul nsw <16 x i32> %6, %6
30 %13 = mul nsw <16 x i32> %11, %11
31 %14 = add nuw nsw <16 x i32> %13, %12
32 %15 = sitofp <16 x i32> %14 to <16 x double>
33 %16 = call nsz <16 x double> @llvm.sqrt.v16f64(<16 x double> %15)
34 %17 = fmul nsz <16 x double> %16, undef
35 %18 = fadd nsz <16 x double> %17, undef
36 %19 = fptosi <16 x double> %18 to <16 x i32>
37 %20 = sub nsw <16 x i32> zeroinitializer, %19
38 %21 = ashr <16 x i32> %20, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
39 %22 = select <16 x i1> undef, <16 x i32> %21, <16 x i32> %19
40 %23 = trunc <16 x i32> %22 to <16 x i8>
41 store <16 x i8> %23, <16 x i8>* undef, align 1, !tbaa !1, !alias.scope !7, !noalias !9
45 ; Function Attrs: nounwind readnone speculatable
46 declare <16 x double> @llvm.sqrt.v16f64(<16 x double>) #1
48 attributes #1 = { nounwind readnone speculatable }
51 !2 = !{!"omnipotent char", !3, i64 0}
52 !3 = !{!"Simple C/C++ TBAA"}
54 !5 = distinct !{!5, !6}
55 !6 = distinct !{!6, !"LVerDomain"}
57 !8 = distinct !{!8, !6}
59 !10 = distinct !{!10, !6}
60 !11 = distinct !{!11, !6}