From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB6723858402; Thu, 22 Feb 2024 08:10:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB6723858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708589430; bh=AaQHwZwluZV36Zy6BaIThpmMGsuCME/Top9DIaNxJLc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SToSgfM5gvia2XKwXaFXatvz848oDuLSansgSOHxuBUbWec8pRjTOe4iTWW8UK7PL yyZBfE8IGSvuQ7UdXsElBNS5Fx2u26D0XIWHFQ3XCTpm5+1Ld3ON+oD8hA8VXtuQww 05CuBMHPo48prrL7gH4mIkJZBIFZunYFlldcJgM8= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111770] predicated loads inactive lane values not modelled Date: Thu, 22 Feb 2024 08:10:29 +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: 14.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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111770 --- Comment #3 from Richard Biener --- As said X + 0. -> X is an invalid transform with FP unless there are no sig= ned zeros (maybe also problematic with sign-dependent rounding). I think we agree to define .MASK_LOAD to zero masked elements. When we need something else we need to add an explicit ELSE value. That needs documenti= ng of course and also possibly testsuite coverage - I _think_ you should be ab= le to do a GIMPLE frontend testcase for this. Note this behavior would extend to .MASK_GATHER_LOAD as well as the load-lanes and -len variants. Unfortunately we do not have _any_ internals manual documentation for internal functions - but you can backtrack to the optabs documentation where this would need documenting. Now, if-conversion could indeed elide the .COND_ADD for integers. It's problematic there only because of signed overflow undefinedness, so you shouldn't see it for 'unsigned' already, and adding zero is safe. if-conversion would need to have an idea of all the ranges involved here so it might be a bit sophisticated to get it right.=