From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF3383858C98; Sun, 10 Mar 2024 22:29:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF3383858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710109766; bh=WeVFtSHVRdPYirnbeMSfMRnr9wx8//oL5tsqyzQeHvU=; h=From:To:Subject:Date:From; b=dKJ8zggpJdd6oWur2PWiuGAayZrn+ldxJBPypore1IS1gZUc1FfaUbDFyR41yA65y 0youZS55q4+2iZCYuFjUKcqOGYi8Lvz3VLdtVsDwCOaCFmyQwfJy68EsJumNT7nANx UeK7AMbD675dXM+XFK80sNTDvO1MET638WoJJlzI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114301] New: gimple_can_duplicate_bb_p check for returns twice can be moved to the check of the last statement Date: Sun, 10 Mar 2024 22:29:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: compile-time-hog, internal-improvement X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114301 Bug ID: 114301 Summary: gimple_can_duplicate_bb_p check for returns twice can be moved to the check of the last statement Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: compile-time-hog, internal-improvement Severity: enhancement Priority: P3 Component: tree-optimization Assignee: pinskia at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- It is the case that the returns twice function will always be the last statement of the BB so the check for that can be moved up to the check of t= he last statement part. This is a small optimization as gimple_call_flags (whi= ch calls flags_from_decl_or_type) can call special_function_p and special_function_p does string comparisons in the end. So removing as many calls to gimple_call_flags can speed up GCC slightly.=