From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0DB293858D37; Mon, 20 Jul 2020 06:56:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DB293858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595228188; bh=/Qw5nThQWNQNB2n3kTAw3L7u5ZDsJjacB6uinXZl2qU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TvV0bZnaxHc18LjfZgoAdpUIfLzM49/yxnSnqRIpGH1d+peL6YYX1c1lR3MMU45TV RPa5vtdpcshNT+ek57PUzT4bQYX5dvP7vXeSqAgQ4tBDbGSFMKVmRh/cX9DvzXsR5o ZvA2iDLCTi2NgYAChRGCmPF4JZqtuOkA2RarYgFk= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96244] Redudant mask load generated Date: Mon, 20 Jul 2020 06:56:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on bug_status keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2020 06:56:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96244 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2020-07-20 Status|UNCONFIRMED |NEW Keywords| |missed-optimization --- Comment #1 from Richard Biener --- So one thing to note here is that a masked load of a by-value parameter decl doesn't make much sense since a load from it cannot trap (unless there's out-of-bound accesses - which I'm not sure we may simply disregard here). if-conversion sees VIEW_CONVERT_EXPR(d)[i_16] and indeed considers it iftmp.0_11 =3D VIEW_CONVERT_EXPR(c)[i_17]; tree could trap... [local count: 954449105]: # RANGE [0, 8] NONZERO 15 # i_17 =3D PHI <0(2), i_13(8)> # ivtmp_6 =3D PHI <8(2), ivtmp_4(8)> _1 =3D VIEW_CONVERT_EXPR(a)[i_17]; _2 =3D VIEW_CONVERT_EXPR(b)[i_17]; so range-info is one index too pessimistic here. So IMHO it's not about "redundant" masked loads, it's about the fact that we end up with loads at all here. If c and d would not be register arguments we would have to perform loads and if they might trap we could not elide the masked load.=