• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -run-pass x86-fixup-LEAs -mtriple=x86_64-gnu-unknown -verify-machineinstrs -mcpu=corei7-avx -o - %s | FileCheck %s
3--- |
4  ; ModuleID = 'lea-2.ll'
5  source_filename = "lea-2.ll"
6  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7  ;generated using: llc -stop-after x86-pad-short-functions lea-2.ll > leaFinxup64.mir
8
9  ;testleaadd_64_32_1: 3 operands LEA64_32r cannot be replaced with 2 add instructions
10  ; but can be replaced with 1 lea + 1 add
11  define i32 @testleaadd_64_32_1() {
12    ret i32 0
13  }
14
15  ;testleaadd_rbp_64_32_1: 3 operands LEA64_32r cannot be replaced with 2 add instructions
16  ; where the base is rbp/r13/ebp register but it can be replaced with 1 lea + 1 add
17  define i32 @testleaadd_rbp_64_32_1() {
18    ret i32 0
19  }
20
21  ;test1lea_rbp_64_32_1: 2 operands LEA64_32r where base register is rbp/r13/ebp and can not
22  ; be replaced with an add instruction but can be replaced with 1 lea instruction
23  define i32 @test1lea_rbp_64_32_1() {
24    ret i32 0
25  }
26
27  ;test2add_64: 3 operands LEA64r that can be replaced with 2 add instructions
28  define i32 @test2add_64() {
29    ret i32 0
30  }
31
32  ;test2add_rbp_64: 3 operands LEA64r that can be replaced with 2 add instructions
33  ; where the base is rbp/r13/ebp register
34  define i32 @test2add_rbp_64() {
35    ret i32 0
36  }
37
38  ;test1add_rbp_64: 2 operands LEA64r where base register is rbp/r13/ebp and can be replaced
39  ; with an add instruction
40  define i32 @test1add_rbp_64() {
41    ret i32 0
42  }
43
44  ;testleaadd_64_32: 3 operands LEA64_32r that can be replaced with 1 lea 1 add instructions
45  define i32 @testleaadd_64_32() {
46    ret i32 0
47  }
48
49  ;testleaadd_rbp_64_32: 3 operands LEA64_32r that can be replaced with 1 lea 1 add instructions
50  ; where the base is rbp/r13/ebp register
51  define i32 @testleaadd_rbp_64_32() {
52    ret i32 0
53  }
54
55  ;test1lea_rbp_64_32: 2 operands LEA64_32r where base register is rbp/r13/ebp and can be replaced
56  ; with a lea instruction
57  define i32 @test1lea_rbp_64_32() {
58    ret i32 0
59  }
60
61  ;testleaadd_64: 3 operands LEA64r that can be replaced with 1 lea 1 add instructions
62  define i32 @testleaadd_64() {
63    ret i32 0
64  }
65
66  ;testleaadd_rbp_64: 3 operands LEA64r that can be replaced with 1 lea 1 add instructions
67  ; where the base is rbp/r13/ebp register
68  define i32 @testleaadd_rbp_64() {
69    ret i32 0
70  }
71
72  ;test1lea_rbp_64: 2 operands LEA64r wher base register is rbp/r13/ebp and can be replaced
73  ; with a lea instruction
74  define i32 @test1lea_rbp_64() {
75    ret i32 0
76  }
77
78  ;test8: dst = base & scale!=1, can't optimize
79  define i32 @test8() {
80      ret i32 0
81  }
82
83  ;testleaaddi32_64_32: 3 operands LEA64_32r that can be replaced with 1 lea + 1 add instructions where
84  ; ADD64ri32 is chosen
85  define i32 @testleaaddi32_64_32() {
86    ret i32 0
87  }
88
89  ;test1mov1add_rbp_64_32: 2 operands LEA64_32r cannot be replaced with 1 add 1 mov instructions
90  ; where the base is rbp/r13/ebp register
91  define i32 @test1mov1add_rbp_64_32() {
92    ret i32 0
93  }
94
95  ;testleaadd_rbp_index_64_32: 3 operands LEA64_32r that cannot replaced with 1 lea 1 add instructions
96  ; where the base and the index are ebp register and there is offset
97  define i32 @testleaadd_rbp_index_64_32() {
98    ret i32 0
99  }
100
101  ;testleaadd_rbp_index2_64_32: 3 operands LEA64_32r that cannot replaced with 1 lea 1 add instructions
102  ; where the base and the index are ebp register and there is scale
103  define i32 @testleaadd_rbp_index2_64_32() {
104    ret i32 0
105  }
106
107  ;test2addi32_64: 3 operands LEA64r that can be replaced with 2 add instructions where ADD64ri32
108  ; is chosen
109  define i32 @test2addi32_64() {
110    ret i32 0
111  }
112
113  ;test1mov1add_rbp_64: 2 operands LEA64r that can be replaced with 1 add 1 mov instructions
114  ; where the base is rbp/r13/ebp register
115  define i32 @test1mov1add_rbp_64() {
116    ret i32 0
117  }
118
119  ;testleaadd_rbp_index_64: 3 operands LEA64r that can be replaced with 1 lea 1 add instructions
120  ; where the base and the index are ebp register and there is offset
121  define i32 @testleaadd_rbp_index_64() {
122    ret i32 0
123  }
124
125  ;testleaadd_rbp_index2_64: 3 operands LEA64r that can be replaced with 1 lea 1 add instructions
126  ; where the base and the index are ebp register and there is scale
127  define i32 @testleaadd_rbp_index2_64() {
128    ret i32 0
129  }
130
131  ;test_skip_opt_64: 3 operands LEA64r that can not be replaced with 2 instructions
132  define i32 @test_skip_opt_64() {
133    ret i32 0
134  }
135
136  ;test_skip_eflags_64: LEA64r that cannot be replaced since its not safe to clobber eflags
137  define i32 @test_skip_eflags_64() {
138    ret i32 0
139  }
140
141  ;test_skip_opt_64_32: 3 operands LEA64_32r that can not be replaced with 2 instructions
142  define i32 @test_skip_opt_64_32() {
143    ret i32 0
144  }
145
146  ;test_skip_eflags_64_32: LEA64_32r that cannot be replaced since its not safe to clobber eflags
147  define i32 @test_skip_eflags_64_32() {
148    ret i32 0
149  }
150
151  define i32 @pr43758() {
152    ret i32 0
153  }
154
155
156...
157---
158name:            testleaadd_64_32_1
159alignment:       16
160exposesReturnsTwice: false
161legalized:       false
162regBankSelected: false
163selected:        false
164tracksRegLiveness: true
165liveins:
166  - { reg: '$rax' }
167  - { reg: '$rbp' }
168frameInfo:
169  isFrameAddressTaken: false
170  isReturnAddressTaken: false
171  hasStackMap:     false
172  hasPatchPoint:   false
173  stackSize:       0
174  offsetAdjustment: 0
175  maxAlignment:    0
176  adjustsStack:    false
177  hasCalls:        false
178  maxCallFrameSize: 0
179  hasOpaqueSPAdjustment: false
180  hasVAStart:      false
181  hasMustTailInVarArgFunc: false
182body:             |
183  bb.0 (%ir-block.0):
184    liveins: $rax, $rbp
185
186    ; CHECK-LABEL: name: testleaadd_64_32_1
187    ; CHECK: liveins: $rax, $rbp
188    ; CHECK: $eax = ADD32rr $eax, $ebp, implicit-def $eflags, implicit $rax, implicit $rbp
189    ; CHECK: $eax = ADD32ri8 $eax, -5, implicit-def $eflags
190    ; CHECK: RETQ $eax
191    $eax = LEA64_32r killed $rax, 1, killed $rbp, -5, $noreg
192    RETQ $eax
193
194...
195---
196name:            testleaadd_rbp_64_32_1
197alignment:       16
198exposesReturnsTwice: false
199legalized:       false
200regBankSelected: false
201selected:        false
202tracksRegLiveness: true
203liveins:
204  - { reg: '$rax' }
205  - { reg: '$rbp' }
206frameInfo:
207  isFrameAddressTaken: false
208  isReturnAddressTaken: false
209  hasStackMap:     false
210  hasPatchPoint:   false
211  stackSize:       0
212  offsetAdjustment: 0
213  maxAlignment:    0
214  adjustsStack:    false
215  hasCalls:        false
216  maxCallFrameSize: 0
217  hasOpaqueSPAdjustment: false
218  hasVAStart:      false
219  hasMustTailInVarArgFunc: false
220body:             |
221  bb.0 (%ir-block.0):
222    liveins: $rax, $rbp
223
224    ; CHECK-LABEL: name: testleaadd_rbp_64_32_1
225    ; CHECK: liveins: $rax, $rbp
226    ; CHECK: $ebp = ADD32rr $ebp, $eax, implicit-def $eflags, implicit $rbp, implicit $rax
227    ; CHECK: $ebp = ADD32ri8 $ebp, -5, implicit-def $eflags
228    ; CHECK: RETQ $ebp
229    $ebp = LEA64_32r killed $rbp, 1, killed $rax, -5, $noreg
230    RETQ $ebp
231
232...
233---
234name:            test1lea_rbp_64_32_1
235alignment:       16
236exposesReturnsTwice: false
237legalized:       false
238regBankSelected: false
239selected:        false
240tracksRegLiveness: true
241liveins:
242  - { reg: '$rax' }
243  - { reg: '$rbp' }
244frameInfo:
245  isFrameAddressTaken: false
246  isReturnAddressTaken: false
247  hasStackMap:     false
248  hasPatchPoint:   false
249  stackSize:       0
250  offsetAdjustment: 0
251  maxAlignment:    0
252  adjustsStack:    false
253  hasCalls:        false
254  maxCallFrameSize: 0
255  hasOpaqueSPAdjustment: false
256  hasVAStart:      false
257  hasMustTailInVarArgFunc: false
258body:             |
259  bb.0 (%ir-block.0):
260    liveins: $rax, $rbp
261
262    ; CHECK-LABEL: name: test1lea_rbp_64_32_1
263    ; CHECK: liveins: $rax, $rbp
264    ; CHECK: $ebp = ADD32rr $ebp, $eax, implicit-def $eflags, implicit $rbp, implicit $rax
265    ; CHECK: RETQ $ebp
266    $ebp = LEA64_32r killed $rbp, 1, killed $rax, 0, $noreg
267    RETQ $ebp
268
269...
270---
271name:            test2add_64
272alignment:       16
273exposesReturnsTwice: false
274legalized:       false
275regBankSelected: false
276selected:        false
277tracksRegLiveness: true
278liveins:
279  - { reg: '$rax' }
280  - { reg: '$rbp' }
281frameInfo:
282  isFrameAddressTaken: false
283  isReturnAddressTaken: false
284  hasStackMap:     false
285  hasPatchPoint:   false
286  stackSize:       0
287  offsetAdjustment: 0
288  maxAlignment:    0
289  adjustsStack:    false
290  hasCalls:        false
291  maxCallFrameSize: 0
292  hasOpaqueSPAdjustment: false
293  hasVAStart:      false
294  hasMustTailInVarArgFunc: false
295body:             |
296  bb.0 (%ir-block.0):
297    liveins: $rax, $rbp
298
299    ; CHECK-LABEL: name: test2add_64
300    ; CHECK: liveins: $rax, $rbp
301    ; CHECK: $rax = ADD64rr $rax, $rbp, implicit-def $eflags
302    ; CHECK: $rax = ADD64ri8 $rax, -5, implicit-def $eflags
303    ; CHECK: RETQ $eax
304    $rax = LEA64r killed $rax, 1, killed $rbp, -5, $noreg
305    RETQ $eax
306
307...
308---
309name:            test2add_rbp_64
310alignment:       16
311exposesReturnsTwice: false
312legalized:       false
313regBankSelected: false
314selected:        false
315tracksRegLiveness: true
316liveins:
317  - { reg: '$rax' }
318  - { reg: '$rbp' }
319frameInfo:
320  isFrameAddressTaken: false
321  isReturnAddressTaken: false
322  hasStackMap:     false
323  hasPatchPoint:   false
324  stackSize:       0
325  offsetAdjustment: 0
326  maxAlignment:    0
327  adjustsStack:    false
328  hasCalls:        false
329  maxCallFrameSize: 0
330  hasOpaqueSPAdjustment: false
331  hasVAStart:      false
332  hasMustTailInVarArgFunc: false
333body:             |
334  bb.0 (%ir-block.0):
335    liveins: $rax, $rbp
336
337    ; CHECK-LABEL: name: test2add_rbp_64
338    ; CHECK: liveins: $rax, $rbp
339    ; CHECK: $rbp = ADD64rr $rbp, $rax, implicit-def $eflags
340    ; CHECK: $rbp = ADD64ri8 $rbp, -5, implicit-def $eflags
341    ; CHECK: RETQ $ebp
342    $rbp = LEA64r killed $rbp, 1, killed $rax, -5, $noreg
343    RETQ $ebp
344
345...
346---
347name:            test1add_rbp_64
348alignment:       16
349exposesReturnsTwice: false
350legalized:       false
351regBankSelected: false
352selected:        false
353tracksRegLiveness: true
354liveins:
355  - { reg: '$rax' }
356  - { reg: '$rbp' }
357frameInfo:
358  isFrameAddressTaken: false
359  isReturnAddressTaken: false
360  hasStackMap:     false
361  hasPatchPoint:   false
362  stackSize:       0
363  offsetAdjustment: 0
364  maxAlignment:    0
365  adjustsStack:    false
366  hasCalls:        false
367  maxCallFrameSize: 0
368  hasOpaqueSPAdjustment: false
369  hasVAStart:      false
370  hasMustTailInVarArgFunc: false
371body:             |
372  bb.0 (%ir-block.0):
373    liveins: $rax, $rbp
374
375    ; CHECK-LABEL: name: test1add_rbp_64
376    ; CHECK: liveins: $rax, $rbp
377    ; CHECK: $rbp = ADD64rr $rbp, $rax, implicit-def $eflags
378    ; CHECK: RETQ $ebp
379    $rbp = LEA64r killed $rbp, 1, killed $rax, 0, $noreg
380    RETQ $ebp
381
382...
383---
384name:            testleaadd_64_32
385alignment:       16
386exposesReturnsTwice: false
387legalized:       false
388regBankSelected: false
389selected:        false
390tracksRegLiveness: true
391liveins:
392  - { reg: '$rax' }
393  - { reg: '$rbp' }
394  - { reg: '$rbx' }
395frameInfo:
396  isFrameAddressTaken: false
397  isReturnAddressTaken: false
398  hasStackMap:     false
399  hasPatchPoint:   false
400  stackSize:       0
401  offsetAdjustment: 0
402  maxAlignment:    0
403  adjustsStack:    false
404  hasCalls:        false
405  maxCallFrameSize: 0
406  hasOpaqueSPAdjustment: false
407  hasVAStart:      false
408  hasMustTailInVarArgFunc: false
409body:             |
410  bb.0 (%ir-block.0):
411    liveins: $rax, $rbp
412
413    ; CHECK-LABEL: name: testleaadd_64_32
414    ; CHECK: liveins: $rax, $rbp
415    ; CHECK: $ebx = LEA64_32r killed $rax, 1, killed $rbp, 0, $noreg
416    ; CHECK: $ebx = ADD32ri8 $ebx, -5, implicit-def $eflags
417    ; CHECK: RETQ $ebx
418    $ebx = LEA64_32r killed $rax, 1, killed $rbp, -5, $noreg
419    RETQ $ebx
420
421...
422---
423name:            testleaadd_rbp_64_32
424alignment:       16
425exposesReturnsTwice: false
426legalized:       false
427regBankSelected: false
428selected:        false
429tracksRegLiveness: true
430liveins:
431  - { reg: '$rax' }
432  - { reg: '$rbp' }
433  - { reg: '$rbx' }
434frameInfo:
435  isFrameAddressTaken: false
436  isReturnAddressTaken: false
437  hasStackMap:     false
438  hasPatchPoint:   false
439  stackSize:       0
440  offsetAdjustment: 0
441  maxAlignment:    0
442  adjustsStack:    false
443  hasCalls:        false
444  maxCallFrameSize: 0
445  hasOpaqueSPAdjustment: false
446  hasVAStart:      false
447  hasMustTailInVarArgFunc: false
448body:             |
449  bb.0 (%ir-block.0):
450    liveins: $rax, $rbp
451
452    ; CHECK-LABEL: name: testleaadd_rbp_64_32
453    ; CHECK: liveins: $rax, $rbp
454    ; CHECK: $ebx = LEA64_32r killed $rax, 1, killed $rbp, 0, $noreg
455    ; CHECK: $ebx = ADD32ri8 $ebx, -5, implicit-def $eflags
456    ; CHECK: RETQ $ebx
457    $ebx = LEA64_32r killed $rbp, 1, killed $rax, -5, $noreg
458    RETQ $ebx
459
460...
461---
462name:            test1lea_rbp_64_32
463alignment:       16
464exposesReturnsTwice: false
465legalized:       false
466regBankSelected: false
467selected:        false
468tracksRegLiveness: true
469liveins:
470  - { reg: '$rax' }
471  - { reg: '$rbp' }
472  - { reg: '$rbx' }
473frameInfo:
474  isFrameAddressTaken: false
475  isReturnAddressTaken: false
476  hasStackMap:     false
477  hasPatchPoint:   false
478  stackSize:       0
479  offsetAdjustment: 0
480  maxAlignment:    0
481  adjustsStack:    false
482  hasCalls:        false
483  maxCallFrameSize: 0
484  hasOpaqueSPAdjustment: false
485  hasVAStart:      false
486  hasMustTailInVarArgFunc: false
487body:             |
488  bb.0 (%ir-block.0):
489    liveins: $rax, $rbp
490
491    ; CHECK-LABEL: name: test1lea_rbp_64_32
492    ; CHECK: liveins: $rax, $rbp
493    ; CHECK: $ebx = LEA64_32r killed $rax, 1, killed $rbp, 0, $noreg
494    ; CHECK: RETQ $ebx
495    $ebx = LEA64_32r killed $rbp, 1, killed $rax, 0, $noreg
496    RETQ $ebx
497
498...
499---
500name:            testleaadd_64
501alignment:       16
502exposesReturnsTwice: false
503legalized:       false
504regBankSelected: false
505selected:        false
506tracksRegLiveness: true
507liveins:
508  - { reg: '$rax' }
509  - { reg: '$rbp' }
510  - { reg: '$rbx' }
511frameInfo:
512  isFrameAddressTaken: false
513  isReturnAddressTaken: false
514  hasStackMap:     false
515  hasPatchPoint:   false
516  stackSize:       0
517  offsetAdjustment: 0
518  maxAlignment:    0
519  adjustsStack:    false
520  hasCalls:        false
521  maxCallFrameSize: 0
522  hasOpaqueSPAdjustment: false
523  hasVAStart:      false
524  hasMustTailInVarArgFunc: false
525body:             |
526  bb.0 (%ir-block.0):
527    liveins: $rax, $rbp
528
529    ; CHECK-LABEL: name: testleaadd_64
530    ; CHECK: liveins: $rax, $rbp
531    ; CHECK: $rbx = LEA64r killed $rax, 1, killed $rbp, 0, $noreg
532    ; CHECK: $rbx = ADD64ri8 $rbx, -5, implicit-def $eflags
533    ; CHECK: RETQ $ebx
534    $rbx = LEA64r killed $rax, 1, killed $rbp, -5, $noreg
535    RETQ $ebx
536
537...
538---
539name:            testleaadd_rbp_64
540alignment:       16
541exposesReturnsTwice: false
542legalized:       false
543regBankSelected: false
544selected:        false
545tracksRegLiveness: true
546liveins:
547  - { reg: '$rax' }
548  - { reg: '$rbp' }
549  - { reg: '$rbx' }
550frameInfo:
551  isFrameAddressTaken: false
552  isReturnAddressTaken: false
553  hasStackMap:     false
554  hasPatchPoint:   false
555  stackSize:       0
556  offsetAdjustment: 0
557  maxAlignment:    0
558  adjustsStack:    false
559  hasCalls:        false
560  maxCallFrameSize: 0
561  hasOpaqueSPAdjustment: false
562  hasVAStart:      false
563  hasMustTailInVarArgFunc: false
564body:             |
565  bb.0 (%ir-block.0):
566    liveins: $rax, $rbp
567
568    ; CHECK-LABEL: name: testleaadd_rbp_64
569    ; CHECK: liveins: $rax, $rbp
570    ; CHECK: $rbx = LEA64r killed $rax, 1, killed $rbp, 0, $noreg
571    ; CHECK: $rbx = ADD64ri8 $rbx, -5, implicit-def $eflags
572    ; CHECK: RETQ $ebx
573    $rbx = LEA64r killed $rbp, 1, killed $rax, -5, $noreg
574    RETQ $ebx
575
576...
577---
578name:            test1lea_rbp_64
579alignment:       16
580exposesReturnsTwice: false
581legalized:       false
582regBankSelected: false
583selected:        false
584tracksRegLiveness: true
585liveins:
586  - { reg: '$rax' }
587  - { reg: '$rbp' }
588  - { reg: '$rbx' }
589frameInfo:
590  isFrameAddressTaken: false
591  isReturnAddressTaken: false
592  hasStackMap:     false
593  hasPatchPoint:   false
594  stackSize:       0
595  offsetAdjustment: 0
596  maxAlignment:    0
597  adjustsStack:    false
598  hasCalls:        false
599  maxCallFrameSize: 0
600  hasOpaqueSPAdjustment: false
601  hasVAStart:      false
602  hasMustTailInVarArgFunc: false
603body:             |
604  bb.0 (%ir-block.0):
605    liveins: $rax, $rbp
606
607    ; CHECK-LABEL: name: test1lea_rbp_64
608    ; CHECK: liveins: $rax, $rbp
609    ; CHECK: $rbx = LEA64r killed $rax, 1, killed $rbp, 0, $noreg
610    ; CHECK: RETQ $ebx
611    $rbx = LEA64r killed $rbp, 1, killed $rax, 0, $noreg
612    RETQ $ebx
613
614...
615---
616name:            test8
617alignment:       16
618exposesReturnsTwice: false
619legalized:       false
620regBankSelected: false
621selected:        false
622tracksRegLiveness: true
623liveins:
624  - { reg: '$rdi' }
625  - { reg: '$rbp' }
626frameInfo:
627  isFrameAddressTaken: false
628  isReturnAddressTaken: false
629  hasStackMap:     false
630  hasPatchPoint:   false
631  stackSize:       0
632  offsetAdjustment: 0
633  maxAlignment:    0
634  adjustsStack:    false
635  hasCalls:        false
636  maxCallFrameSize: 0
637  hasOpaqueSPAdjustment: false
638  hasVAStart:      false
639  hasMustTailInVarArgFunc: false
640body:             |
641  bb.0 (%ir-block.0):
642    liveins: $rdi, $rbp
643    ; CHECK-LABEL: name: test8
644    ; CHECK: liveins: $rdi, $rbp
645    ; CHECK: $rbp = KILL $rbp, implicit-def $rbp
646    ; CHECK: $r13 = KILL $rdi, implicit-def $r13
647    ; CHECK: $r12 = LEA64r $noreg, 2, killed $r13, 5, $noreg
648    ; CHECK: $r12 = ADD64rr $r12, killed $rbp, implicit-def $eflags
649    ; CHECK: RETQ $r12
650    $rbp = KILL $rbp, implicit-def $rbp
651    $r13 = KILL $rdi, implicit-def $r13
652    $r12 = LEA64r killed $rbp, 2, killed $r13, 5, $noreg
653    RETQ $r12
654
655...
656---
657name:            testleaaddi32_64_32
658alignment:       16
659exposesReturnsTwice: false
660legalized:       false
661regBankSelected: false
662selected:        false
663tracksRegLiveness: true
664liveins:
665  - { reg: '$rax' }
666  - { reg: '$rbp' }
667frameInfo:
668  isFrameAddressTaken: false
669  isReturnAddressTaken: false
670  hasStackMap:     false
671  hasPatchPoint:   false
672  stackSize:       0
673  offsetAdjustment: 0
674  maxAlignment:    0
675  adjustsStack:    false
676  hasCalls:        false
677  maxCallFrameSize: 0
678  hasOpaqueSPAdjustment: false
679  hasVAStart:      false
680  hasMustTailInVarArgFunc: false
681body:             |
682  bb.0 (%ir-block.0):
683    liveins: $rax, $rbp
684
685    ; CHECK-LABEL: name: testleaaddi32_64_32
686    ; CHECK: liveins: $rax, $rbp
687    ; CHECK: $eax = ADD32rr $eax, $ebp, implicit-def $eflags, implicit $rax, implicit $rbp
688    ; CHECK: $eax = ADD32ri $eax, 129, implicit-def $eflags
689    ; CHECK: RETQ $eax
690    $eax = LEA64_32r killed $rax, 1, killed $rbp, 129, $noreg
691    RETQ $eax
692
693...
694---
695name:            test1mov1add_rbp_64_32
696alignment:       16
697exposesReturnsTwice: false
698legalized:       false
699regBankSelected: false
700selected:        false
701tracksRegLiveness: true
702liveins:
703  - { reg: '$rax' }
704  - { reg: '$rbp' }
705frameInfo:
706  isFrameAddressTaken: false
707  isReturnAddressTaken: false
708  hasStackMap:     false
709  hasPatchPoint:   false
710  stackSize:       0
711  offsetAdjustment: 0
712  maxAlignment:    0
713  adjustsStack:    false
714  hasCalls:        false
715  maxCallFrameSize: 0
716  hasOpaqueSPAdjustment: false
717  hasVAStart:      false
718  hasMustTailInVarArgFunc: false
719body:             |
720  bb.0 (%ir-block.0):
721    liveins: $rax, $rbp, $rbx
722
723    ; CHECK-LABEL: name: test1mov1add_rbp_64_32
724    ; CHECK: liveins: $rax, $rbp, $rbx
725    ; CHECK: $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 0, $noreg
726    ; CHECK: RETQ $ebx
727    $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 0, $noreg
728    RETQ $ebx
729
730...
731---
732name:            testleaadd_rbp_index_64_32
733alignment:       16
734exposesReturnsTwice: false
735legalized:       false
736regBankSelected: false
737selected:        false
738tracksRegLiveness: true
739liveins:
740  - { reg: '$rbx' }
741  - { reg: '$rbp' }
742frameInfo:
743  isFrameAddressTaken: false
744  isReturnAddressTaken: false
745  hasStackMap:     false
746  hasPatchPoint:   false
747  stackSize:       0
748  offsetAdjustment: 0
749  maxAlignment:    0
750  adjustsStack:    false
751  hasCalls:        false
752  maxCallFrameSize: 0
753  hasOpaqueSPAdjustment: false
754  hasVAStart:      false
755  hasMustTailInVarArgFunc: false
756body:             |
757  bb.0 (%ir-block.0):
758    liveins: $rax, $rbp, $rbx
759
760    ; CHECK-LABEL: name: testleaadd_rbp_index_64_32
761    ; CHECK: liveins: $rax, $rbp, $rbx
762    ; CHECK: $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 5, $noreg
763    ; CHECK: RETQ $ebx
764    $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 5, $noreg
765    RETQ $ebx
766
767...
768---
769name:            testleaadd_rbp_index2_64_32
770alignment:       16
771exposesReturnsTwice: false
772legalized:       false
773regBankSelected: false
774selected:        false
775tracksRegLiveness: true
776liveins:
777  - { reg: '$rbx' }
778  - { reg: '$rbp' }
779frameInfo:
780  isFrameAddressTaken: false
781  isReturnAddressTaken: false
782  hasStackMap:     false
783  hasPatchPoint:   false
784  stackSize:       0
785  offsetAdjustment: 0
786  maxAlignment:    0
787  adjustsStack:    false
788  hasCalls:        false
789  maxCallFrameSize: 0
790  hasOpaqueSPAdjustment: false
791  hasVAStart:      false
792  hasMustTailInVarArgFunc: false
793body:             |
794  bb.0 (%ir-block.0):
795    liveins: $eax, $ebp, $ebx
796
797    ; CHECK-LABEL: name: testleaadd_rbp_index2_64_32
798    ; CHECK: liveins: $eax, $ebp, $ebx
799    ; CHECK: $ebx = LEA64_32r killed $rbp, 4, killed $rbp, 5, $noreg
800    ; CHECK: RETQ $ebx
801    $ebx = LEA64_32r killed $rbp, 4, killed $rbp, 5, $noreg
802    RETQ $ebx
803
804...
805---
806name:            test2addi32_64
807alignment:       16
808exposesReturnsTwice: false
809legalized:       false
810regBankSelected: false
811selected:        false
812tracksRegLiveness: true
813liveins:
814  - { reg: '$rax' }
815  - { reg: '$rbp' }
816frameInfo:
817  isFrameAddressTaken: false
818  isReturnAddressTaken: false
819  hasStackMap:     false
820  hasPatchPoint:   false
821  stackSize:       0
822  offsetAdjustment: 0
823  maxAlignment:    0
824  adjustsStack:    false
825  hasCalls:        false
826  maxCallFrameSize: 0
827  hasOpaqueSPAdjustment: false
828  hasVAStart:      false
829  hasMustTailInVarArgFunc: false
830body:             |
831  bb.0 (%ir-block.0):
832    liveins: $rax, $rbp
833
834    ; CHECK-LABEL: name: test2addi32_64
835    ; CHECK: liveins: $rax, $rbp
836    ; CHECK: $rax = ADD64rr $rax, $rbp, implicit-def $eflags
837    ; CHECK: $rax = ADD64ri32 $rax, 129, implicit-def $eflags
838    ; CHECK: RETQ $eax
839    $rax = LEA64r killed $rax, 1, killed $rbp, 129, $noreg
840    RETQ $eax
841
842...
843---
844name:            test1mov1add_rbp_64
845alignment:       16
846exposesReturnsTwice: false
847legalized:       false
848regBankSelected: false
849selected:        false
850tracksRegLiveness: true
851liveins:
852  - { reg: '$rax' }
853  - { reg: '$rbp' }
854frameInfo:
855  isFrameAddressTaken: false
856  isReturnAddressTaken: false
857  hasStackMap:     false
858  hasPatchPoint:   false
859  stackSize:       0
860  offsetAdjustment: 0
861  maxAlignment:    0
862  adjustsStack:    false
863  hasCalls:        false
864  maxCallFrameSize: 0
865  hasOpaqueSPAdjustment: false
866  hasVAStart:      false
867  hasMustTailInVarArgFunc: false
868body:             |
869  bb.0 (%ir-block.0):
870    liveins: $rax, $rbp, $rbx
871
872    ; CHECK-LABEL: name: test1mov1add_rbp_64
873    ; CHECK: liveins: $rax, $rbp, $rbx
874    ; CHECK: $rbx = MOV64rr $rbp
875    ; CHECK: $rbx = ADD64rr $rbx, $rbp, implicit-def $eflags
876    ; CHECK: RETQ $ebx
877    $rbx = LEA64r killed $rbp, 1, $rbp, 0, $noreg
878    RETQ $ebx
879
880...
881---
882name:            testleaadd_rbp_index_64
883alignment:       16
884exposesReturnsTwice: false
885legalized:       false
886regBankSelected: false
887selected:        false
888tracksRegLiveness: true
889liveins:
890  - { reg: '$rbx' }
891  - { reg: '$rbp' }
892frameInfo:
893  isFrameAddressTaken: false
894  isReturnAddressTaken: false
895  hasStackMap:     false
896  hasPatchPoint:   false
897  stackSize:       0
898  offsetAdjustment: 0
899  maxAlignment:    0
900  adjustsStack:    false
901  hasCalls:        false
902  maxCallFrameSize: 0
903  hasOpaqueSPAdjustment: false
904  hasVAStart:      false
905  hasMustTailInVarArgFunc: false
906body:             |
907  bb.0 (%ir-block.0):
908    liveins: $rax, $rbp, $rbx
909
910    ; CHECK-LABEL: name: testleaadd_rbp_index_64
911    ; CHECK: liveins: $rax, $rbp, $rbx
912    ; CHECK: $rbx = LEA64r $noreg, 1, $rbp, 5, $noreg
913    ; CHECK: $rbx = ADD64rr $rbx, $rbp, implicit-def $eflags
914    ; CHECK: RETQ $ebx
915    $rbx = LEA64r $rbp, 1, $rbp, 5, $noreg
916    RETQ $ebx
917
918...
919---
920name:            testleaadd_rbp_index2_64
921alignment:       16
922exposesReturnsTwice: false
923legalized:       false
924regBankSelected: false
925selected:        false
926tracksRegLiveness: true
927liveins:
928  - { reg: '$rbx' }
929  - { reg: '$rbp' }
930frameInfo:
931  isFrameAddressTaken: false
932  isReturnAddressTaken: false
933  hasStackMap:     false
934  hasPatchPoint:   false
935  stackSize:       0
936  offsetAdjustment: 0
937  maxAlignment:    0
938  adjustsStack:    false
939  hasCalls:        false
940  maxCallFrameSize: 0
941  hasOpaqueSPAdjustment: false
942  hasVAStart:      false
943  hasMustTailInVarArgFunc: false
944body:             |
945  bb.0 (%ir-block.0):
946    liveins: $rax, $rbp, $rbx
947
948    ; CHECK-LABEL: name: testleaadd_rbp_index2_64
949    ; CHECK: liveins: $rax, $rbp, $rbx
950    ; CHECK: $rbx = LEA64r $noreg, 4, $rbp, 5, $noreg
951    ; CHECK: $rbx = ADD64rr $rbx, $rbp, implicit-def $eflags
952    ; CHECK: RETQ $ebx
953    $rbx = LEA64r $rbp, 4,  $rbp, 5, $noreg
954    RETQ $ebx
955
956...
957---
958name:            test_skip_opt_64
959alignment:       16
960exposesReturnsTwice: false
961legalized:       false
962regBankSelected: false
963selected:        false
964tracksRegLiveness: true
965liveins:
966  - { reg: '$rbx' }
967  - { reg: '$rbp' }
968frameInfo:
969  isFrameAddressTaken: false
970  isReturnAddressTaken: false
971  hasStackMap:     false
972  hasPatchPoint:   false
973  stackSize:       0
974  offsetAdjustment: 0
975  maxAlignment:    0
976  adjustsStack:    false
977  hasCalls:        false
978  maxCallFrameSize: 0
979  hasOpaqueSPAdjustment: false
980  hasVAStart:      false
981  hasMustTailInVarArgFunc: false
982body:             |
983  bb.0 (%ir-block.0):
984    liveins: $rax, $rbp, $rbx
985
986    ; CHECK-LABEL: name: test_skip_opt_64
987    ; CHECK: liveins: $rax, $rbp, $rbx
988    ; CHECK: $rbp = LEA64r killed $rbp, 4, killed $rbp, 0, $noreg
989    ; CHECK: RETQ $ebp
990    $rbp = LEA64r killed $rbp, 4, killed $rbp, 0, $noreg
991    RETQ $ebp
992
993...
994---
995name:            test_skip_eflags_64
996alignment:       16
997exposesReturnsTwice: false
998legalized:       false
999regBankSelected: false
1000selected:        false
1001tracksRegLiveness: true
1002liveins:
1003  - { reg: '$rbp' }
1004  - { reg: '$rax' }
1005frameInfo:
1006  isFrameAddressTaken: false
1007  isReturnAddressTaken: false
1008  hasStackMap:     false
1009  hasPatchPoint:   false
1010  stackSize:       0
1011  offsetAdjustment: 0
1012  maxAlignment:    0
1013  adjustsStack:    false
1014  hasCalls:        false
1015  maxCallFrameSize: 0
1016  hasOpaqueSPAdjustment: false
1017  hasVAStart:      false
1018  hasMustTailInVarArgFunc: false
1019body:             |
1020  ; CHECK-LABEL: name: test_skip_eflags_64
1021  ; CHECK: bb.0 (%ir-block.0):
1022  ; CHECK:   successors: %bb.1(0x80000000)
1023  ; CHECK:   liveins: $rax, $rbp, $rbx
1024  ; CHECK:   CMP64rr $rax, killed $rbx, implicit-def $eflags
1025  ; CHECK:   $rbx = LEA64r killed $rax, 4, killed $rax, 5, $noreg
1026  ; CHECK:   JCC_1 %bb.1, 4, implicit $eflags
1027  ; CHECK:   RETQ $ebx
1028  ; CHECK: bb.1:
1029  ; CHECK:   liveins: $rax, $rbp, $rbx
1030  ; CHECK:   $rbp = LEA64r killed $rbx, 4, killed $rbx, 0, $noreg
1031  ; CHECK:   $rbp = ADD64ri8 $rbp, 5, implicit-def $eflags
1032  ; CHECK:   RETQ $ebp
1033  bb.0 (%ir-block.0):
1034    liveins: $rax, $rbp, $rbx
1035
1036    CMP64rr   $rax, killed $rbx, implicit-def $eflags
1037    $rbx = LEA64r killed $rax, 4, killed $rax, 5, $noreg
1038    JCC_1 %bb.1, 4, implicit $eflags
1039    RETQ $ebx
1040  bb.1:
1041    liveins: $rax, $rbp, $rbx
1042    $rbp = LEA64r killed $rbx, 4, killed $rbx, 5, $noreg
1043    RETQ $ebp
1044
1045...
1046---
1047name:            test_skip_opt_64_32
1048alignment:       16
1049exposesReturnsTwice: false
1050legalized:       false
1051regBankSelected: false
1052selected:        false
1053tracksRegLiveness: true
1054liveins:
1055  - { reg: '$rbx' }
1056  - { reg: '$rbp' }
1057frameInfo:
1058  isFrameAddressTaken: false
1059  isReturnAddressTaken: false
1060  hasStackMap:     false
1061  hasPatchPoint:   false
1062  stackSize:       0
1063  offsetAdjustment: 0
1064  maxAlignment:    0
1065  adjustsStack:    false
1066  hasCalls:        false
1067  maxCallFrameSize: 0
1068  hasOpaqueSPAdjustment: false
1069  hasVAStart:      false
1070  hasMustTailInVarArgFunc: false
1071body:             |
1072  bb.0 (%ir-block.0):
1073    liveins: $rax, $rbp, $rbx
1074
1075    ; CHECK-LABEL: name: test_skip_opt_64_32
1076    ; CHECK: liveins: $rax, $rbp, $rbx
1077    ; CHECK: $ebp = LEA64_32r killed $rbp, 4, killed $rbp, 0, $noreg
1078    ; CHECK: RETQ $ebp
1079    $ebp = LEA64_32r killed $rbp, 4, killed $rbp, 0, $noreg
1080    RETQ $ebp
1081
1082...
1083---
1084name:            test_skip_eflags_64_32
1085alignment:       16
1086exposesReturnsTwice: false
1087legalized:       false
1088regBankSelected: false
1089selected:        false
1090tracksRegLiveness: true
1091liveins:
1092  - { reg: '$rbp' }
1093  - { reg: '$rax' }
1094frameInfo:
1095  isFrameAddressTaken: false
1096  isReturnAddressTaken: false
1097  hasStackMap:     false
1098  hasPatchPoint:   false
1099  stackSize:       0
1100  offsetAdjustment: 0
1101  maxAlignment:    0
1102  adjustsStack:    false
1103  hasCalls:        false
1104  maxCallFrameSize: 0
1105  hasOpaqueSPAdjustment: false
1106  hasVAStart:      false
1107  hasMustTailInVarArgFunc: false
1108body:             |
1109  ; CHECK-LABEL: name: test_skip_eflags_64_32
1110  ; CHECK: bb.0 (%ir-block.0):
1111  ; CHECK:   successors: %bb.1(0x80000000)
1112  ; CHECK:   liveins: $rax, $rbp, $rbx
1113  ; CHECK:   CMP64rr $rax, killed $rbx, implicit-def $eflags
1114  ; CHECK:   $ebx = LEA64_32r killed $rax, 4, killed $rax, 5, $noreg
1115  ; CHECK:   JCC_1 %bb.1, 4, implicit $eflags
1116  ; CHECK:   RETQ $ebx
1117  ; CHECK: bb.1:
1118  ; CHECK:   liveins: $rax, $rbp, $rbx
1119  ; CHECK:   $ebp = LEA64_32r killed $rbx, 4, killed $rbx, 0, $noreg
1120  ; CHECK:   $ebp = ADD32ri8 $ebp, 5, implicit-def $eflags
1121  ; CHECK:   RETQ $ebp
1122  bb.0 (%ir-block.0):
1123    liveins: $rax, $rbp, $rbx
1124
1125    CMP64rr   $rax, killed $rbx, implicit-def $eflags
1126    $ebx = LEA64_32r killed $rax, 4, killed $rax, 5, $noreg
1127    JCC_1 %bb.1, 4, implicit $eflags
1128    RETQ $ebx
1129  bb.1:
1130    liveins: $rax, $rbp, $rbx
1131    $ebp = LEA64_32r killed $rbx, 4, killed $rbx, 5, $noreg
1132    RETQ $ebp
1133
1134...
1135---
1136name:            pr43758
1137alignment:       16
1138exposesReturnsTwice: false
1139legalized:       false
1140regBankSelected: false
1141selected:        false
1142tracksRegLiveness: true
1143liveins:
1144  - { reg: '$rax' }
1145  - { reg: '$rbp' }
1146frameInfo:
1147  isFrameAddressTaken: false
1148  isReturnAddressTaken: false
1149  hasStackMap:     false
1150  hasPatchPoint:   false
1151  stackSize:       0
1152  offsetAdjustment: 0
1153  maxAlignment:    0
1154  adjustsStack:    false
1155  hasCalls:        false
1156  maxCallFrameSize: 0
1157  hasOpaqueSPAdjustment: false
1158  hasVAStart:      false
1159  hasMustTailInVarArgFunc: false
1160body:             |
1161  bb.0 (%ir-block.0):
1162    liveins: $rax, $rbp
1163
1164    ; CHECK-LABEL: name: pr43758
1165    ; CHECK: liveins: $rax, $rbp
1166    ; CHECK: DBG_VALUE 0, $noreg
1167    ; CHECK: NOOP
1168    ; CHECK: NOOP
1169    ; CHECK: NOOP
1170    ; CHECK: NOOP
1171    ; CHECK: $ebp = ADD32rr $ebp, $eax, implicit-def $eflags, implicit $rbp, implicit $rax
1172    ; CHECK: NOOP
1173    ; CHECK: NOOP
1174    ; CHECK: NOOP
1175    ; CHECK: NOOP
1176    ; CHECK: RETQ $ebp
1177    DBG_VALUE 0, $noreg
1178    NOOP
1179    NOOP
1180    NOOP
1181    NOOP
1182    $ebp = LEA64_32r killed $rbp, 1, killed $rax, 0, $noreg
1183    NOOP
1184    NOOP
1185    NOOP
1186    NOOP
1187    RETQ $ebp
1188
1189...
1190...
1191
1192
1193
1194