File: irtranslator-no-op-intrinsics.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (79 lines) | stat: -rw-r--r-- 3,071 bytes parent folder | download | duplicates (8)
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
75
76
77
78
79
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
; RUN: llc -global-isel -O0 -mtriple=aarch64-- -stop-after=irtranslator -verify-machineinstrs -o - %s | FileCheck %s

define i64 @expect_i64(i64 %arg0) {
  ; CHECK-LABEL: name: expect_i64
  ; CHECK: bb.1 (%ir-block.0):
  ; CHECK:   liveins: $x0
  ; CHECK:   [[COPY:%[0-9]+]]:_(s64) = COPY $x0
  ; CHECK:   [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
  ; CHECK:   $x0 = COPY [[COPY1]](s64)
  ; CHECK:   RET_ReallyLR implicit $x0
  %expval = call i64 @llvm.expect.i64(i64 %arg0, i64 1)
  ret i64 %expval
}

define ptr @ptr_annotate(ptr %arg0, ptr %arg1, ptr %arg2, i32 %arg3) {
  ; CHECK-LABEL: name: ptr_annotate
  ; CHECK: bb.1 (%ir-block.0):
  ; CHECK:   liveins: $w3, $x0, $x1, $x2
  ; CHECK:   [[COPY:%[0-9]+]]:_(p0) = COPY $x0
  ; CHECK:   [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
  ; CHECK:   [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
  ; CHECK:   [[COPY3:%[0-9]+]]:_(s32) = COPY $w3
  ; CHECK:   [[COPY4:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
  ; CHECK:   $x0 = COPY [[COPY4]](p0)
  ; CHECK:   RET_ReallyLR implicit $x0
  %call = call ptr @llvm.ptr.annotation.p0(ptr %arg0, ptr %arg1, ptr %arg2, i32 %arg3, ptr null)
  ret ptr %call
}

@.str = private unnamed_addr constant [4 x i8] c"sth\00", section "llvm.metadata"
@.str1 = private unnamed_addr constant [4 x i8] c"t.c\00", section "llvm.metadata"

define i32 @annotation(i32 %a) {
  ; CHECK-LABEL: name: annotation
  ; CHECK: bb.1 (%ir-block.0):
  ; CHECK:   liveins: $w0
  ; CHECK:   [[COPY:%[0-9]+]]:_(s32) = COPY $w0
  ; CHECK:   [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; CHECK:   $w0 = COPY [[COPY1]](s32)
  ; CHECK:   RET_ReallyLR implicit $w0
  %call = call i32 @llvm.annotation.i32(i32 %a, ptr @.str, ptr @.str1, i32 2)
  ret i32 %call
}

define ptr @launder_invariant_group(ptr %p) {
  ; CHECK-LABEL: name: launder_invariant_group
  ; CHECK: bb.1 (%ir-block.0):
  ; CHECK:   liveins: $x0
  ; CHECK:   [[COPY:%[0-9]+]]:_(p0) = COPY $x0
  ; CHECK:   [[COPY1:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
  ; CHECK:   $x0 = COPY [[COPY1]](p0)
  ; CHECK:   RET_ReallyLR implicit $x0
  %q = call ptr @llvm.launder.invariant.group.p0(ptr %p)
  ret ptr %q
}

define ptr @strip_invariant_group(ptr %p) {
  ; CHECK-LABEL: name: strip_invariant_group
  ; CHECK: bb.1 (%ir-block.0):
  ; CHECK:   liveins: $x0
  ; CHECK:   [[COPY:%[0-9]+]]:_(p0) = COPY $x0
  ; CHECK:   [[COPY1:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
  ; CHECK:   $x0 = COPY [[COPY1]](p0)
  ; CHECK:   RET_ReallyLR implicit $x0
  %q = call ptr @llvm.strip.invariant.group.p0(ptr %p)
  ret ptr %q
}

declare i64 @llvm.expect.i64(i64, i64) #0
declare ptr @llvm.ptr.annotation.p0(ptr, ptr, ptr, i32, ptr) #1
declare i32 @llvm.annotation.i32(i32, ptr, ptr, i32) #1
declare ptr @llvm.launder.invariant.group.p0(ptr) #2
declare ptr @llvm.strip.invariant.group.p0(ptr) #3

attributes #0 = { nounwind readnone willreturn }
attributes #1 = { nounwind willreturn }
attributes #2 = { inaccessiblememonly nounwind speculatable willreturn }
attributes #3 = { nounwind readnone speculatable willreturn }