From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17118 invoked by alias); 31 Oct 2010 02:32:34 -0000 Received: (qmail 17107 invoked by uid 22791); 31 Oct 2010 02:32:33 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_TM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 31 Oct 2010 02:32:29 +0000 Received: (qmail 2446 invoked from network); 31 Oct 2010 02:32:27 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 31 Oct 2010 02:32:27 -0000 Date: Sun, 31 Oct 2010 15:17:00 -0000 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Subject: use build_one_cst in tree-ssa-loop-im.c Message-ID: <20101031023224.GF6758@nightcrawler> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg02670.txt.bz2 This code in tree-ssa-loop-im.c: /* For vectors, create a VECTOR_CST full of 1's. */ if (TREE_CODE (type) == VECTOR_TYPE) { int i, len; tree list = NULL_TREE; real_one = build_real (TREE_TYPE (type), dconst1); len = TYPE_VECTOR_SUBPARTS (type); for (i = 0; i < len; i++) list = tree_cons (NULL, real_one, list); real_one = build_vector (type, list); } else real_one = build_real (type, dconst1); reduces to: if (TREE_CODE (type) == VECTOR_TYPE) { real_one = build_real (TREE_TYPE (type), dconst1); real_one = build_vector_from_val (type, real_one); } else real_one - build_real (type, dconst1); which is exactly what build_one_cst does. So call that instead. Tested on x86_64-unknown-linux-gnu. Committed as obvious. -Nathan * tree-ssa-loop-im.c (rewrite_reciprocal): Use build_one_cst. Index: tree-ssa-loop-im.c =================================================================== --- tree-ssa-loop-im.c (revision 166100) +++ tree-ssa-loop-im.c (working copy) @@ -910,19 +910,7 @@ rewrite_reciprocal (gimple_stmt_iterator add_referenced_var (var); DECL_GIMPLE_REG_P (var) = 1; - /* For vectors, create a VECTOR_CST full of 1's. */ - if (TREE_CODE (type) == VECTOR_TYPE) - { - int i, len; - tree list = NULL_TREE; - real_one = build_real (TREE_TYPE (type), dconst1); - len = TYPE_VECTOR_SUBPARTS (type); - for (i = 0; i < len; i++) - list = tree_cons (NULL, real_one, list); - real_one = build_vector (type, list); - } - else - real_one = build_real (type, dconst1); + real_one = build_one_cst (type); stmt1 = gimple_build_assign_with_ops (RDIV_EXPR, var, real_one, gimple_assign_rhs2 (stmt));