• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple powerpc64le-unknown-linux-gnu %s -o - 2>&1 \
2# RUN:   -run-pass=livevars,phi-node-elimination -verify-machineinstrs | \
3# RUN:  FileCheck %s
4
5--- |
6  ; Function Attrs: noreturn nounwind
7  define signext i32 @zext_free(i8** nocapture dereferenceable(8) %p) {
8  entry:
9    %.pre = load i8*, i8** %p, align 8
10    br label %loop
11
12  loop:                                             ; preds = %loop, %if.then3, %entry
13    %0 = phi i8* [ %.pre, %entry ], [ %incdec.ptr4, %if.then3 ], [ %incdec.ptr, %loop ]
14    %1 = load i8, i8* %0, align 1
15    %tobool = icmp eq i8 %1, 0
16    %incdec.ptr = getelementptr inbounds i8, i8* %0, i64 1
17    store i8* %incdec.ptr, i8** %p, align 8
18    %2 = load i8, i8* %incdec.ptr, align 1
19    %tobool2 = icmp ne i8 %2, 0
20    %or.cond = and i1 %tobool, %tobool2
21    br i1 %or.cond, label %if.then3, label %loop
22
23  if.then3:                                         ; preds = %loop
24    %incdec.ptr4 = getelementptr inbounds i8, i8* %0, i64 2
25    store i8* %incdec.ptr4, i8** %p, align 8
26    br label %loop
27  }
28
29
30...
31---
32name:            zext_free
33tracksRegLiveness: true
34registers:
35  - { id: 0, class: g8rc, preferred-register: '' }
36  - { id: 1, class: g8rc_and_g8rc_nox0, preferred-register: '' }
37  - { id: 2, class: g8rc, preferred-register: '' }
38  - { id: 3, class: g8rc, preferred-register: '' }
39  - { id: 4, class: g8rc_and_g8rc_nox0, preferred-register: '' }
40  - { id: 5, class: gprc, preferred-register: '' }
41  - { id: 6, class: crrc, preferred-register: '' }
42  - { id: 7, class: crbitrc, preferred-register: '' }
43  - { id: 8, class: gprc, preferred-register: '' }
44  - { id: 9, class: crrc, preferred-register: '' }
45  - { id: 10, class: crbitrc, preferred-register: '' }
46  - { id: 11, class: crbitrc, preferred-register: '' }
47liveins:
48  - { reg: '$x3', virtual-reg: '%4' }
49body:             |
50  bb.0.entry:
51    successors: %bb.1(0x80000000)
52    liveins: $x3
53
54    %4:g8rc_and_g8rc_nox0 = COPY killed $x3
55    %0:g8rc = LD 0, %4 :: (dereferenceable load 8 from %ir.p)
56
57  bb.1.loop:
58    successors: %bb.1(0x20000000), %bb.2(0x60000000)
59
60    %1:g8rc_and_g8rc_nox0 = PHI %0, %bb.0, %2, %bb.1, %3, %bb.3, %2, %bb.2
61    %5:gprc = LBZ 0, %1 :: (load 1 from %ir.0)
62    %6:crrc = CMPWI killed %5, 0
63    %7:crbitrc = COPY killed %6.sub_eq
64    %2:g8rc = nuw ADDI8 %1, 1
65    STD %2, 0, %4 :: (store 8 into %ir.p)
66    %8:gprc = LBZ 1, %1 :: (load 1 from %ir.incdec.ptr)
67    BCn killed %7, %bb.1
68    B %bb.2
69
70  bb.2.loop:
71    successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
72
73    %9:crrc = CMPWI killed %8, 0
74    %10:crbitrc = COPY killed %9.sub_eq
75    BC killed %10, %bb.1
76    B %bb.3
77
78  bb.3.if.then3:
79    successors: %bb.1(0x80000000)
80
81    %3:g8rc = nuw ADDI8 killed %1, 2
82    STD %3, 0, %4 :: (store 8 into %ir.p)
83    B %bb.1
84
85  ; CHECK-LABEL: name: zext_free
86  ; CHECK: bb.0.entry:
87  ; CHECK:   successors: %bb.1(0x80000000)
88  ; CHECK:   liveins: $x3
89
90  ; CHECK:   %4:g8rc_and_g8rc_nox0 = COPY killed $x3
91  ; CHECK:   %0:g8rc = LD 0, %4 :: (dereferenceable load 8 from %ir.p)
92  ; CHECK:    %12:g8rc_and_g8rc_nox0 = COPY killed %0
93
94  ; CHECK: bb.1.loop:
95  ; CHECK:   successors: %bb.1(0x20000000), %bb.2(0x60000000)
96
97  ; CHECK:   %1:g8rc_and_g8rc_nox0 = COPY killed %12
98  ; CHECK:   %5:gprc = LBZ 0, %1 :: (load 1 from %ir.0)
99  ; CHECK:   %6:crrc = CMPWI killed %5, 0
100  ; CHEXK:   %7:crbitrc = COPY killed %6.sub_eq
101  ; CHECK:   %2:g8rc = nuw ADDI8 %1, 1
102  ; CHECK:   STD %2, 0, %4 :: (store 8 into %ir.p)
103  ; CHECK:   %8:gprc = LBZ 1, %1 :: (load 1 from %ir.incdec.ptr)
104  ; CHECK:   %12:g8rc_and_g8rc_nox0 = COPY %2
105  ; CHECK:   BCn killed %7, %bb.1
106  ; CHECK:   B %bb.2
107
108  ; CHECK: bb.2.loop:
109  ; CHECK:   successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
110
111  ; CHECK:   %9:crrc = CMPWI killed %8, 0
112  ; CHECK:   %10:crbitrc = COPY killed %9.sub_eq
113  ; CHECK:   %12:g8rc_and_g8rc_nox0 = COPY killed %2
114  ; CHECK:   BC killed %10, %bb.1
115  ; CHECK:   B %bb.3
116
117  ; CHECK: bb.3.if.then3:
118  ; CHECK:   successors: %bb.1(0x80000000)
119
120  ; CHECK:   %3:g8rc = nuw ADDI8 killed %1, 2
121  ; CHECK:   STD %3, 0, %4 :: (store 8 into %ir.p)
122  ; CHECK:   %12:g8rc_and_g8rc_nox0 = COPY killed %3
123  ; CHECK:   B %bb.1
124
125
126...
127
128