• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -start-after=machine-sink -stop-after=peephole-opt -mtriple=powerpc64-unknown-linux-gnu -o - %s | FileCheck %s
2
3--- |
4  ; ModuleID = '<stdin>'
5  source_filename = "<stdin>"
6  target datalayout = "E-m:e-i64:64-n32:64"
7  target triple = "powerpc64-unknown-linux-gnu"
8
9  ; Function Attrs: nounwind readnone
10  declare i128 @llvm.cttz.i128(i128, i1) #0
11
12  define void @fn1(i128, i128, i1) {
13  top:
14    br label %loop
15
16  loop:                                             ; preds = %loop, %top
17    %v = phi i128 [ %3, %loop ], [ %0, %top ]
18    %u = phi i128 [ %3, %loop ], [ %1, %top ]
19    %s = sub i128 %v, %u
20    %3 = call i128 @llvm.cttz.i128(i128 %s, i1 false)
21    br label %loop
22  }
23
24  ; Function Attrs: nounwind
25  declare void @llvm.stackprotector(i8*, i8**) #1
26
27  attributes #0 = { nounwind readnone }
28  attributes #1 = { nounwind }
29
30...
31---
32name:            fn1
33alignment:       2
34exposesReturnsTwice: false
35hasInlineAsm:    false
36allVRegsAllocated: false
37isSSA:           true
38tracksRegLiveness: true
39tracksSubRegLiveness: false
40registers:
41  - { id: 0, class: g8rc }
42  - { id: 1, class: g8rc }
43  - { id: 2, class: g8rc }
44  - { id: 3, class: g8rc }
45  - { id: 4, class: g8rc }
46  - { id: 5, class: g8rc }
47  - { id: 6, class: g8rc }
48  - { id: 7, class: g8rc }
49  - { id: 8, class: g8rc }
50  - { id: 9, class: g8rc }
51  - { id: 10, class: g8rc }
52  - { id: 11, class: g8rc }
53  - { id: 12, class: g8rc }
54  - { id: 13, class: g8rc }
55  - { id: 14, class: g8rc }
56  - { id: 15, class: g8rc_and_g8rc_nox0 }
57  - { id: 16, class: g8rc_and_g8rc_nox0 }
58  - { id: 17, class: g8rc }
59  - { id: 18, class: g8rc }
60  - { id: 19, class: g8rc }
61  - { id: 20, class: g8rc }
62  - { id: 21, class: g8rc }
63  - { id: 22, class: g8rc }
64  - { id: 23, class: g8rc }
65  - { id: 24, class: g8rc }
66  - { id: 25, class: crrc }
67  - { id: 26, class: g8rc_and_g8rc_nox0 }
68  - { id: 27, class: g8rc_and_g8rc_nox0 }
69liveins:
70  - { reg: '%x3', virtual-reg: '%6' }
71  - { reg: '%x4', virtual-reg: '%7' }
72  - { reg: '%x5', virtual-reg: '%8' }
73  - { reg: '%x6', virtual-reg: '%9' }
74frameInfo:
75  isFrameAddressTaken: false
76  isReturnAddressTaken: false
77  hasStackMap:     false
78  hasPatchPoint:   false
79  stackSize:       0
80  offsetAdjustment: 0
81  maxAlignment:    0
82  adjustsStack:    false
83  hasCalls:        false
84  maxCallFrameSize: 0
85  hasOpaqueSPAdjustment: false
86  hasVAStart:      false
87  hasMustTailInVarArgFunc: false
88body:             |
89  bb.0.top:
90    successors: %bb.1.loop
91    liveins: %x3, %x4, %x5, %x6
92
93    %9 = COPY %x6
94    %8 = COPY %x5
95    %7 = COPY %x4
96    %6 = COPY %x3
97    %14 = COPY %9
98    %13 = COPY %8
99    %12 = COPY %7
100    %11 = COPY %6
101    %21 = LI8 128
102    %23 = LI8 64
103
104  bb.1.loop:
105    successors: %bb.2.loop, %bb.4
106
107    %0 = PHI %11, %bb.0.top, %4, %bb.3.loop
108    %1 = PHI %12, %bb.0.top, %5, %bb.3.loop
109    %2 = PHI %13, %bb.0.top, %4, %bb.3.loop
110    %3 = PHI %14, %bb.0.top, %5, %bb.3.loop
111    %15 = SUBFC8 %3, %1, implicit-def %carry
112    %16 = SUBFE8 %2, %0, implicit-def dead %carry, implicit %carry
113    %17 = ADDI8 %16, -1
114    %18 = ADDI8 %15, -1
115    %19 = ANDC8 killed %17, %16
116    %20 = ANDC8 killed %18, %15
117    %22 = CNTLZD killed %19
118    %24 = CNTLZD killed %20
119    %25 = CMPLDI %15, 0
120    BCC 76, %25, %bb.2.loop
121    ; CHECK: SUBFC8o %3, %1, implicit-def %carry, implicit-def %cr0
122    ; CHECK: COPY killed %cr0
123    ; CHECK: BCC
124
125  bb.4:
126    successors: %bb.3.loop
127
128    %27 = SUBF8 %24, %23
129    B %bb.3.loop
130
131  bb.2.loop:
132    successors: %bb.3.loop
133
134    %26 = SUBF8 %22, %21
135
136  bb.3.loop:
137    successors: %bb.1.loop
138
139    %5 = PHI %26, %bb.2.loop, %27, %bb.4
140    %4 = LI8 0
141    B %bb.1.loop
142
143...
144