File: cmp.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (142 lines) | stat: -rw-r--r-- 8,829 bytes parent folder | download | duplicates (2)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=aarch64-- < %s | FileCheck %s

target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"

define void @cmps() {
; CHECK-LABEL: 'cmps'
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %c8 = icmp slt i8 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %c16 = icmp ult i16 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %c32 = icmp sge i32 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %c64 = icmp ne i64 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %c128 = icmp ult i128 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cv16i8 = icmp slt <16 x i8> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cv8i16 = icmp ult <8 x i16> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cv4i32 = icmp sge <4 x i32> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cf16 = fcmp oge half undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cf32 = fcmp ogt float undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cf64 = fcmp ogt double undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cbf64 = fcmp ogt bfloat undef, undef
; CHECK-NEXT:  Cost Model: Found costs of RThru:7 CodeSize:4 Lat:4 SizeLat:4 for: %cfv816 = fcmp olt <8 x half> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cfv432 = fcmp oge <4 x float> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cfv264 = fcmp oge <2 x double> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of RThru:7 CodeSize:4 Lat:4 SizeLat:4 for: %cbfv816 = fcmp olt <8 x bfloat> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
  %c8 = icmp slt i8 undef, undef
  %c16 = icmp ult i16 undef, undef
  %c32 = icmp sge i32 undef, undef
  %c64 = icmp ne i64 undef, undef
  %c128 = icmp ult i128 undef, undef
  %cv16i8 = icmp slt <16 x i8> undef, undef
  %cv8i16 = icmp ult <8 x i16> undef, undef
  %cv4i32 = icmp sge <4 x i32> undef, undef
  %cf16 = fcmp oge half undef, undef
  %cf32 = fcmp ogt float undef, undef
  %cf64 = fcmp ogt double undef, undef
  %cbf64 = fcmp ogt bfloat undef, undef
  %cfv816 = fcmp olt <8 x half> undef, undef
  %cfv432 = fcmp oge <4 x float> undef, undef
  %cfv264 = fcmp oge <2 x double> undef, undef
  %cbfv816 = fcmp olt <8 x bfloat> undef, undef
  ret void
}


define void @andcmp() {
; CHECK-LABEL: 'andcmp'
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %a8 = and i8 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %c8 = icmp eq i8 %a8, 0
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %a16 = and i16 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %c16 = icmp ne i16 %a16, 0
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %a32 = and i32 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c32 = icmp eq i32 %a32, 0
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %a64 = and i64 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c64 = icmp ne i64 %a64, 0
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c32ge = icmp sge i32 %a32, 1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c32le = icmp slt i32 %a32, 1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c32leneg = icmp sle i32 %a32, -1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c32gtneg = icmp sgt i32 %a32, -1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c64ge = icmp sge i64 %a64, 1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c64le = icmp slt i64 %a64, 1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c64leneg = icmp sle i64 %a64, -1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c64gtneg = icmp sgt i64 %a64, -1
; CHECK-NEXT:  Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %a128 = and i128 undef, undef
; CHECK-NEXT:  Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %c128 = icmp eq i128 %a128, 0
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %av16i8 = and <16 x i8> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cv16i8 = icmp ne <16 x i8> %av16i8, zeroinitializer
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %av8i16 = and <8 x i16> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cv8i16 = icmp eq <8 x i16> %av8i16, zeroinitializer
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %av4i32 = and <4 x i32> undef, undef
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %cv4i32 = icmp ne <4 x i32> %av4i32, zeroinitializer
; CHECK-NEXT:  Cost Model: Found costs of 1 for: %c32not0 = icmp eq i32 %a32, 1
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: %c64sle = icmp sle i64 %a64, 0
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
  %a8 = and i8 undef, undef
  %c8 = icmp eq i8 %a8, 0
  %a16 = and i16 undef, undef
  %c16 = icmp ne i16 %a16, 0
  %a32 = and i32 undef, undef
  %c32 = icmp eq i32 %a32, 0
  %a64 = and i64 undef, undef
  %c64 = icmp ne i64 %a64, 0

  %c32ge = icmp sge i32 %a32, 1
  %c32le = icmp slt i32 %a32, 1
  %c32leneg = icmp sle i32 %a32, -1
  %c32gtneg  = icmp sgt i32 %a32, -1

  %c64ge = icmp sge i64 %a64, 1
  %c64le = icmp slt i64 %a64, 1
  %c64leneg = icmp sle i64 %a64, -1
  %c64gtneg  = icmp sgt i64 %a64, -1

  %a128 = and i128 undef, undef
  %c128 = icmp eq i128 %a128, zeroinitializer
  %av16i8 = and <16 x i8> undef, undef
  %cv16i8 = icmp ne <16 x i8> %av16i8, zeroinitializer
  %av8i16 = and <8 x i16> undef, undef
  %cv8i16 = icmp eq <8 x i16> %av8i16, zeroinitializer
  %av4i32 = and <4 x i32> undef, undef
  %cv4i32 = icmp ne <4 x i32> %av4i32, zeroinitializer

  %c32not0 = icmp eq i32 %a32, 1
  %c64sle = icmp sle i64 %a64, 0
  ret void
}

define void @uscmp() {
; CHECK-LABEL: 'uscmp'
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %u8 = call i8 @llvm.ucmp.i8.i8(i8 undef, i8 undef)
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %u16 = call i16 @llvm.ucmp.i16.i16(i16 undef, i16 undef)
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %u32 = call i32 @llvm.ucmp.i32.i32(i32 undef, i32 undef)
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %u64 = call i64 @llvm.ucmp.i64.i64(i64 undef, i64 undef)
; CHECK-NEXT:  Cost Model: Found costs of 5 for: %uv16i8 = call <16 x i8> @llvm.ucmp.v16i8.v16i8(<16 x i8> undef, <16 x i8> undef)
; CHECK-NEXT:  Cost Model: Found costs of 5 for: %uv8i16 = call <8 x i16> @llvm.ucmp.v8i16.v8i16(<8 x i16> undef, <8 x i16> undef)
; CHECK-NEXT:  Cost Model: Found costs of 5 for: %uv4i32 = call <4 x i32> @llvm.ucmp.v4i32.v4i32(<4 x i32> undef, <4 x i32> undef)
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %s8 = call i8 @llvm.scmp.i8.i8(i8 undef, i8 undef)
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %s16 = call i16 @llvm.scmp.i16.i16(i16 undef, i16 undef)
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %s32 = call i32 @llvm.scmp.i32.i32(i32 undef, i32 undef)
; CHECK-NEXT:  Cost Model: Found costs of 4 for: %s64 = call i64 @llvm.scmp.i64.i64(i64 undef, i64 undef)
; CHECK-NEXT:  Cost Model: Found costs of 5 for: %sv16i8 = call <16 x i8> @llvm.scmp.v16i8.v16i8(<16 x i8> undef, <16 x i8> undef)
; CHECK-NEXT:  Cost Model: Found costs of 5 for: %sv8i16 = call <8 x i16> @llvm.scmp.v8i16.v8i16(<8 x i16> undef, <8 x i16> undef)
; CHECK-NEXT:  Cost Model: Found costs of 5 for: %sv4i32 = call <4 x i32> @llvm.scmp.v4i32.v4i32(<4 x i32> undef, <4 x i32> undef)
; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
  %u8 = call i8 @llvm.ucmp(i8 undef, i8 undef)
  %u16 = call i16 @llvm.ucmp(i16 undef, i16 undef)
  %u32 = call i32 @llvm.ucmp(i32 undef, i32 undef)
  %u64 = call i64 @llvm.ucmp(i64 undef, i64 undef)
  %uv16i8 = call <16 x i8> @llvm.ucmp(<16 x i8> undef, <16 x i8> undef)
  %uv8i16 = call <8 x i16> @llvm.ucmp(<8 x i16> undef, <8 x i16> undef)
  %uv4i32 = call <4 x i32> @llvm.ucmp(<4 x i32> undef, <4 x i32> undef)
  %s8 = call i8 @llvm.scmp(i8 undef, i8 undef)
  %s16 = call i16 @llvm.scmp(i16 undef, i16 undef)
  %s32 = call i32 @llvm.scmp(i32 undef, i32 undef)
  %s64 = call i64 @llvm.scmp(i64 undef, i64 undef)
  %sv16i8 = call <16 x i8> @llvm.scmp(<16 x i8> undef, <16 x i8> undef)
  %sv8i16 = call <8 x i16> @llvm.scmp(<8 x i16> undef, <8 x i16> undef)
  %sv4i32 = call <4 x i32> @llvm.scmp(<4 x i32> undef, <4 x i32> undef)
  ret void
}