xref: /llvm-project/llvm/test/CodeGen/PowerPC/ppc64-xxsplti32dx-pattern-check.ll (revision 5403c59c608c08c8ecd4303763f08eb046eb5e4d)
1; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-- \
2; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s
3; RUN: llc -verify-machineinstrs -mtriple=powerpc64-- \
4; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s
5
6; CHECK-NOT: Impossible reg-to-reg copy
7; CHECK-LABEL: test_xxsplti32dx
8; CHECK:         xxsplti32dx
9
10;; Test reduced from larger application where bug was initially detected.
11;; This test checks that the correct register class is used for xxsplti32dx.
12
13declare dso_local void @callee() local_unnamed_addr
14
15define dso_local void @test_xxsplti32dx() local_unnamed_addr {
16entry:
17  %i1 = load double, ptr undef, align 8
18  br label %for.body124
19
20for.body124:
21  %E0 = phi double [ 0.000000e+00, %entry ], [ %E1, %for.end1072 ]
22  br i1 undef, label %for.body919.preheader, label %for.end1072
23
24for.body919.preheader:
25  %i4 = load double, ptr null, align 8
26  %i5 = load double, ptr null, align 8
27  %i15 = insertelement <2 x double> poison, double %i5, i32 0
28  %i23 = insertelement <2 x double> undef, double %i4, i32 1
29  %i24 = insertelement <2 x double> %i15, double 0x3FC5555555555555, i32 1
30  %i25 = fmul fast <2 x double> %i23, %i24
31  %mul986 = extractelement <2 x double> %i25, i32 1
32  %sub994 = fsub fast double %E0, %mul986
33  br label %for.end1072
34
35for.end1072:
36  %E1 = phi double [ %E0, %for.body124 ], [ %sub994, %for.body919.preheader ]
37  %i28 = phi <2 x double> [ zeroinitializer, %for.body124 ], [ %i15, %for.body919.preheader ]
38  tail call void @callee()
39  store <2 x double> %i28, ptr undef, align 8
40  br label %for.body124
41}
42