summaryrefslogtreecommitdiff
path: root/tests/examplefiles/llvm-mir/llvm-mir.mir
blob: 561296c2ff1164d92236dfce84439be23110f77d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# YAML line comment

--- |
  ; LLVM-IR line comment
  define void @myfunction() { ret void }
...

---
name: myfunction
legalized: true
registers:
  - { id: 0, class: gpr }
body: |
  bb.0.named (address-taken):
    liveins: $r0, $r1
    successors: %bb.1.alsonamed

    ; MIR line comment
    %0:gpr(s64) = COPY $r0
    %1(s32) = COPY $r1
  bb.1.alsonamed:
    successors: %bb.2

    %2(s32) = EXTRACT_SUBREG %1(s32), %subreg.sub0
    %3(s32) = G_ADD %0:gpr(s32), %2(s32) killed
    %4(s32) = G_CONSTANT i32 1
    %5(s32) = G_FCONSTANT float 1.0
    %6(p0) = G_LOAD %6(p0) :: (load 4 from %ir.myvar + 4)

  bb.2:
    $r0 = COPY %3
...