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
|
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv6m-none-eabi < %s | FileCheck %s --check-prefix=CHECK-T1
; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv7m-none-eabi < %s | FileCheck %s --check-prefix=CHECK-T2
; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8.1m.main-none-eabi < %s | FileCheck %s --check-prefix=CHECK-81
; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=armv8-none-eabi < %s | FileCheck %s --check-prefix=CHECK-ARM
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
define void @abs() {
; CHECK-T1-LABEL: 'abs'
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:3 CodeSize:4 Lat:3 SizeLat:3 for: %I8 = call i8 @llvm.abs.i8(i8 undef, i1 false)
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:3 CodeSize:4 Lat:3 SizeLat:3 for: %I16 = call i16 @llvm.abs.i16(i16 undef, i1 false)
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:3 CodeSize:4 Lat:3 SizeLat:3 for: %I32 = call i32 @llvm.abs.i32(i32 undef, i1 false)
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:5 CodeSize:6 Lat:5 SizeLat:5 for: %I64 = call i64 @llvm.abs.i64(i64 undef, i1 false)
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:9 CodeSize:10 Lat:9 SizeLat:9 for: %I128 = call i128 @llvm.abs.i128(i128 undef, i1 false)
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: ret void
;
; CHECK-T2-LABEL: 'abs'
; CHECK-T2-NEXT: Cost Model: Found costs of 2 for: %I8 = call i8 @llvm.abs.i8(i8 undef, i1 false)
; CHECK-T2-NEXT: Cost Model: Found costs of 2 for: %I16 = call i16 @llvm.abs.i16(i16 undef, i1 false)
; CHECK-T2-NEXT: Cost Model: Found costs of 2 for: %I32 = call i32 @llvm.abs.i32(i32 undef, i1 false)
; CHECK-T2-NEXT: Cost Model: Found costs of 4 for: %I64 = call i64 @llvm.abs.i64(i64 undef, i1 false)
; CHECK-T2-NEXT: Cost Model: Found costs of 8 for: %I128 = call i128 @llvm.abs.i128(i128 undef, i1 false)
; CHECK-T2-NEXT: Cost Model: Found costs of 1 for: ret void
;
; CHECK-81-LABEL: 'abs'
; CHECK-81-NEXT: Cost Model: Found costs of 2 for: %I8 = call i8 @llvm.abs.i8(i8 undef, i1 false)
; CHECK-81-NEXT: Cost Model: Found costs of 2 for: %I16 = call i16 @llvm.abs.i16(i16 undef, i1 false)
; CHECK-81-NEXT: Cost Model: Found costs of 2 for: %I32 = call i32 @llvm.abs.i32(i32 undef, i1 false)
; CHECK-81-NEXT: Cost Model: Found costs of 4 for: %I64 = call i64 @llvm.abs.i64(i64 undef, i1 false)
; CHECK-81-NEXT: Cost Model: Found costs of 8 for: %I128 = call i128 @llvm.abs.i128(i128 undef, i1 false)
; CHECK-81-NEXT: Cost Model: Found costs of 1 for: ret void
;
; CHECK-ARM-LABEL: 'abs'
; CHECK-ARM-NEXT: Cost Model: Found costs of 2 for: %I8 = call i8 @llvm.abs.i8(i8 undef, i1 false)
; CHECK-ARM-NEXT: Cost Model: Found costs of 2 for: %I16 = call i16 @llvm.abs.i16(i16 undef, i1 false)
; CHECK-ARM-NEXT: Cost Model: Found costs of 2 for: %I32 = call i32 @llvm.abs.i32(i32 undef, i1 false)
; CHECK-ARM-NEXT: Cost Model: Found costs of 4 for: %I64 = call i64 @llvm.abs.i64(i64 undef, i1 false)
; CHECK-ARM-NEXT: Cost Model: Found costs of 8 for: %I128 = call i128 @llvm.abs.i128(i128 undef, i1 false)
; CHECK-ARM-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%I8 = call i8 @llvm.abs.i8(i8 undef, i1 false)
%I16 = call i16 @llvm.abs.i16(i16 undef, i1 false)
%I32 = call i32 @llvm.abs.i32(i32 undef, i1 false)
%I64 = call i64 @llvm.abs.i64(i64 undef, i1 false)
%I128 = call i128 @llvm.abs.i128(i128 undef, i1 false)
ret void
}
|