• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple=ppc32-- %s -run-pass=phi-node-elimination \
2# RUN:   -verify-machineinstrs -o /dev/null 2>&1
3# RUN: llc -mtriple=ppc32-- %s -start-before=phi-node-elimination \
4# RUN:   -verify-machineinstrs -o /dev/null 2>&1
5
6--- |
7  define void @VerifyTwoAddressCrash(i16 %div.0.i.i.i.i, i32 %L_num.0.i.i.i.i, i32 %tmp1.i.i206.i.i, i16* %P) {
8    %X = shl i16 %div.0.i.i.i.i, 1
9    %tmp28.i.i.i.i = shl i32 %L_num.0.i.i.i.i, 1
10    %tmp31.i.i.i.i = icmp slt i32 %tmp28.i.i.i.i, %tmp1.i.i206.i.i
11    %tmp31.i.i.i.i.upgrd.1 = zext i1 %tmp31.i.i.i.i to i16
12    %tmp371.i.i.i.i1 = or i16 %tmp31.i.i.i.i.upgrd.1, %X
13    %div.0.be.i.i.i.i = xor i16 %tmp371.i.i.i.i1, 1
14    store i16 %div.0.be.i.i.i.i, i16* %P, align 2
15    ret void
16  }
17
18...
19---
20name:            VerifyTwoAddressCrash
21alignment:       4
22exposesReturnsTwice: false
23legalized:       false
24regBankSelected: false
25selected:        false
26failedISel:      false
27tracksRegLiveness: true
28hasWinCFI:       false
29registers:
30  - { id: 0, class: gprc, preferred-register: '' }
31  - { id: 1, class: gprc, preferred-register: '' }
32  - { id: 2, class: gprc, preferred-register: '' }
33  - { id: 3, class: gprc_and_gprc_nor0, preferred-register: '' }
34  - { id: 4, class: gprc, preferred-register: '' }
35  - { id: 5, class: crrc, preferred-register: '' }
36  - { id: 6, class: crbitrc, preferred-register: '' }
37  - { id: 7, class: gprc_and_gprc_nor0, preferred-register: '' }
38  - { id: 8, class: gprc_and_gprc_nor0, preferred-register: '' }
39  - { id: 9, class: gprc, preferred-register: '' }
40  - { id: 10, class: gprc, preferred-register: '' }
41  - { id: 11, class: gprc, preferred-register: '' }
42liveins:
43  - { reg: '$r3', virtual-reg: '%0' }
44  - { reg: '$r4', virtual-reg: '%1' }
45  - { reg: '$r5', virtual-reg: '%2' }
46  - { reg: '$r6', virtual-reg: '%3' }
47frameInfo:
48  isFrameAddressTaken: false
49  isReturnAddressTaken: false
50  hasStackMap:     false
51  hasPatchPoint:   false
52  stackSize:       0
53  offsetAdjustment: 0
54  maxAlignment:    4
55  adjustsStack:    false
56  hasCalls:        false
57  stackProtector:  ''
58  maxCallFrameSize: 4294967295
59  cvBytesOfCalleeSavedRegisters: 0
60  hasOpaqueSPAdjustment: false
61  hasVAStart:      false
62  hasMustTailInVarArgFunc: false
63  localFrameSize:  0
64  savePoint:       ''
65  restorePoint:    ''
66fixedStack:      []
67stack:           []
68callSites:       []
69constants:       []
70machineFunctionInfo: {}
71body:             |
72  bb.0 (%ir-block.0):
73    liveins: $r3, $r4, $r5, $r6
74
75    %3:gprc_and_gprc_nor0 = COPY killed $r6
76    %2:gprc = COPY killed $r5
77    %1:gprc = COPY killed $r4
78    %0:gprc = COPY killed $r3
79    %4:gprc = RLWINM killed %1, 1, 0, 30
80    %5:crrc = CMPW killed %4, killed %2
81    %6:crbitrc = COPY killed %5.sub_lt
82    %7:gprc_and_gprc_nor0 = LI 0
83    %8:gprc_and_gprc_nor0 = LI 1
84    %9:gprc = ISEL killed %8, killed %7, killed %6
85    %10:gprc = RLWIMI killed %9, killed %0, 1, 0, 30
86    %11:gprc = XORI killed %10, 1
87    STH killed %11, 0, killed %3 :: (store 2 into %ir.P)
88    BLR implicit $lr, implicit $rm
89
90...
91
92# Used to result in
93#
94# Bad machine code: Two-address instruction operands must be identical
95# - function:    VerifyTwoAddressCrash
96# - basic block: %bb.0
97# - instruction: %10:gprc = RLWIMI killed %9:gprc(tied-def 0), killed %0:gprc, 1, 0, 30
98# - operand 1:   killed %9:gprc(tied-def 0)
99# LLVM ERROR: Found 1 machine code errors.
100# Just verify that we do not crash (or get verifier error).
101