1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
Jonas Paulsson fcbde114fe [SystemZ::TTI] Recognize the higher cost of scalar i1 -> fp conversion
Scalar i1 to fp conversions are done with a branch sequence, so it should
have a higher cost.

Review: Ulrich Weigand
https://reviews.llvm.org/D53924

llvm-svn: 345818
2018-11-01 09:05:32 +00:00

24 lines
685 B
LLVM

; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s
;
; Costs for conversion of i1 to fp.
define float @fun0(i64 %val1, i64 %val2) {
%cmp = icmp eq i64 %val1, %val2
%v = uitofp i1 %cmp to float
ret float %v
; CHECK: fun0
; CHECK: cost of 1 for instruction: %cmp = icmp eq i64 %val1, %val2
; CHECK: cost of 5 for instruction: %v = uitofp i1 %cmp to float
}
define double @fun1(i64 %val1, i64 %val2) {
%cmp = icmp eq i64 %val1, %val2
%v = uitofp i1 %cmp to double
ret double %v
; CHECK: fun1
; CHECK: cost of 1 for instruction: %cmp = icmp eq i64 %val1, %val2
; CHECK: cost of 5 for instruction: %v = uitofp i1 %cmp to double
}