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 allVRegsAllocated: true
     15 tracksRegLiveness: true
     16 frameInfo:
     17   stackSize:       52
     18 fixedStack:
     19   - { id: 0, type: spill-slot, offset: -20, size: 4, alignment: 4, callee-saved-register: '%esi' }
     20   - { id: 1, type: spill-slot, offset: -16, size: 4, alignment: 4, callee-saved-register: '%edi' }
     21   - { id: 2, type: spill-slot, offset: -12, size: 4, alignment: 4, callee-saved-register: '%ebx' }
     22   - { id: 3, type: spill-slot, offset: -8, size: 4, alignment: 4, callee-saved-register: '%ebp' }
     23 stack:
     24   - { id: 0, type: spill-slot, offset: -53, size: 1, alignment: 1 }
     25   - { id: 1, type: spill-slot, offset: -48, size: 4, alignment: 4 }
     26   - { id: 2, type: spill-slot, offset: -32, size: 4, alignment: 4 }
     27 body:             |
     28   bb.0:
     29     successors: %bb.1
     30     liveins: %ebp, %ebx, %edi, %esi
     31 
     32     frame-setup PUSH32r killed %ebp, implicit-def %esp, implicit %esp
     33     frame-setup PUSH32r killed %ebx, implicit-def %esp, implicit %esp
     34     frame-setup PUSH32r killed %edi, implicit-def %esp, implicit %esp
     35     frame-setup PUSH32r killed %esi, implicit-def %esp, implicit %esp
     36     %esp = frame-setup SUB32ri8 %esp, 36, implicit-def dead %eflags
     37     %eax = MOV32ri 1
     38     %ebp = MOV32ri 2
     39     %ebx = MOV32ri 3
     40     %ecx = MOV32ri 4
     41     %edi = MOV32ri 5
     42     %edx = MOV32ri 6
     43 
     44   bb.1:
     45     successors: %bb.3, %bb.2
     46     liveins: %eax, %ebp, %ebx, %ecx, %edi, %edx
     47 
     48     %ebp = SHR32rCL killed %ebp, implicit-def dead %eflags, implicit %cl
     49     %ebp = XOR32rr killed %ebp, killed %ebx, implicit-def dead %eflags
     50     TEST32rr %edx, %edx, implicit-def %eflags
     51     %cl = SETNEr implicit %eflags
     52     ; This %bl def is antidependent on the above use of %ebx
     53     %bl = MOV8rm %esp, 1, _, 3, _ ; :: (load 1 from %stack.0)
     54     %cl = OR8rr killed %cl, %bl, implicit-def dead %eflags
     55     %esi = MOVZX32rr8 killed %cl
     56     %esi = ADD32rr killed %esi, killed %edi, implicit-def dead %eflags
     57     %ecx = MOV32rm %esp, 1, _, 24, _ ; :: (load 4 from %stack.2)
     58     %edx = SAR32rCL killed %edx, implicit-def dead %eflags, implicit %cl
     59     TEST32rr killed %edx, %edx, implicit-def %eflags
     60     %cl = SETNEr implicit %eflags
     61     ; Verify that removal of the %bl antidependence does not use %ch
     62     ; as a replacement register.
     63     ; CHECK: %cl = AND8rr %cl, killed %b
     64     %cl = AND8rr killed %cl, killed %bl, implicit-def dead %eflags
     65     CMP32ri8 %ebp, -1, implicit-def %eflags
     66     %edx = MOV32ri 0
     67     JE_1 %bb.3, implicit %eflags
     68 
     69   bb.2:
     70     successors: %bb.3
     71     liveins: %cl, %eax, %ebp, %esi
     72 
     73     OR32mr %esp, 1, _, 8, _, killed %eax, implicit-def %eflags ; :: (store 4 into %stack.1)
     74     %dl = SETNEr implicit %eflags, implicit-def %edx
     75 
     76   bb.3:
     77     liveins: %cl, %ebp, %edx, %esi
     78 
     79     %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags
     80     %esp = ADD32ri8 %esp, 36, implicit-def dead %eflags
     81     %esi = POP32r implicit-def %esp, implicit %esp
     82     %edi = POP32r implicit-def %esp, implicit %esp
     83     %ebx = POP32r implicit-def %esp, implicit %esp
     84     %ebp = POP32r implicit-def %esp, implicit %esp
     85     RET 0, %eax
     86 
     87 ...
     88