From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32644 invoked by alias); 1 Dec 2014 14:15:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 32586 invoked by uid 48); 1 Dec 2014 14:15:19 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level Date: Mon, 01 Dec 2014 14:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: tree-ssa X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg00096.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14541 --- Comment #16 from Richard Biener --- (for logfn (BUILT_IN_LOGF BUILT_IN_LOG BUILT_IN_LOGL) expfn (BUILT_IN_EXPF BUILT_IN_EXP BUILT_IN_EXPL) (simplify (logfn (expfn @0)) (if (flag_unsafe_math_optimizations) @0))) with the still somewhat awkward syntax, patch for proposed better one is not yet ready but would look like (define_operator_list log (BUILT_IN_LOGF BUILT_IN_LOG BUILT_IN_LOGL)) (define_operator_list exp (BUILT_IN_EXPF BUILT_IN_EXP BUILT_IN_EXPL)) (simplify (log (exp @0)) (if (flag_unsafe_math_optimizations) @0))) thus the 'for' would be implicit. Note that fold_builtin_logarithm does handle some more cases. The match-and-simplify branch already covers quite some patterns in match-builtins.def (but not the above). I'll see if I can take the syntax patch (I was waiting for that so not to merge the "ugly" syntax).