From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 681623858D39; Mon, 21 Aug 2023 20:14:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 681623858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692648840; bh=qrB2QAeZPLra6MLlkBR6f3umKHzx2yUEcQO6F5mr5mA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oQOMvAXvGaerRQw9B8vTcaVDBWODzPCrl+idfjmwvRKseVEqXEE2IpgQR9qYuD4NI DIjpqFZ0GXaDrs1TnJgkyvAVyMpyRJg/zH6ZgkIsWJGXJQ2+CyzL4xGstmN2AytCh9 NyA25ndTKYFVb+FbMaMOFOmFv9fcJ9uPNucAkcNs= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110915] vector version of `x == MIN & x > y` is not optimized Date: Mon, 21 Aug 2023 20:13:59 +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: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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=3D110915 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > These should work, I think, will try after finishing up the pointer: This is better version, it replaces the current min_value/max_value even: (match min_value uniform_integer_cst_p (with { tree int_cst =3D uniform_integer_cst_p (t); } (if ((INTEGRAL_TYPE_P (TREE_TYPE (int_cst)) || POINTER_TYPE_P (TREE_TYPE (int_cst))) && wi::eq_p (wi::to_wide (int_cst), wi::min_value (TREE_TYPE (int_cst)))) ) ) (match max_value uniform_integer_cst_p (with { tree int_cst =3D uniform_integer_cst_p (t); } (if ((INTEGRAL_TYPE_P (TREE_TYPE (int_cst)) || POINTER_TYPE_P (TREE_TYPE (int_cst))) && wi::eq_p (wi::to_wide (int_cst), wi::max_value (TREE_TYPE (int_cst)))) ) ) That is INTEGER_CST replace with uniform_integer_cst_p and type with TREE_T= YPE (int_cst) and t with int_cst.=