File: instr-symbols.mir

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (74 lines) | stat: -rw-r--r-- 2,525 bytes parent folder | download | duplicates (9)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# RUN: llc -mtriple=x86_64-unknown-linux -start-before=x86-flags-copy-lowering -o - %s | FileCheck %s
#
# Test the emission of pre- and post-instruction labels.

--- |
  declare void @f(i32 %x) nounwind

  declare void @g(i32 %x) nounwind

  declare void @h(i32 %x) nounwind

  define i64 @test(i32 %x) nounwind {
  entry:
    call void @f(i32 %x)
    call void @g(i32 %x)
    call void @h(i32 %x)
    ret i64 undef
  }

...
---
name: test
# CHECK-LABEL: {{^}}test:
tracksRegLiveness: true
frameInfo:
  hasCalls: true
body: |
  bb.0.entry:
    liveins: $edi

    %0:gr32 = COPY $edi
    %1:gr32 = COPY killed %0
    ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
    $edi = COPY %1

    CALL64pcrel32 @f, csr_64, implicit $rsp, implicit $ssp, implicit $edi, pre-instr-symbol <mcsymbol .Lpre_f>, post-instr-symbol <mcsymbol .Lpost_f>
  ; CHECK:      .Lpre_f:
  ; CHECK-NEXT:   callq f
  ; CHECK-NEXT: .Lpost_f:

    ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
    ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
    $edi = COPY %1

    CALL64pcrel32 @g, csr_64, implicit $rsp, implicit $ssp, implicit $edi, pre-instr-symbol <mcsymbol .Lpre_g>
  ; CHECK:      .Lpre_g:
  ; CHECK-NEXT:   callq g

    ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
    ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
    $edi = COPY %1

    CALL64pcrel32 @h, csr_64, implicit $rsp, implicit $ssp, implicit $edi, post-instr-symbol <mcsymbol .Lpost_h>
  ; CHECK:        callq h
  ; CHECK-NEXT: .Lpost_h:

    ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp

    %2:gr64 = MOV64ri32 <mcsymbol .Lpre_f>
    %3:gr64 = MOV64ri32 <mcsymbol .Lpost_f>
    %4:gr64 = MOV64ri32 <mcsymbol .Lpre_g>
    %5:gr64 = MOV64ri32 <mcsymbol .Lpost_h>
  ; CHECK:        movq $.Lpre_f, %{{.*}}
  ; CHECK-NEXT:   movq $.Lpost_f, %{{.*}}
  ; CHECK-NEXT:   movq $.Lpre_g, %{{.*}}
  ; CHECK-NEXT:   movq $.Lpost_h, %{{.*}}

    %6:gr64 = ADD64rr killed %2, killed %3, implicit-def $eflags
    %7:gr64 = ADD64rr killed %4, killed %5, implicit-def $eflags
    %8:gr64 = ADD64rr killed %6, killed %7, implicit-def $eflags
    $rax = COPY %8
    RET64 implicit $rax

...