1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -verify-machineinstrs -enable-ppc-branch-coalesce < %s | FileCheck %s
3 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64-unknown-linux-gnu -verify-machineinstrs -enable-ppc-branch-coalesce < %s | FileCheck %s
4 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-NOCOALESCE %s
5 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64-unknown-linux-gnu -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-NOCOALESCE %s
7 ; Function Attrs: nounwind
8 define double @testBranchCoal(double %a, double %b, double %c, i32 %x) {
9 ; CHECK-LABEL: testBranchCoal:
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: cmplwi 6, 0
12 ; CHECK-NEXT: beq 0, .LBB0_2
13 ; CHECK-NEXT: # %bb.1: # %entry
14 ; CHECK-NEXT: addis 3, 2, .LCPI0_0@toc@ha
15 ; CHECK-NEXT: addis 4, 2, .LCPI0_1@toc@ha
16 ; CHECK-NEXT: xxlxor 2, 2, 2
17 ; CHECK-NEXT: lfd 1, .LCPI0_0@toc@l(3)
18 ; CHECK-NEXT: lfd 3, .LCPI0_1@toc@l(4)
19 ; CHECK-NEXT: .LBB0_2: # %entry
20 ; CHECK-NEXT: xsadddp 0, 1, 2
21 ; CHECK-NEXT: xsadddp 1, 0, 3
24 ; CHECK-NOCOALESCE-LABEL: testBranchCoal:
25 ; CHECK-NOCOALESCE: # %bb.0: # %entry
26 ; CHECK-NOCOALESCE-NEXT: cmplwi 6, 0
27 ; CHECK-NOCOALESCE-NEXT: bne 0, .LBB0_5
28 ; CHECK-NOCOALESCE-NEXT: # %bb.1: # %entry
29 ; CHECK-NOCOALESCE-NEXT: bne 0, .LBB0_6
30 ; CHECK-NOCOALESCE-NEXT: .LBB0_2: # %entry
31 ; CHECK-NOCOALESCE-NEXT: beq 0, .LBB0_4
32 ; CHECK-NOCOALESCE-NEXT: .LBB0_3: # %entry
33 ; CHECK-NOCOALESCE-NEXT: addis 3, 2, .LCPI0_1@toc@ha
34 ; CHECK-NOCOALESCE-NEXT: lfd 3, .LCPI0_1@toc@l(3)
35 ; CHECK-NOCOALESCE-NEXT: .LBB0_4: # %entry
36 ; CHECK-NOCOALESCE-NEXT: xsadddp 0, 1, 2
37 ; CHECK-NOCOALESCE-NEXT: xsadddp 1, 0, 3
38 ; CHECK-NOCOALESCE-NEXT: blr
39 ; CHECK-NOCOALESCE-NEXT: .LBB0_5: # %entry
40 ; CHECK-NOCOALESCE-NEXT: addis 3, 2, .LCPI0_0@toc@ha
41 ; CHECK-NOCOALESCE-NEXT: lfd 1, .LCPI0_0@toc@l(3)
42 ; CHECK-NOCOALESCE-NEXT: beq 0, .LBB0_2
43 ; CHECK-NOCOALESCE-NEXT: .LBB0_6: # %entry
44 ; CHECK-NOCOALESCE-NEXT: xxlxor 2, 2, 2
45 ; CHECK-NOCOALESCE-NEXT: bne 0, .LBB0_3
46 ; CHECK-NOCOALESCE-NEXT: b .LBB0_4
50 %test = icmp eq i32 %x, 0
51 %tmp1 = select i1 %test, double %a, double 2.000000e-03
52 %tmp2 = select i1 %test, double %b, double 0.000000e+00
53 %tmp3 = select i1 %test, double %c, double 5.000000e-03
55 %res1 = fadd double %tmp1, %tmp2
56 %result = fadd double %res1, %tmp3