@@ -2685,6 +2685,20 @@ define <vscale x 4 x float> @scalable_splat_zero() {
2685
2685
; See https://github.com/llvm/llvm-project/issues/78507
2686
2686
2687
2687
define double @call_abs (double noundef %__x ) {
2688
+ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2689
+ ; TUNIT-LABEL: define noundef nofpclass(ninf nzero nsub nnorm) double @call_abs
2690
+ ; TUNIT-SAME: (double noundef [[__X:%.*]]) #[[ATTR3]] {
2691
+ ; TUNIT-NEXT: entry:
2692
+ ; TUNIT-NEXT: [[ABS:%.*]] = tail call noundef nofpclass(ninf nzero nsub nnorm) double @llvm.fabs.f64(double noundef [[__X]]) #[[ATTR22]]
2693
+ ; TUNIT-NEXT: ret double [[ABS]]
2694
+ ;
2695
+ ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2696
+ ; CGSCC-LABEL: define noundef nofpclass(ninf nzero nsub nnorm) double @call_abs
2697
+ ; CGSCC-SAME: (double noundef [[__X:%.*]]) #[[ATTR3]] {
2698
+ ; CGSCC-NEXT: entry:
2699
+ ; CGSCC-NEXT: [[ABS:%.*]] = tail call noundef nofpclass(ninf nzero nsub nnorm) double @llvm.fabs.f64(double noundef [[__X]]) #[[ATTR19]]
2700
+ ; CGSCC-NEXT: ret double [[ABS]]
2701
+ ;
2688
2702
entry:
2689
2703
%abs = tail call double @llvm.fabs.f64 (double %__x )
2690
2704
ret double %abs
@@ -2705,7 +2719,7 @@ define float @bitcast_to_float_sign_0(i32 %arg) {
2705
2719
2706
2720
define float @bitcast_to_float_nnan (i32 %arg ) {
2707
2721
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2708
- ; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) float @bitcast_to_float_nnan
2722
+ ; CHECK-LABEL: define nofpclass(nan inf nzero nsub nnorm) float @bitcast_to_float_nnan
2709
2723
; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] {
2710
2724
; CHECK-NEXT: [[SHR:%.*]] = lshr i32 [[ARG]], 2
2711
2725
; CHECK-NEXT: [[CAST:%.*]] = bitcast i32 [[SHR]] to float
@@ -2742,6 +2756,47 @@ define float @bitcast_to_float_nan(i32 %arg) {
2742
2756
ret float %cast
2743
2757
}
2744
2758
2759
+ define float @bitcast_to_float_zero (i32 %arg ) {
2760
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2761
+ ; CHECK-LABEL: define nofpclass(nan inf sub norm) float @bitcast_to_float_zero
2762
+ ; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] {
2763
+ ; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[ARG]], 31
2764
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast i32 [[SHL]] to float
2765
+ ; CHECK-NEXT: ret float [[CAST]]
2766
+ ;
2767
+ %shl = shl i32 %arg , 31
2768
+ %cast = bitcast i32 %shl to float
2769
+ ret float %cast
2770
+ }
2771
+
2772
+ define float @bitcast_to_float_nzero (i32 %arg ) {
2773
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2774
+ ; CHECK-LABEL: define nofpclass(zero) float @bitcast_to_float_nzero
2775
+ ; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] {
2776
+ ; CHECK-NEXT: [[OR:%.*]] = or i32 [[ARG]], 134217728
2777
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast i32 [[OR]] to float
2778
+ ; CHECK-NEXT: ret float [[CAST]]
2779
+ ;
2780
+ %or = or i32 %arg , 134217728
2781
+ %cast = bitcast i32 %or to float
2782
+ ret float %cast
2783
+ }
2784
+
2785
+ define float @bitcast_to_float_inf (i32 %arg ) {
2786
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2787
+ ; CHECK-LABEL: define nofpclass(nan zero sub norm) float @bitcast_to_float_inf
2788
+ ; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] {
2789
+ ; CHECK-NEXT: [[SHR:%.*]] = shl i32 [[ARG]], 31
2790
+ ; CHECK-NEXT: [[OR:%.*]] = or i32 [[SHR]], 2139095040
2791
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast i32 [[OR]] to float
2792
+ ; CHECK-NEXT: ret float [[CAST]]
2793
+ ;
2794
+ %shr = shl i32 %arg , 31
2795
+ %or = or i32 %shr , 2139095040
2796
+ %cast = bitcast i32 %or to float
2797
+ ret float %cast
2798
+ }
2799
+
2745
2800
define double @bitcast_to_double_sign_0 (i64 %arg ) {
2746
2801
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2747
2802
; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) double @bitcast_to_double_sign_0
@@ -2757,7 +2812,7 @@ define double @bitcast_to_double_sign_0(i64 %arg) {
2757
2812
2758
2813
define double @bitcast_to_double_nnan (i64 %arg ) {
2759
2814
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2760
- ; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) double @bitcast_to_double_nnan
2815
+ ; CHECK-LABEL: define nofpclass(nan inf nzero nsub nnorm) double @bitcast_to_double_nnan
2761
2816
; CHECK-SAME: (i64 [[ARG:%.*]]) #[[ATTR3]] {
2762
2817
; CHECK-NEXT: [[SHR:%.*]] = lshr i64 [[ARG]], 2
2763
2818
; CHECK-NEXT: [[CAST:%.*]] = bitcast i64 [[SHR]] to double
@@ -2795,6 +2850,48 @@ define double @bitcast_to_double_nan(i64 %arg) {
2795
2850
}
2796
2851
2797
2852
2853
+ define double @bitcast_to_double_zero (i64 %arg ) {
2854
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2855
+ ; CHECK-LABEL: define nofpclass(nan inf sub norm) double @bitcast_to_double_zero
2856
+ ; CHECK-SAME: (i64 [[ARG:%.*]]) #[[ATTR3]] {
2857
+ ; CHECK-NEXT: [[SHL:%.*]] = shl i64 [[ARG]], 63
2858
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast i64 [[SHL]] to double
2859
+ ; CHECK-NEXT: ret double [[CAST]]
2860
+ ;
2861
+ %shl = shl i64 %arg , 63
2862
+ %cast = bitcast i64 %shl to double
2863
+ ret double %cast
2864
+ }
2865
+
2866
+ define double @bitcast_to_double_nzero (i64 %arg ) {
2867
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2868
+ ; CHECK-LABEL: define nofpclass(zero) double @bitcast_to_double_nzero
2869
+ ; CHECK-SAME: (i64 [[ARG:%.*]]) #[[ATTR3]] {
2870
+ ; CHECK-NEXT: [[OR:%.*]] = or i64 [[ARG]], 1152921504606846976
2871
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast i64 [[OR]] to double
2872
+ ; CHECK-NEXT: ret double [[CAST]]
2873
+ ;
2874
+ %or = or i64 %arg , 1152921504606846976
2875
+ %cast = bitcast i64 %or to double
2876
+ ret double %cast
2877
+ }
2878
+
2879
+ define double @bitcast_to_double_inf (i64 %arg ) {
2880
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2881
+ ; CHECK-LABEL: define nofpclass(nan zero sub norm) double @bitcast_to_double_inf
2882
+ ; CHECK-SAME: (i64 [[ARG:%.*]]) #[[ATTR3]] {
2883
+ ; CHECK-NEXT: [[SHR:%.*]] = shl i64 [[ARG]], 63
2884
+ ; CHECK-NEXT: [[OR:%.*]] = or i64 [[SHR]], 9218868437227405312
2885
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast i64 [[OR]] to double
2886
+ ; CHECK-NEXT: ret double [[CAST]]
2887
+ ;
2888
+ %shr = shl i64 %arg , 63
2889
+ %or = or i64 %shr , 9218868437227405312
2890
+ %cast = bitcast i64 %or to double
2891
+ ret double %cast
2892
+ }
2893
+
2894
+
2798
2895
define <2 x float > @bitcast_to_float_vect_sign_0 (<2 x i32 > %arg ) {
2799
2896
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2800
2897
; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) <2 x float> @bitcast_to_float_vect_sign_0
@@ -2810,7 +2907,7 @@ define <2 x float> @bitcast_to_float_vect_sign_0(<2 x i32> %arg) {
2810
2907
2811
2908
define <2 x float > @bitcast_to_float_vect_nnan (<2 x i32 > %arg ) {
2812
2909
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2813
- ; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) <2 x float> @bitcast_to_float_vect_nnan
2910
+ ; CHECK-LABEL: define nofpclass(nan inf nzero nsub nnorm) <2 x float> @bitcast_to_float_vect_nnan
2814
2911
; CHECK-SAME: (<2 x i32> [[ARG:%.*]]) #[[ATTR3]] {
2815
2912
; CHECK-NEXT: [[SHR:%.*]] = lshr <2 x i32> [[ARG]], <i32 4, i32 4>
2816
2913
; CHECK-NEXT: [[CAST:%.*]] = bitcast <2 x i32> [[SHR]] to <2 x float>
@@ -2847,6 +2944,32 @@ define <2 x float> @bitcast_to_float_vect_nan(<2 x i32> %arg) {
2847
2944
ret <2 x float > %cast
2848
2945
}
2849
2946
2947
+ define <2 x float > @bitcast_to_float_vect_conservative_1 (<2 x i32 > %arg ) {
2948
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2949
+ ; CHECK-LABEL: define <2 x float> @bitcast_to_float_vect_conservative_1
2950
+ ; CHECK-SAME: (<2 x i32> [[ARG:%.*]]) #[[ATTR3]] {
2951
+ ; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[ARG]], <i32 -2147483648, i32 0>
2952
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast <2 x i32> [[OR]] to <2 x float>
2953
+ ; CHECK-NEXT: ret <2 x float> [[CAST]]
2954
+ ;
2955
+ %or = or <2 x i32 > %arg , <i32 -2147483648 , i32 0 >
2956
+ %cast = bitcast <2 x i32 > %or to <2 x float >
2957
+ ret <2 x float > %cast
2958
+ }
2959
+
2960
+ define <2 x float > @bitcast_to_float_vect_conservative_2 (<2 x i32 > %arg ) {
2961
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
2962
+ ; CHECK-LABEL: define <2 x float> @bitcast_to_float_vect_conservative_2
2963
+ ; CHECK-SAME: (<2 x i32> [[ARG:%.*]]) #[[ATTR3]] {
2964
+ ; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[ARG]], <i32 0, i32 2139095041>
2965
+ ; CHECK-NEXT: [[CAST:%.*]] = bitcast <2 x i32> [[OR]] to <2 x float>
2966
+ ; CHECK-NEXT: ret <2 x float> [[CAST]]
2967
+ ;
2968
+ %or = or <2 x i32 > %arg , <i32 0 , i32 2139095041 >
2969
+ %cast = bitcast <2 x i32 > %or to <2 x float >
2970
+ ret <2 x float > %cast
2971
+ }
2972
+
2850
2973
declare i64 @_Z13get_global_idj (i32 noundef)
2851
2974
2852
2975
attributes #0 = { "denormal-fp-math" ="preserve-sign,preserve-sign" }
0 commit comments