File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -754,15 +754,23 @@ func.func @truncExtf3(%arg0: f32) -> f16 {
754754}
755755
756756// CHECK-LABEL: @truncSitofp
757- // CHECK-NOT: truncf
758757// CHECK: %[[SITOFP:.*]] = arith.sitofp %[[ARG0:.*]] : i32 to f32
758+ // CHECK-NOT: truncf
759759// CHECK: return %[[SITOFP]]
760760func.func @truncSitofp (%arg0: i32 ) -> f32 {
761761 %sitofp = arith.sitofp %arg0 : i32 to f64
762762 %trunc = arith.truncf %sitofp : f64 to f32
763763 return %trunc : f32
764764}
765765
766+ // CHECK-LABEL: @truncSitofpConstrained
767+ // CHECK: truncf
768+ func.func @truncSitofpConstrained (%arg0: i32 ) -> f32 {
769+ %sitofp = arith.sitofp %arg0 : i32 to f64
770+ %trunc = arith.truncf %sitofp to_nearest_even : f64 to f32
771+ return %trunc : f32
772+ }
773+
766774// TODO: We should also add a test for not folding arith.extf on information loss.
767775// This may happen when extending f8E5M2FNUZ to f16.
768776
You can’t perform that action at this time.
0 commit comments