From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28412 invoked by alias); 31 Oct 2016 09:33:14 -0000 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 Received: (qmail 28399 invoked by uid 89); 31 Oct 2016 09:33:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=COND_EXPR, cond_expr, needlessly, father X-HELO: mail-vk0-f67.google.com Received: from mail-vk0-f67.google.com (HELO mail-vk0-f67.google.com) (209.85.213.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Oct 2016 09:33:03 +0000 Received: by mail-vk0-f67.google.com with SMTP id w194so1928887vkw.3 for ; Mon, 31 Oct 2016 02:33:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XsYbDCWunrFopdONbk1qYSEJcjmuzju2pM5YhEXqvE4=; b=MNHEVQgzExD4c2XaHq9ZZxPqmb+V55nDXAJwMLCVmgjEKeYahin0Llb6dGlCYcl+// mMb0rgoZ9wRNTvycx7kkD63NOEPp9X28HRSiJlY9EagPYb5tVRvos6zUQLYDu0LW0MnM JI0OOgb9awZ9jIsHPrFLVEDdRTUQQpIvCJG5ZqNluc4246aKtHQ+J8fgKnHwJ0b4+tP8 ya/CtO5ty0xgcXi7aDkOd78KynHGBSPjJMsXeKGLVcjsgljxAQpHNebmaKzqxwRCNYW2 QpPzUHZsO3tcaCa5XezVnefmhE+foh7/Q34O48x/V+3McZizFzfXHyd47+mpE4gJj56h A45g== X-Gm-Message-State: ABUngvcFke78FxfWzIvtU+l+0ZQM8C569NtBq676p9tW/xKM8zMG2fi65ryYu8GJHdYTl5YWHkCmXmfIdo5pUQ== X-Received: by 10.31.242.74 with SMTP id q71mr542640vkh.46.1477906382063; Mon, 31 Oct 2016 02:33:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.114.5 with HTTP; Mon, 31 Oct 2016 02:33:01 -0700 (PDT) In-Reply-To: References: From: "Bin.Cheng" Date: Mon, 31 Oct 2016 09:33:00 -0000 Message-ID: Subject: Re: [PATCH VECT]Support operand swapping for cond_expr in vect_slp To: Richard Biener Cc: "gcc-patches@gcc.gnu.org" Content-Type: multipart/mixed; boundary=94eb2c14bc9aea23c2054025e41d X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg02444.txt.bz2 --94eb2c14bc9aea23c2054025e41d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 2366 On Fri, Oct 28, 2016 at 1:17 PM, Richard Biener wrote: > On Thu, Oct 27, 2016 at 3:37 PM, Bin Cheng wrote: >> Hi, >> During analysis, vect_slp checks if statements of a group are isomorphic= to each other, specifically, all statements have to be isomorphic to the f= irst one. Apparently, operands of commutative operators (PLUS_EXPR/MINUS_E= XPR etc.) could be swapped when checking isomorphic property. Though vect_= slp has basic support for such commutative operators, the related code is n= ot properly implemented: >> 1) vect_build_slp_tree mixes operand swapping in the current slp tree = node and operand swapping in its child slp tree nodes. >> 2) Operand swapping in the current slp tree is incorrect when vect_get= _and_check_slp_defs has already committed to a fixed operand order. >> In addition, operand swapping for COND_EXPR is implemented in a wrong wa= y (place) because: >> 3) vect_get_and_check_slp_defs swaps operands for COND_EXPR by changin= g comparison code after vect_build_slp_tree_1 checks the code consistency f= or the statement group. >> 4) vect_build_slp_tree_1 should support operand swapping for COND_EXPR= while it doesn't. >> >> This patch addresses above issues. It supports COND_EXPR by recording s= wapping information in vect_build_slp_tree_1 and applies the swap in vect_g= et_check_slp_defs. It supports two types swapping: swapping and inverting.= The patch also does refactoring so that operand swapping in child slp tre= e node and the current slp tree node are differentiated. With this patch, = failures (gcc.dg/vect/slp-cond-3.c) revealed by previous COND_EXPR match.pd= patches are resolved. >> Bootstrap and test on x86_64 and AArch64. Is it OK? > > Ok, but please re-instantiate the early-out here: Thanks for reviewing. > > @@ -905,18 +960,10 @@ vect_build_slp_tree (vec_info *vinfo, > slp_oprnd_info oprnd_info; > FOR_EACH_VEC_ELT (stmts, i, stmt) > { > - switch (vect_get_and_check_slp_defs (vinfo, stmt, i, &oprnds_info)) > - { > - case 0: > - break; > - case -1: > - matches[0] =3D false; > - vect_free_oprnd_info (oprnds_info); > - return NULL; > > ^^^^ > > you seem to needlessly continue checking other DEFs if one returns -1. Yes, updated patch committed. Thanks, bin --94eb2c14bc9aea23c2054025e41d Content-Type: text/plain; charset=US-ASCII; name="slp-swap-cond_expr-20161028.txt" Content-Disposition: attachment; filename="slp-swap-cond_expr-20161028.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iuxvaguu0 Content-length: 11473 ZGlmZiAtLWdpdCBhL2djYy90cmVlLXZlY3Qtc2xwLmMgYi9nY2MvdHJlZS12 ZWN0LXNscC5jCmluZGV4IDVhNjExZTQuLjYyZjA2MGMgMTAwNjQ0Ci0tLSBh L2djYy90cmVlLXZlY3Qtc2xwLmMKKysrIGIvZ2NjL3RyZWUtdmVjdC1zbHAu YwpAQCAtMjA3LDE0ICsyMDcsMjAgQEAgdmVjdF9nZXRfcGxhY2VfaW5faW50 ZXJsZWF2aW5nX2NoYWluIChnaW1wbGUgKnN0bXQsIGdpbXBsZSAqZmlyc3Rf c3RtdCkKIAogLyogR2V0IHRoZSBkZWZzIGZvciB0aGUgcmhzIG9mIFNUTVQg KGNvbGxlY3QgdGhlbSBpbiBPUFJORFNfSU5GTyksIGNoZWNrIHRoYXQKICAg IHRoZXkgYXJlIG9mIGEgdmFsaWQgdHlwZSBhbmQgdGhhdCB0aGV5IG1hdGNo IHRoZSBkZWZzIG9mIHRoZSBmaXJz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isgICAgICBzd2FwW2ldID0gMDsKICAgICAgIG1hdGNo ZXNbaV0gPSBmYWxzZTsKIAogICAgICAgaWYgKGR1bXBfZW5hYmxlZF9wICgp KQpAQCAtNzgyLDI2ICs4MTgsNDQgQEAgdmVjdF9idWlsZF9zbHBfdHJlZV8x ICh2ZWNfaW5mbyAqdmluZm8sCiAJICAgICAgcmV0dXJuIGZhbHNlOwogCSAg ICB9CiAKLSAgICAgICAgICBpZiAocmhzX2NvZGUgPT0gQ09ORF9FWFBSKQot ICAgICAgICAgICAgewotICAgICAgICAgICAgICB0cmVlIGNvbmRfZXhwciA9 IGdpbXBsZV9hc3NpZ25fcmhzMSAoc3RtdCk7CisJICBpZiAocmhzX2NvZGUg PT0gQ09ORF9FWFBSKQorCSAgICB7CisJICAgICAgdHJlZSBjb25kX2V4cHIg PSBnaW1wbGVfYXNzaWduX3JoczEgKHN0bXQpOworCSAgICAgIGVudW0gdHJl ZV9jb2RlIGNvbmRfY29kZSA9IFRSRUVfQ09ERSAoY29uZF9leHByKTsKKwkg ICAgICBlbnVtIHRyZWVfY29kZSBzd2FwX2NvZGUgPSBFUlJPUl9NQVJLOwor CSAgICAgIGVudW0gdHJlZV9jb2RlIGludmVydF9jb2RlID0gRVJST1JfTUFS SzsKIAogCSAgICAgIGlmIChpID09IDApCiAJCWZpcnN0X2NvbmRfY29kZSA9 IFRSRUVfQ09ERSAoY29uZF9leHByKTsKLSAgICAgICAgICAgICAgZWxzZSBp ZiAoZmlyc3RfY29uZF9jb2RlICE9IFRSRUVfQ09ERSAoY29uZF9leHByKSkK LSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICBpZiAoZHVt cF9lbmFibGVkX3AgKCkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAg ICAgICAgICAgICAgICAgICBkdW1wX3ByaW50Zl9sb2MgKE1TR19NSVNTRURf T1BUSU1JWkFUSU9OLCB2ZWN0X2xvY2F0aW9uLAorCSAgICAgIGVsc2UgaWYg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