From: Bin Cheng Date: Thu, 24 Nov 2016 12:09:19 +0000 (+0000) Subject: match.pd: Refine type conversion in result expr for below pattern: (cond (cmp (convert1? X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21aaaf1e050fac4eb5edd66489cc5c6f1b332b75;p=gcc.git match.pd: Refine type conversion in result expr for below pattern: (cond (cmp (convert1? * match.pd: Refine type conversion in result expr for below pattern: (cond (cmp (convert1? x) c1) (convert2? x) c2) -> (minmax (x c)). From-SVN: r242831 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 61f35aee1e0..7a22234ed92 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-24 Bin Cheng + + * match.pd: Refine type conversion in result expr for below pattern: + (cond (cmp (convert1? x) c1) (convert2? x) c2) -> (minmax (x c)). + 2016-11-24 Eric Botcazou PR middle-end/78429 diff --git a/gcc/match.pd b/gcc/match.pd index e3f85140e1e..3aa27fae746 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -2022,11 +2022,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) } } (if (code == MAX_EXPR) - (convert (max @1 (convert:from_type @2))) + (convert (max @1 (convert @2))) (if (code == MIN_EXPR) - (convert (min @1 (convert:from_type @2))) + (convert (min @1 (convert @2))) (if (code == EQ_EXPR) - (cond (cmp @1 (convert:from_type @3)) (convert:from_type @3) @2))))))) + (convert (cond (cmp @1 (convert @3)) + (convert:from_type @3) (convert:from_type @2))))))))) (for cnd (cond vec_cond) /* A ? B : (A ? X : C) -> A ? B : C. */