Skip to content

Commit 332aa18

Browse files
committed
[InstCombine] Add pre-commit tests. NFC.
1 parent ea73fc5 commit 332aa18

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

llvm/test/Transforms/InstCombine/fpcast.ll

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ define half @test3_fast(float %a) {
4040
ret half %c
4141
}
4242

43+
define half @test3_both_ninf(float %a) {
44+
; CHECK-LABEL: @test3_both_ninf(
45+
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc float [[A:%.*]] to half
46+
; CHECK-NEXT: [[C:%.*]] = call ninf half @llvm.fabs.f16(half [[TMP1]])
47+
; CHECK-NEXT: ret half [[C]]
48+
;
49+
%b = call ninf float @llvm.fabs.f32(float %a)
50+
%c = fptrunc ninf float %b to half
51+
ret half %c
52+
}
53+
54+
define half @test3_fabs_ninf(float %a) {
55+
; CHECK-LABEL: @test3_fabs_ninf(
56+
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc float [[A:%.*]] to half
57+
; CHECK-NEXT: [[C:%.*]] = call ninf half @llvm.fabs.f16(half [[TMP1]])
58+
; CHECK-NEXT: ret half [[C]]
59+
;
60+
%b = call ninf float @llvm.fabs.f32(float %a)
61+
%c = fptrunc float %b to half
62+
ret half %c
63+
}
64+
4365
define half @fneg_fptrunc(float %a) {
4466
; CHECK-LABEL: @fneg_fptrunc(
4567
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc float [[A:%.*]] to half

0 commit comments

Comments
 (0)