From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by sourceware.org (Postfix) with ESMTPS id 708A93870869 for ; Fri, 12 Jun 2020 09:43:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 708A93870869 Received: by mail-ed1-x543.google.com with SMTP id x93so5972042ede.9 for ; Fri, 12 Jun 2020 02:43:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dqmnkWew98M/HiIpyRalaXCMTdKRkquWEVp12gSz964=; b=JrJ0LrWtoK5mTIihUY18QadnFqKMJhrGmBQkl4MMcWQDOVzFZ43qolDcTkSv/o63pv sRcr6C1O3oxzxSOYjv40cn+G4ZjXHqIysK8tR7fVjSJ/DYjiG4hE6+sacUMq9XiYun4Y lCIMol9S0RvUIgk36Q92MdfvovsobeCOr77D/NCVDdl4c+9Jmb/Wo8PQO3c2pPVzodUC 7w1D8eF0UsMlDXNYHww0GRuCw0uQ1TLPSmhg5f3+OFJ9qNqCHLtYra2KIikTYXWAnOem EXOEZnWEjnmKwXwzzrZZhiqNK+YafdNxXou+Hpp/pn/CGeveeDg9nsiNrLYKqu8EA1Yl kBxA== X-Gm-Message-State: AOAM531+M7TgQD/DwrOXn9qsyfU5k0xMtJfhHverd4IRoG3nuQuq6hDD rH2PHj3JOhB0Wr23jc20Hv0B8qUslkrS8tINko0= X-Google-Smtp-Source: ABdhPJzbAA9DFKbJpzjz/yQQKZkVZvCP9zn9vhQFAQhaMOGAW4Q2qDtiuADeDuSLGmwmv3wVPgoSpwQW4CpGF1byu8I= X-Received: by 2002:aa7:c607:: with SMTP id h7mr11132277edq.214.1591955030439; Fri, 12 Jun 2020 02:43:50 -0700 (PDT) MIME-Version: 1.0 References: <20200529153933.GW31009@gate.crashing.org> <20200529170936.GY31009@gate.crashing.org> <20200529173758.GA31009@gate.crashing.org> <20200530130801.GD31009@gate.crashing.org> <16e3957c-e390-5984-b14e-dd3c70c3bd1c@suse.cz> <20200603182734.GA31009@gate.crashing.org> <3932cb72-4529-6755-bb35-45e11f1c3382@suse.cz> <77faed30-2ed8-8319-f552-34cad171c927@suse.cz> In-Reply-To: <77faed30-2ed8-8319-f552-34cad171c927@suse.cz> From: Richard Biener Date: Fri, 12 Jun 2020 11:43:38 +0200 Message-ID: Subject: Re: [stage1][PATCH] Lower VEC_COND_EXPR into internal functions. To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: Segher Boessenkool , GCC Patches , Richard Sandiford , David Edelsohn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 09:43:52 -0000 On Thu, Jun 11, 2020 at 10:52 AM Martin Li=C5=A1ka wrote: > > On 6/9/20 3:42 PM, Richard Biener wrote: > > I think we need to fix that before merging. > > There's updated version of the patch that should handle the EH properly. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? I think it would be better to avoid creating of a new edge and removing the= old by simply moving the condition stmt to the normal outgoing edge. Thus in expand_vector_condition do if (lookup_stmt_eh_lp (stmt) !=3D 0) { maybe_clean_or_replace_eh_stmt (stmt, assign); gsi_remove (gsi, false); edge_iterator ei; edge e; FOR_EACH_EDGE (e, ei, gimple_bb (assign)->succs) if (e->flags & EDGE_EH) break; if (e) { gsi_remove (gsi, false); gsi_insert_on_edge_immediate (e, stmt); } else gsi_remove (gsi, true); } a twist is probably the following which shows how we wrongly make 'res' available in the catch block. The above would break (your variant as well) since SSA form is broken afterwards. This of course solves itself when we not start with the broken IL in the first place. We could also try to "solve" this in the SSA renamer, but then I'm not sure if gimplification doesn't already break it. typedef double v2df __attribute__((vector_size(16))); v2df foo (v2df a, v2df b, v2df c, v2df d) { v2df res; try { res =3D a < b ? c : d; return res; // replace with gcc_unreachable () for more twists } catch (...) { return res; } } So ... how far are you with enforcing a split VEC_COND_EXPR? Thus can we avoid the above completely (even as intermediate state)? Thanks, Richard. > Thanks, > Martin