From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 32EEE3858C55 for ; Fri, 8 Jul 2022 21:53:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 32EEE3858C55 Received: by mail-wr1-x42b.google.com with SMTP id z12so32921wrq.7 for ; Fri, 08 Jul 2022 14:53:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:message-id:subject:mime-version :list-id; bh=4M3Qw2YavBcTO73nVxh+b/dj3fcUeMqecbCFSovYcs0=; b=epEtCYABdfw4mMS38RjuPb7isytEQUoqmVZoURMmF11XmchSjTgdmircdKPm8K/wvA tfj7v7JBI5DSRHSOHm3BjyzMzjjWGnPGXclxsI+V4v47uhEh1ei9AnGgPWDfAzwr0aJx ypDl9owsHNUc6p71nzMWIXDgkyFmWVUtTEP0BBRqWpyNKChms28QtKsaTMNqYrCfeC4c GTjtiv2SoMAZRMI5jv2bzPnzN7ThfPbA4OWD+I0g13RLIy8R72hIlZwUUM7gw/CECrQl VEykUVh8Ccu8zfPHdqUUYuDUBXWMDL8hi0EICfgvGLhJqQpLi0kN34Ug8iR5sOOMGpfo Xe2w== X-Gm-Message-State: AJIora8k+r1odTO24Yoyr0jMaOzpFcP/qqrsLwdSIVQ9PCLiO2k8R/yd DfoQhKj1hhk5EpCi42w+0dx+qA== X-Google-Smtp-Source: AGRyM1vDYyW8BSCR8o3J5NWKLplo5foDW3b57ECzxUqwUS58XZfiS7wR469UiYCg6mX1j5cRhHOEmA== X-Received: by 2002:a05:6000:54f:b0:21b:944c:c70b with SMTP id b15-20020a056000054f00b0021b944cc70bmr5285175wrf.572.1657317187874; Fri, 08 Jul 2022 14:53:07 -0700 (PDT) Received: from jenkins.jenkins (ci.linaro.org. [88.99.136.175]) by smtp.gmail.com with ESMTPSA id c187-20020a1c35c4000000b003a2cf1ba9e2sm3355736wma.6.2022.07.08.14.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 14:53:07 -0700 (PDT) From: ci_notify@linaro.org X-Google-Original-From: linaro-infrastructure-errors@lists.linaro.org Date: Fri, 8 Jul 2022 21:53:05 +0000 (UTC) To: Richard Biener Cc: gcc-regression@gcc.gnu.org Message-ID: <1428096119.319.1657317187332@jenkins.jenkins> Subject: [TCWG CI] Regression caused by gcc: tree-optimization/106226 - move vectorizer virtual SSA update MIME-Version: 1.0 X-Jenkins-Job: TCWG Bisect tcwg_gcc_bootstrap/master-arm-bootstrap X-Jenkins-Result: SUCCESS X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2022 21:53:12 -0000 [TCWG CI] Regression caused by gcc: tree-optimization/106226 - move vectorizer virtual SSA update: commit cf3a120084e94614a4917f71940325cd4b537f24 Author: Richard Biener tree-optimization/106226 - move vectorizer virtual SSA update Results regressed to # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # First few build errors in logs: # 00:05:38 make[3]: [Makefile:1787: armv8l-unknown-linux-gnueabihf/bits/largefile-config.h] Error 1 (ignored) # 00:08:06 /home/tcwg-buildslave/workspace/tcwg_gnu_14/abe/snapshots/gcc.git~master/libiberty/sha1.c:286:1: internal compiler error: in vect_transform_loops, at tree-vectorizer.cc:1032 # 00:08:07 make[3]: *** [Makefile:1284: sha1.o] Error 1 # 00:08:23 make[2]: *** [Makefile:12585: all-stage2-libiberty] Error 2 # 00:08:24 make[1]: *** [Makefile:25739: stage2-bubble] Error 2 # 00:08:24 make: *** [Makefile:1072: all] Error 2 from # reset_artifacts: -10 # true: 0 # build_abe binutils: 1 # build_abe bootstrap: 2 THIS IS THE END OF INTERESTING STUFF. BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT. This commit has regressed these CI configurations: - tcwg_gcc_bootstrap/master-arm-bootstrap First_bad build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-arm-bootstrap/18/artifact/artifacts/build-cf3a120084e94614a4917f71940325cd4b537f24/ Last_good build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-arm-bootstrap/18/artifact/artifacts/build-95a234f5cbd510e6b8c8e53dd9f1003fddc84c28/ Baseline build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-arm-bootstrap/18/artifact/artifacts/build-baseline/ Even more details: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-arm-bootstrap/18/artifact/artifacts/ Reproduce builds: mkdir investigate-gcc-cf3a120084e94614a4917f71940325cd4b537f24 cd investigate-gcc-cf3a120084e94614a4917f71940325cd4b537f24 # Fetch scripts git clone https://git.linaro.org/toolchain/jenkins-scripts # Fetch manifests and test.sh script mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-arm-bootstrap/18/artifact/artifacts/manifests/build-baseline.sh --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-arm-bootstrap/18/artifact/artifacts/manifests/build-parameters.sh --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-arm-bootstrap/18/artifact/artifacts/test.sh --fail chmod +x artifacts/test.sh # Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh # Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/ cd gcc # Reproduce first_bad build git checkout --detach cf3a120084e94614a4917f71940325cd4b537f24 ../artifacts/test.sh # Reproduce last_good build git checkout --detach 95a234f5cbd510e6b8c8e53dd9f1003fddc84c28 ../artifacts/test.sh cd .. Full commit (up to 1000 lines): commit cf3a120084e94614a4917f71940325cd4b537f24 Author: Richard Biener Date: Fri Jul 8 10:41:59 2022 +0200 tree-optimization/106226 - move vectorizer virtual SSA update When we knowingly have broken virtual SSA form we need to update it before we eventually perform slpeel manual updating which will call delete_update_ssa. Currently that's done on-demand but communicating whether it's a known unavoidable case is broken there. The following makes that a synchronous operation but instead of actually performing the update we instead recod the need, clear the update SSA sub-state and force virtual renaming at the very end of the vectorization pass. PR tree-optimization/106226 * tree-vect-loop-manip.cc (vect_do_peeling): Assert that no SSA update is needed. Move virtual SSA update ... * tree-vectorizer.cc (pass_vectorize::execute): ... here, via forced virtual renaming when TODO_update_ssa_only_virtuals is queued. (vect_transform_loops): Return TODO_update_ssa_only_virtuals when virtual SSA update is required. (try_vectorize_loop_1): Adjust. * tree-vect-stmts.cc (vectorizable_simd_clone_call): Allow virtual renaming if the ABI forces an aggregate return but the original call did not have a virtual definition. * gfortran.dg/pr106226.f: New testcase. --- gcc/testsuite/gfortran.dg/pr106226.f | 37 ++++++++++++++++++++++++++++++++++++ gcc/tree-vect-loop-manip.cc | 11 +++++------ gcc/tree-vect-stmts.cc | 8 ++++++++ gcc/tree-vectorizer.cc | 29 +++++++++++++++++++++++++--- 4 files changed, 76 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/gfortran.dg/pr106226.f b/gcc/testsuite/gfortran.dg/pr106226.f new file mode 100644 index 00000000000..19237bc5a71 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr106226.f @@ -0,0 +1,37 @@ +! { dg-do compile } +! { dg-options "-O3 -std=legacy" } + + SUBROUTINE EFTORD(DM,CHDINT,L4) + IMPLICIT DOUBLE PRECISION (A-H,O-Z) + PARAMETER (MXPT=100, MXFRG=50, MXFGPT=MXPT*MXFRG) + DIMENSION DM(*),CHDINT(L4) + COMMON /FGRAD / DEF0,DEFT0,TORQ0 + * ,ATORQ(3,MXFRG) + COMMON /CSSTV / CX,CY,CZ + * EFBTRM(MXFGPT),EFATRM2(MXFGPT),EFBTRM2(MXFGPT), + * EFDIP(3,MXFGPT),EFQAD(6,MXFGPT), + * EFOCT(10,MXFGPT),FRGNME(MXFGPT) + IF(NROOTS.EQ.5) CALL ROOT5 + IF(NROOTS.EQ.6) CALL ROOT6 + IF(NROOTS.GE.7) THEN + CALL ABRT + END IF + DO 403 I = 1,IJ + CHDINT(ICC)=CHDINT(ICC)-DUM*DUMY + ICC=ICC+1 + 403 CONTINUE + CHDINT(ICC)=CHDINT(ICC)-DUM*DUMY + DO 550 J=MINJ,MAX + LJ=LOCJ+J + IF (LI-LJ) 920,940,940 + 920 ID = LJ + GO TO 960 + 940 ID = LI + 960 NN = (ID*(ID-1))/2+JD + DUM = DM(NN) + ATORQ(1,INF)=ATORQ(1,INF)-DUM*(CHDINT(ICC+1)*EFDIP(3,IC) + $ -CHDINT(ICC+2)*EFDIP(2,IC)) + ICC=ICC+1 + ICC=ICC+1 + 550 CONTINUE + END diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index d7410d7b4bd..2c2b4f7bd53 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -2696,12 +2696,11 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, class loop *first_loop = loop; bool irred_flag = loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP; - /* We should not have to update virtual SSA form here but some - transforms involve creating new virtual definitions which makes - updating difficult. */ - gcc_assert (!need_ssa_update_p (cfun) - || loop_vinfo->any_known_not_updated_vssa); - update_ssa (TODO_update_ssa_only_virtuals); + /* SSA form needs to be up-to-date since we are going to manually + update SSA form in slpeel_tree_duplicate_loop_to_edge_cfg and delete all + update SSA state after that, so we have to make sure to not lose any + pending update needs. */ + gcc_assert (!need_ssa_update_p (cfun)); create_lcssa_for_virtual_phi (loop); diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 3db6620dd42..01d982eea98 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -4247,6 +4247,14 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info, if (!vec_stmt) /* transformation not required. */ { + /* When the original call is pure or const but the SIMD ABI dictates + an aggregate return we will have to use a virtual definition and + in a loop eventually even need to add a virtual PHI. That's + not straight-forward so allow to fix this up via renaming. */ + if (gimple_call_lhs (stmt) + && !gimple_vdef (stmt) + && TREE_CODE (TREE_TYPE (TREE_TYPE (bestn->decl))) == ARRAY_TYPE) + vinfo->any_known_not_updated_vssa = true; STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (bestn->decl); for (i = 0; i < nargs; i++) if ((bestn->simdclone->args[i].arg_type diff --git a/gcc/tree-vectorizer.cc b/gcc/tree-vectorizer.cc index 53dc4520963..6ec49511d74 100644 --- a/gcc/tree-vectorizer.cc +++ b/gcc/tree-vectorizer.cc @@ -82,6 +82,7 @@ along with GCC; see the file COPYING3. If not see #include "opt-problem.h" #include "internal-fn.h" #include "tree-ssa-sccvn.h" +#include "tree-into-ssa.h" /* Loop or bb location, with hotness information. */ dump_user_location_t vect_location; @@ -982,7 +983,7 @@ set_uid_loop_bbs (loop_vec_info loop_vinfo, gimple *loop_vectorized_call, /* Generate vectorized code for LOOP and its epilogues. */ -static void +static unsigned vect_transform_loops (hash_table *&simduid_to_vf_htab, loop_p loop, gimple *loop_vectorized_call, function *fun) @@ -1020,9 +1021,25 @@ vect_transform_loops (hash_table *&simduid_to_vf_htab, = simduid_to_vf_data; } + /* We should not have to update virtual SSA form here but some + transforms involve creating new virtual definitions which makes + updating difficult. + We delay the actual update to the end of the pass but avoid + confusing ourselves by forcing need_ssa_update_p () to false. */ + unsigned todo = 0; + if (need_ssa_update_p (cfun)) + { + gcc_assert (loop_vinfo->any_known_not_updated_vssa); + fun->gimple_df->ssa_renaming_needed = false; + todo |= TODO_update_ssa_only_virtuals; + } + gcc_assert (!need_ssa_update_p (cfun)); + /* Epilogue of vectorized loop must be vectorized too. */ if (new_loop) - vect_transform_loops (simduid_to_vf_htab, new_loop, NULL, fun); + todo |= vect_transform_loops (simduid_to_vf_htab, new_loop, NULL, fun); + + return todo; } /* Try to vectorize LOOP. */ @@ -1133,7 +1150,8 @@ try_vectorize_loop_1 (hash_table *&simduid_to_vf_htab, (*num_vectorized_loops)++; /* Transform LOOP and its epilogues. */ - vect_transform_loops (simduid_to_vf_htab, loop, loop_vectorized_call, fun); + ret |= vect_transform_loops (simduid_to_vf_htab, loop, + loop_vectorized_call, fun); if (loop_vectorized_call) { @@ -1332,6 +1350,11 @@ pass_vectorize::execute (function *fun) if (num_vectorized_loops > 0) { + /* We are collecting some corner cases where we need to update + virtual SSA form via the TODO but delete the queued update-SSA + state. Force renaming if we think that might be necessary. */ + if (ret & TODO_update_ssa_only_virtuals) + mark_virtual_operands_for_renaming (cfun); /* If we vectorized any loop only virtual SSA form needs to be updated. ??? Also while we try hard to update loop-closed SSA form we fail to properly do this in some corner-cases (see PR56286). */ >>From hjl@sc.intel.com Fri Jul 8 22:48:54 2022 Return-Path: X-Original-To: gcc-regression@gcc.gnu.org Delivered-To: gcc-regression@gcc.gnu.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id CDFC3385840C for ; Fri, 8 Jul 2022 22:48:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CDFC3385840C X-IronPort-AV: E=McAfee;i="6400,9594,10402"; a="309967744" X-IronPort-AV: E=Sophos;i="5.92,256,1650956400"; d="scan'208";a="309967744" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2022 15:48:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,256,1650956400"; d="scan'208";a="569106416" Received: from scymds02.sc.intel.com ([10.82.73.244]) by orsmga006.jf.intel.com with ESMTP; 08 Jul 2022 15:48:50 -0700 Received: from gnu-snb-1.sc.intel.com (gnu-snb-1.sc.intel.com [172.25.33.219]) by scymds02.sc.intel.com with ESMTP id 268Mmoxr014415; Fri, 8 Jul 2022 15:48:50 -0700 Received: by gnu-snb-1.sc.intel.com (Postfix, from userid 1000) id D3B6A1817F8; Fri, 8 Jul 2022 15:48:50 -0700 (PDT) Date: Fri, 08 Jul 2022 15:48:50 -0700 To: skpgkp2@gmail.com, hjl.tools@gmail.com, gcc-regression@gcc.gnu.org Subject: Regressions on master at commit r13-1579 vs commit r13-1576 on Linux/i686 User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20220708224850.D3B6A1817F8@gnu-snb-1.sc.intel.com> From: "H.J. Lu" X-Spam-Status: No, score=-3459.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2022 22:48:54 -0000 New failures: FAIL: libgomp.fortran/target-nowait-array-section.f90 -O execution test New passes: FAIL: gcc.dg/tree-ssa/alias-access-path-13.c scan-tree-dump-times fre1 "return 123" 1