• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -march=x86 -start-after branch-folder -stop-after branch-folder -o - %s | FileCheck %s
2# This test ensures that the MIR parser parses fixed stack memory operands
3# correctly.
4
5--- |
6
7  define i32 @test(i32 %a) #0 {
8  entry:
9    %b = alloca i32
10    store i32 %a, i32* %b
11    %c = load i32, i32* %b
12    ret i32 %c
13  }
14
15  attributes #0 = { "no-frame-pointer-elim"="false" }
16
17...
18---
19name:            test
20alignment:       4
21tracksRegLiveness: true
22frameInfo:
23  stackSize:       4
24  maxAlignment:    4
25fixedStack:
26  - { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true }
27stack:
28  - { id: 0, name: b, offset: -8, size: 4, alignment: 4 }
29body: |
30  bb.0.entry:
31    frame-setup PUSH32r undef %eax, implicit-def %esp, implicit %esp
32    CFI_INSTRUCTION .cfi_def_cfa_offset 8
33  ; CHECK: name: test
34  ; CHECK: %eax = MOV32rm %esp, 1, _, 8, _ :: (load 4 from %fixed-stack.0, align 16)
35    %eax = MOV32rm %esp, 1, _, 8, _ :: (load 4 from %fixed-stack.0, align 16)
36    MOV32mr %esp, 1, _, 0, _, %eax :: (store 4 into %ir.b)
37    %edx = POP32r implicit-def %esp, implicit %esp
38    RETL %eax
39...
40