Home | History | Annotate | Download | only in X86
      1 # RUN: llc -mtriple=i386-unknown-linux-gnu -mcpu=slm -run-pass post-RA-sched -o - %s | FileCheck %s
      2 #
      3 # Verify that the critical antidependence breaker does not consider
      4 # a high byte register as available as a replacement register
      5 # in a certain context.
      6 --- |
      7 
      8   define void @main() { ret void }
      9 
     10 ...
     11 ---
     12 # CHECK-LABEL: main
     13 name:            main
     14 tracksRegLiveness: true
     15 frameInfo:
     16   stackSize:       52
     17 fixedStack:
     18   - { id: 0, type: spill-slot, offset: -20, size: 4, alignment: 4, callee-saved-register: '$esi' }
     19   - { id: 1, type: spill-slot, offset: -16, size: 4, alignment: 4, callee-saved-register: '$edi' }
     20   - { id: 2, type: spill-slot, offset: -12, size: 4, alignment: 4, callee-saved-register: '$ebx' }
     21   - { id: 3, type: spill-slot, offset: -8, size: 4, alignment: 4, callee-saved-register: '$ebp' }
     22 stack:
     23   - { id: 0, type: spill-slot, offset: -53, size: 1, alignment: 1 }
     24   - { id: 1, type: spill-slot, offset: -48, size: 4, alignment: 4 }
     25   - { id: 2, type: spill-slot, offset: -32, size: 4, alignment: 4 }
     26 body:             |
     27   bb.0:
     28     liveins: $ebp, $ebx, $edi, $esi
     29 
     30     frame-setup PUSH32r killed $ebp, implicit-def $esp, implicit $esp
     31     frame-setup PUSH32r killed $ebx, implicit-def $esp, implicit $esp
     32     frame-setup PUSH32r killed $edi, implicit-def $esp, implicit $esp
     33     frame-setup PUSH32r killed $esi, implicit-def $esp, implicit $esp
     34     $esp = frame-setup SUB32ri8 $esp, 36, implicit-def dead $eflags
     35     $eax = MOV32ri 1
     36     $ebp = MOV32ri 2
     37     $ebx = MOV32ri 3
     38     $ecx = MOV32ri 4
     39     $edi = MOV32ri 5
     40     $edx = MOV32ri 6
     41 
     42   bb.1:
     43     liveins: $eax, $ebp, $ebx, $ecx, $edi, $edx
     44 
     45     $ebp = SHR32rCL killed $ebp, implicit-def dead $eflags, implicit $cl
     46     $ebp = XOR32rr killed $ebp, killed $ebx, implicit-def dead $eflags
     47     TEST32rr $edx, $edx, implicit-def $eflags
     48     $cl = SETNEr implicit $eflags
     49     ; This %bl def is antidependent on the above use of $ebx
     50     $bl = MOV8rm $esp, 1, $noreg, 3, _ ; :: (load 1 from %stack.0)
     51     $cl = OR8rr killed $cl, $bl, implicit-def dead $eflags
     52     $esi = MOVZX32rr8 killed $cl
     53     $esi = ADD32rr killed $esi, killed $edi, implicit-def dead $eflags
     54     $ecx = MOV32rm $esp, 1, $noreg, 24, _ ; :: (load 4 from %stack.2)
     55     $edx = SAR32rCL killed $edx, implicit-def dead $eflags, implicit $cl
     56     TEST32rr killed $edx, $edx, implicit-def $eflags
     57     $cl = SETNEr implicit $eflags
     58     ; Verify that removal of the $bl antidependence does not use $ch
     59     ; as a replacement register.
     60     ; CHECK: $cl = AND8rr killed $cl, killed $b
     61     $cl = AND8rr killed $cl, killed $bl, implicit-def dead $eflags
     62     CMP32ri8 $ebp, -1, implicit-def $eflags
     63     $edx = MOV32ri 0
     64     JE_1 %bb.3, implicit $eflags
     65 
     66   bb.2:
     67     liveins: $cl, $eax, $ebp, $esi
     68 
     69     OR32mr $esp, 1, $noreg, 8, $noreg, killed $eax, implicit-def $eflags ; :: (store 4 into %stack.1)
     70     $dl = SETNEr implicit $eflags, implicit-def $edx
     71 
     72   bb.3:
     73     liveins: $cl, $ebp, $edx, $esi
     74 
     75     $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
     76     $esp = ADD32ri8 $esp, 36, implicit-def dead $eflags
     77     $esi = POP32r implicit-def $esp, implicit $esp
     78     $edi = POP32r implicit-def $esp, implicit $esp
     79     $ebx = POP32r implicit-def $esp, implicit $esp
     80     $ebp = POP32r implicit-def $esp, implicit $esp
     81     RET 0, $eax
     82 
     83 ...
     84