From patchwork Fri Jul 13 08:11:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 170814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4AD222C0355 for ; Fri, 13 Jul 2012 18:11:42 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1342771903; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=fgMJKtYlK1O9Kc2jBywD DjpfPTQ=; b=WOzhrKzvbwWWyfLLn6trM+cIS2AFIDwMAkVrUFKupb7scs0dRp/j Hmgue7COdSX5Xzh0sBzoiisyPJ4DOSfF1WgYoeycSxYvKQM/LH+PX3G6ti9+hwTW ugqx5/UxIi8W944TyxABP30FXGG7VUMU+1CuF6Rn0LARHatIAdGubmo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=nWdz5VMCj8lwSg+RkUyup0/eNqvoctoNynOGFHpMtglyEz2iIInuBzR6ab+Jmv HaaJwBkzgj+mzhqqxY16bKTGtKnEA9db6vPeKujt3+JQvVHkV8/OPE6MKqxOay4P 5tL+FEZN1ELC+5ePZW0GOwh0epsd4FRTEiRdYpC+vU+6g=; Received: (qmail 15732 invoked by alias); 13 Jul 2012 08:11:37 -0000 Received: (qmail 15719 invoked by uid 22791); 13 Jul 2012 08:11:35 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Jul 2012 08:11:13 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id CFD809FB23 for ; Fri, 13 Jul 2012 10:11:12 +0200 (CEST) Date: Fri, 13 Jul 2012 10:11:12 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Make LTO type merging cheaper Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org A patch that's in my local tree for quite some time. This removes redundant tests. LTO bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2012-07-13 Richard Guenther * gimple.c (gimple_types_compatible_p_1): Remove redundant type attribute comparisons. (gimple_canonical_types_compatible_p): Likewise. Index: gcc/gimple.c =================================================================== --- gcc/gimple.c (revision 189311) +++ gcc/gimple.c (working copy) @@ -3422,10 +3422,6 @@ gimple_types_compatible_p_1 (tree t1, tr goto different_types; } - /* If their attributes are not the same they can't be the same type. */ - if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2))) - goto different_types; - /* Do type-specific comparisons. */ switch (TREE_CODE (t1)) { @@ -4449,10 +4445,6 @@ gimple_canonical_types_compatible_p (tre return true; } - /* If their attributes are not the same they can't be the same type. */ - if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2))) - return false; - /* Do type-specific comparisons. */ switch (TREE_CODE (t1)) { @@ -4499,13 +4491,6 @@ gimple_canonical_types_compatible_p (tre } case METHOD_TYPE: - /* Method types should belong to the same class. */ - if (!gimple_canonical_types_compatible_p - (TYPE_METHOD_BASETYPE (t1), TYPE_METHOD_BASETYPE (t2))) - return false; - - /* Fallthru */ - case FUNCTION_TYPE: /* Function types are the same if the return type and arguments types are the same. */