File: mir-target-flags.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (44 lines) | stat: -rw-r--r-- 1,744 bytes parent folder | download | duplicates (5)
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
; RUN: llc --mtriple=loongarch64 --stop-after loongarch-prera-expand-pseudo \
; RUN:     --relocation-model=pic %s -o %t.mir
; RUN: llc --mtriple=loongarch64 --run-pass loongarch-prera-expand-pseudo \
; RUN:     %t.mir -o - | FileCheck %s

;; This tests the LoongArch-specific serialization and deserialization of
;; `target-flags(...)`

@g_e = external global i32
@g_i = internal global i32 0
@t_un = external thread_local global i32
@t_ld = external thread_local(localdynamic) global i32
@t_ie = external thread_local(initialexec) global i32
@t_le = external thread_local(localexec) global i32

declare void @callee1() nounwind
declare dso_local void @callee2() nounwind

define void @caller() nounwind {
; CHECK-LABEL: name: caller
; CHECK:      target-flags(loongarch-got-pc-hi) @g_e
; CHECK-NEXT: target-flags(loongarch-got-pc-lo) @g_e
; CHECK:      target-flags(loongarch-pcrel-hi) @g_i
; CHECK-NEXT: target-flags(loongarch-pcrel-lo) @g_i
; CHECK:      target-flags(loongarch-gd-pc-hi) @t_un
; CHECK-NEXT: target-flags(loongarch-got-pc-lo) @t_un
; CHECK:      target-flags(loongarch-ld-pc-hi) @t_ld
; CHECK-NEXT: target-flags(loongarch-got-pc-lo) @t_ld
; CHECK:      target-flags(loongarch-ie-pc-hi) @t_ie
; CHECK-NEXT: target-flags(loongarch-ie-pc-lo) @t_ie
; CHECK:      target-flags(loongarch-le-hi) @t_le
; CHECK-NEXT: target-flags(loongarch-le-lo) @t_le
; CHECK:      target-flags(loongarch-call-plt) @callee1
; CHECK:      target-flags(loongarch-call) @callee2
  %a = load volatile i32, ptr @g_e
  %b = load volatile i32, ptr @g_i
  %c = load volatile i32, ptr @t_un
  %d = load volatile i32, ptr @t_ld
  %e = load volatile i32, ptr @t_ie
  %f = load volatile i32, ptr @t_le
  call i32 @callee1()
  call i32 @callee2()
  ret void
}