Skip to content

Commit 61d05be

Browse files
author
badumbatish
committed
Precommit missed opt for pow poison
1 parent cc6a864 commit 61d05be

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

llvm/test/Transforms/InstSimplify/fold-intrinsics.ll

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ define void @powi(double %V, ptr%P) {
3333
define void @powi_i16(float %V, ptr%P) {
3434
; CHECK-LABEL: @powi_i16(
3535
; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P:%.*]], align 4
36-
; CHECK-NEXT: store volatile float [[V:%.*]], ptr [[P]], align 4
36+
; CHECK-NEXT: store volatile float [[D:%.*]], ptr [[P]], align 4
3737
; CHECK-NEXT: ret void
3838
;
3939
%B = tail call float @llvm.powi.f32.i16(float %V, i16 0) nounwind
@@ -52,3 +52,39 @@ define i32 @test_ctpop_poison(i32 %a) {
5252
%res = tail call i32 @llvm.ctpop.i32(i32 poison)
5353
ret i32 %res
5454
}
55+
56+
define void @pow_poison_i16(i16 %arg_int,float %arg_flt, ptr %P) {
57+
; CHECK-LABEL: @pow_poison_i16(
58+
; CHECK-NEXT: [[TMP1:%.*]] = tail call float @llvm.powi.f32.i16(float poison, i16 [[ARG_INT:%.*]]) #[[ATTR1:[0-9]+]]
59+
; CHECK-NEXT: store volatile float [[TMP1]], ptr [[P:%.*]], align 4
60+
; CHECK-NEXT: [[TMP2:%.*]] = tail call float @llvm.pow.f32(float poison, float [[ARG_FLT:%.*]]) #[[ATTR1]]
61+
; CHECK-NEXT: store volatile float [[TMP2]], ptr [[P]], align 4
62+
; CHECK-NEXT: [[TMP3:%.*]] = tail call float @llvm.powi.f32.i16(float [[ARG_FLT]], i16 poison) #[[ATTR1]]
63+
; CHECK-NEXT: store volatile float [[TMP3]], ptr [[P]], align 4
64+
; CHECK-NEXT: [[TMP4:%.*]] = tail call float @llvm.pow.f32(float [[ARG_FLT]], float poison) #[[ATTR1]]
65+
; CHECK-NEXT: store volatile float [[TMP4]], ptr [[P]], align 4
66+
; CHECK-NEXT: [[TMP5:%.*]] = tail call float @llvm.powi.f32.i16(float poison, i16 poison) #[[ATTR1]]
67+
; CHECK-NEXT: store volatile float [[TMP5]], ptr [[P]], align 4
68+
; CHECK-NEXT: [[TMP6:%.*]] = tail call float @llvm.pow.f32(float poison, float poison) #[[ATTR1]]
69+
; CHECK-NEXT: store volatile float [[TMP6]], ptr [[P]], align 4
70+
; CHECK-NEXT: ret void
71+
;
72+
%2 = tail call float @llvm.powi.f32.i16(float poison, i16 %arg_int) nounwind
73+
store volatile float %2, ptr %P
74+
75+
%3 = tail call float @llvm.pow(float poison, float %arg_flt) nounwind
76+
store volatile float %3, ptr %P
77+
78+
%4 = tail call float @llvm.powi.f32.i16(float %arg_flt, i16 poison) nounwind
79+
store volatile float %4, ptr %P
80+
81+
%5 = tail call float @llvm.pow(float %arg_flt, float poison) nounwind
82+
store volatile float %5, ptr %P
83+
84+
%6 = tail call float @llvm.powi.f32.i16(float poison, i16 poison) nounwind
85+
store volatile float %6, ptr %P
86+
87+
%7 = tail call float @llvm.pow(float poison, float poison) nounwind
88+
store volatile float %7, ptr %P
89+
ret void
90+
}

0 commit comments

Comments
 (0)