1 # RUN: llc -mtriple=powerpc64le-unknown-unknown -start-before ppc-pre-emit-peephole \
2 # RUN: -verify-machineinstrs -ppc-asm-full-reg-names %s -o - | FileCheck %s
5 source_filename = "t.ll"
6 target datalayout = "e-m:e-i64:64-n32:64"
8 define signext i32 @test(i32 signext %a, i32 signext %b, i32 signext %c) {
10 %cmp = icmp slt i32 %a, %b
11 br i1 %cmp, label %return, label %if.end
13 if.end: ; preds = %entry
14 %cmp1 = icmp slt i32 %b, %a
15 br i1 %cmp1, label %return, label %if.end3
17 if.end3: ; preds = %if.end
18 %cmp4 = icmp eq i32 %a, %c
19 br i1 %cmp4, label %if.then5, label %if.end6
21 if.then5: ; preds = %if.end3
22 %add = shl nsw i32 %a, 1
25 if.end6: ; preds = %if.end3
26 %cmp7 = icmp sgt i32 %c, %b
27 %add11 = add i32 %c, %b
28 %add12 = select i1 %cmp7, i32 %a, i32 0
29 %spec.select = add i32 %add11, %add12
32 return: ; preds = %if.then5, %if.end, %entry
33 %retval.0 = phi i32 [ %add, %if.then5 ], [ %c, %entry ], [ %b, %if.end ]
41 exposesReturnsTwice: false
43 regBankSelected: false
46 tracksRegLiveness: true
49 - { reg: '$x3', virtual-reg: '' }
50 - { reg: '$x4', virtual-reg: '' }
51 - { reg: '$x5', virtual-reg: '' }
53 isFrameAddressTaken: false
54 isReturnAddressTaken: false
64 hasOpaqueSPAdjustment: false
66 hasMustTailInVarArgFunc: false
75 successors: %bb.4(0x40000000), %bb.1(0x40000000)
76 liveins: $x3, $x4, $x5
78 renamable $cr0 = CMPW renamable $r3, renamable $r4
79 BCC 12, renamable $cr0, %bb.4
82 successors: %bb.6(0x40000000), %bb.2(0x40000000)
83 liveins: $cr0, $x3, $x4, $x5
85 BCC 36, killed renamable $cr0, %bb.2
91 ; CHECK-NOT: mr r5, r5
93 $r5 = OR killed $r4, $r4, implicit $x4, implicit-def $x5
94 $r5 = OR $r5, $r5, implicit-def $x5
95 renamable $x3 = EXTSW_32_64 killed renamable $r5, implicit $x5
96 BLR8 implicit $lr8, implicit $rm, implicit killed $x3
99 successors: %bb.3(0x40000000), %bb.5(0x40000000)
100 liveins: $x3, $x4, $x5
102 renamable $cr0 = CMPLW renamable $r3, renamable $r5
103 BCC 68, killed renamable $cr0, %bb.5
106 successors: %bb.4(0x80000000)
109 renamable $r5 = RLWINM killed renamable $r3, 1, 0, 30, implicit $x3, implicit-def $x5
114 renamable $x3 = EXTSW_32_64 killed renamable $r5, implicit $x5
115 BLR8 implicit $lr8, implicit $rm, implicit killed $x3
118 liveins: $x3, $x4, $x5
120 renamable $cr0 = CMPW renamable $r5, renamable $r4
122 renamable $r4 = ADD4 killed renamable $r5, killed renamable $r4, implicit $x4, implicit $x5
123 renamable $r3 = ISEL killed renamable $r3, killed renamable $r6, killed renamable $cr0gt, implicit $cr0, implicit $x3
124 renamable $r3 = ADD4 killed renamable $r4, killed renamable $r3
125 renamable $x3 = EXTSW_32_64 killed renamable $r3
126 BLR8 implicit $lr8, implicit $rm, implicit killed $x3