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