;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. ;; RUN: wasm-opt %s --optimize-instructions --enable-nontrapping-float-to-int -S -o - | filecheck %s (module (memory 0) ;; CHECK: (func $simplify_int_float_sat_conversion_roundtrips (param $x i32) (param $y i64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.trunc_sat_f64_s ;; CHECK-NEXT: (f64.convert_i32_u ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.trunc_sat_f64_u ;; CHECK-NEXT: (f64.convert_i32_s ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.trunc_sat_f32_u ;; CHECK-NEXT: (f32.convert_i32_u ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.trunc_sat_f64_u ;; CHECK-NEXT: (f64.convert_i64_u ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i64.trunc_sat_f64_s ;; CHECK-NEXT: (f64.convert_i64_s ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i64.trunc_sat_f32_u ;; CHECK-NEXT: (f32.convert_i32_s ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i64.trunc_sat_f32_s ;; CHECK-NEXT: (f32.convert_i64_s ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $simplify_int_float_sat_conversion_roundtrips (param $x i32) (param $y i64) (drop (i32.trunc_sat_f64_u (f64.convert_i32_u (local.get $x)))) (drop (i32.trunc_sat_f64_s (f64.convert_i32_s (local.get $x)))) ;; skips (drop (i32.trunc_sat_f64_s (f64.convert_i32_u (local.get $x)))) (drop (i32.trunc_sat_f64_u (f64.convert_i32_s (local.get $x)))) (drop (i32.trunc_sat_f32_u (f32.convert_i32_u (local.get $x)))) (drop (i32.trunc_sat_f64_u (f64.convert_i64_u (local.get $y)))) (drop (i64.trunc_sat_f64_s (f64.convert_i64_s (local.get $y)))) (drop (i64.trunc_sat_f32_u (f32.convert_i32_s (local.get $x)))) (drop (i64.trunc_sat_f32_s (f32.convert_i64_s (local.get $y)))) ) )