From 93956dc1ef82e65001a6f3adf02e9ab20061b4c6 Mon Sep 17 00:00:00 2001 From: Pierre Chambart Date: Fri, 22 Jan 2016 09:36:59 +0100 Subject: [PATCH] Avoid pushing test deep inside conditions --- asmcomp/cmmgen.ml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/asmcomp/cmmgen.ml b/asmcomp/cmmgen.ml index 334cee8a9..59c0d4799 100644 --- a/asmcomp/cmmgen.ml +++ b/asmcomp/cmmgen.ml @@ -432,7 +432,7 @@ let safe_mod_bi = (* Bool *) -let rec test_bool = function +let test_bool = function Cop(Caddi, [Cop(Clsl, [c; Cconst_int 1]); Cconst_int 1]) -> c | Cop(Clsl, [c; Cconst_int 1]) -> c | Cconst_int n -> @@ -440,10 +440,6 @@ let rec test_bool = function Cconst_int 0 else Cconst_int 1 - | Clet(id, exp, body) -> - Clet(id, exp, test_bool body) - | Cifthenelse(cond, ifso, ifnot) -> - Cifthenelse(cond, test_bool ifso, test_bool ifnot) | c -> Cop(Ccmpi Cne, [c; Cconst_int 1]) (* Float *)