1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=instcombine -S %s | FileCheck %s
4 define double @F0(bfloat %P0) {
5 ; CHECK-LABEL: define double @F0(
6 ; CHECK-SAME: bfloat [[P0:%.*]]) {
8 ; CHECK-NEXT: [[CONV0:%.*]] = bitcast bfloat [[P0]] to half
9 ; CHECK-NEXT: [[TMP0:%.*]] = fpext half [[CONV0]] to double
10 ; CHECK-NEXT: ret double [[TMP0]]
13 %conv0 = bitcast bfloat %P0 to half
14 %0 = fpext half %conv0 to double
18 define double @F1(half %P1) {
19 ; CHECK-LABEL: define double @F1(
20 ; CHECK-SAME: half [[P1:%.*]]) {
22 ; CHECK-NEXT: [[CONV1:%.*]] = bitcast half [[P1]] to bfloat
23 ; CHECK-NEXT: [[TMP0:%.*]] = fpext bfloat [[CONV1]] to double
24 ; CHECK-NEXT: ret double [[TMP0]]
27 %conv1 = bitcast half %P1 to bfloat
28 %0 = fpext bfloat %conv1 to double
32 define i32 @F2(bfloat %P2) {
33 ; CHECK-LABEL: define i32 @F2(
34 ; CHECK-SAME: bfloat [[P2:%.*]]) {
36 ; CHECK-NEXT: [[CONV2:%.*]] = bitcast bfloat [[P2]] to half
37 ; CHECK-NEXT: [[TMP0:%.*]] = fptoui half [[CONV2]] to i32
38 ; CHECK-NEXT: ret i32 [[TMP0]]
41 %conv2 = bitcast bfloat %P2 to half
42 %0 = fptoui half %conv2 to i32
46 define i32 @F3(half %P3) {
47 ; CHECK-LABEL: define i32 @F3(
48 ; CHECK-SAME: half [[P3:%.*]]) {
50 ; CHECK-NEXT: [[CONV3:%.*]] = bitcast half [[P3]] to bfloat
51 ; CHECK-NEXT: [[TMP0:%.*]] = fptoui bfloat [[CONV3]] to i32
52 ; CHECK-NEXT: ret i32 [[TMP0]]
55 %conv3 = bitcast half %P3 to bfloat
56 %0 = fptoui bfloat %conv3 to i32
60 define i32 @F4(bfloat %P4) {
61 ; CHECK-LABEL: define i32 @F4(
62 ; CHECK-SAME: bfloat [[P4:%.*]]) {
64 ; CHECK-NEXT: [[CONV4:%.*]] = bitcast bfloat [[P4]] to half
65 ; CHECK-NEXT: [[TMP0:%.*]] = fptosi half [[CONV4]] to i32
66 ; CHECK-NEXT: ret i32 [[TMP0]]
69 %conv4 = bitcast bfloat %P4 to half
70 %0 = fptosi half %conv4 to i32
74 define i32 @F5(half %P5) {
75 ; CHECK-LABEL: define i32 @F5(
76 ; CHECK-SAME: half [[P5:%.*]]) {
78 ; CHECK-NEXT: [[CONV5:%.*]] = bitcast half [[P5]] to bfloat
79 ; CHECK-NEXT: [[TMP0:%.*]] = fptosi bfloat [[CONV5]] to i32
80 ; CHECK-NEXT: ret i32 [[TMP0]]
83 %conv5 = bitcast half %P5 to bfloat
84 %0 = fptosi bfloat %conv5 to i32