From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 7B12D39BE821; Fri, 11 Jun 2021 07:30:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B12D39BE821 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1377] Use stablesort for sorting association chain X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 367f52dcc24045b072aeb26bc301a2980b39241f X-Git-Newrev: e9d322ced1433da8e7c69243cfa941ea462d6290 Message-Id: <20210611073000.7B12D39BE821@sourceware.org> Date: Fri, 11 Jun 2021 07:30:00 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 07:30:00 -0000 https://gcc.gnu.org/g:e9d322ced1433da8e7c69243cfa941ea462d6290 commit r12-1377-ge9d322ced1433da8e7c69243cfa941ea462d6290 Author: Richard Biener Date: Fri Jun 11 08:04:41 2021 +0200 Use stablesort for sorting association chain This should preserve the original association order as much as possible for the initial SLP discovery attempt and also improve consistency. 2021-06-11 Richard Biener * tree-vect-slp.c (vect_build_slp_tree_2): Use stablesort to sort operands of the associative chain. Diff: --- gcc/tree-vect-slp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index c4f8f38012f..6237a61ffd4 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1865,7 +1865,7 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node, /* Now we have a set of chains with the same length. */ /* 1. pre-sort according to def_type and operation. */ for (unsigned lane = 0; lane < group_size; ++lane) - chains[lane].sort (dt_sort_cmp, vinfo); + chains[lane].stablesort (dt_sort_cmp, vinfo); if (dump_enabled_p ()) { dump_printf_loc (MSG_NOTE, vect_location,