From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by sourceware.org (Postfix) with ESMTPS id 596503858D28 for ; Fri, 22 Mar 2024 18:53:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 596503858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 596503858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711133629; cv=none; b=NOl/+Lkgwj9sVzX6R+S1PAITE+Dm/hvaZVk9CLH8cO+XtjFEhxDrzV/EQWACZ0fypdlnKNWCNxzma5kTP1RhZod7uE6zxwKiHYADY0qkKQHxQ5g7TMBcoIYCQUISp/UwfTFFuvZubIIypLkcArQaQgxzN6dLUQn6rZ3zHeJ0GF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711133629; c=relaxed/simple; bh=c1SWTZJzfSiZKRSlaTd4fc8/RWXax/PHQjtb2EkW8Aw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=hnfzL8OxU6Krf4mPKdhXC8I2vUo71caQX8AX3Hi9KmZVIEiJSYIMktjNyK8Ac4kmzmYR2P4vs36ClZiCLnHXw5QYLuk5uwLqMQ/JEhv8c7KMRKGc3CrbT7pcLozQgBo2OesgJXk5lWmt7nUISwVYG3Q2IaI4ozShnEIPqM9SRl4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-229b7ada9e8so1362570fac.0 for ; Fri, 22 Mar 2024 11:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711133625; x=1711738425; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zEQHOgi39UKUSZkVx2rpnMmjamDow1LK1mVent6BAJ8=; b=IaBDHGfH0Zq6TjEGIxUQ6BlEay2Ea2VQZ0FRxKB1FAm0DS1YgGPwaLMY+GxzMyO9Yp K8dvxRmCvrVEHbHUVVxERWgKwfcqC1JPj2GTfXCbIo60H6w8AHkWaE6wxd03C0p8CkyZ kc/kWpFAFVNg7WWXFecaS8NkzbXoYb+CR8cTNoaOwXT0PXWvA+dCfwpIcJKMms+xDM/a cgBiruMug6XvF9v/yLjZFprtVh0eYsApq4f0weTF7lxy5j1Pva6zWxYHIB0ApWARHgB3 lXFhGHvfjeddQnTvgZ7FbRSkx8YSrq3EqPV4tRp+c7ZcvykntB4NsSTTgEYr8DhSvKY9 5Ibw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711133625; x=1711738425; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zEQHOgi39UKUSZkVx2rpnMmjamDow1LK1mVent6BAJ8=; b=vuiUalZjq8Fx8LqZTHk5exWCc+/ct0ZBotMxkStSdeuK2X3ZiLXeP81ai3k2DoE6s6 mQK96i037AQBF9L0JA11iFQCYQzIU6lbLUWmDyiVfHYFWVbr8WhNavbQ2P7qCRoUS3Te uB1ywnCBX/o6vWn1DaEgqEJ7grky3ScRm1/iqMS/S0BdT6yK7DNSTZ2/OYf9Qi2zsOr7 vMitce/beBXHOhdWXwv6QA00wblmndKxSiVwBdon03EaMWlLD6mcjMLFmbJjkPvhfkc7 NMWjIwmoc8e5AjpomDjOthFGgYRh2ae1dg8lSk4yZE/0OLYCF5iz/a95JGnRof1sciRU nxcA== X-Forwarded-Encrypted: i=1; AJvYcCUiOP8Vv2FfMjwUe8BWBUv2SWoGKE9CD4rpU5SxaICSbxXE/MeAFJ/AMymPJwrb1GEnDnfRM9NU/pwBjGyQ2gMxTrJzzwd4CQ== X-Gm-Message-State: AOJu0YzNqoPoAkNdtwSPTzLgRPdA1k38fRXtBKwpou5UrjZ1wBmFjoUz qNTKUbalnGa474YEwgVpHwRlQb/6D4mvjha2e0oWgRXJXx/b2vkL X-Google-Smtp-Source: AGHT+IHnrWRq0NMvzSueJYFycLMVFRKEEnWUX024mFs3ts6NlEqU8YuDvEciIm7m1K1A3225zADz5A== X-Received: by 2002:a05:6870:1687:b0:229:cd61:e4d6 with SMTP id j7-20020a056870168700b00229cd61e4d6mr707365oae.36.1711133625421; Fri, 22 Mar 2024 11:53:45 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id g4-20020a056830160400b006e4e7d5c2a2sm18272otr.53.2024.03.22.11.53.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Mar 2024 11:53:45 -0700 (PDT) Message-ID: <2a97fc8b-cb91-46b3-9f72-ec86dbf9ebb1@gmail.com> Date: Fri, 22 Mar 2024 12:53:43 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH v2] DSE: Bugfix ICE after allow vector type in get_stored_val Content-Language: en-US To: "Li, Pan2" , Robin Dapp , "gcc-patches@gcc.gnu.org" Cc: "juzhe.zhong@rivai.ai" , "kito.cheng@gmail.com" , "richard.guenther@gmail.com" , "Wang, Yanzhang" , "Liu, Hongtao" References: <20240226032558.587912-1-pan2.li@intel.com> <20240226142235.3215553-1-pan2.li@intel.com> <793c14cb-2a08-41a4-ac55-4c39295f42d3@gmail.com> <2767ff68-98c8-47b6-ac3a-b3f47ba98afa@gmail.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 3/4/24 11:22 PM, Li, Pan2 wrote: > Thanks Jeff for comments. > >> But in the case of a vector modes, we can usually reinterpret the >> underlying bits in whatever mode we want and do any of the usual >> operations on those bits. > > Yes, I think that is why we can allow vector mode in get_stored_val if my understanding is correct. > And then the different modes will return by gen_low_part. Unfortunately, there are some modes > (less than a vector bit size like V2SF, V2QI for vlen=128) are considered as invalid by validate_subreg, > and return NULL_RTX result in the final ICE. That doesn't make a lot of sense to me. Even for vlen=128 I would have expected that we can still use a subreg to access low bits. After all we might have had a V16QI vector and done a reduction of some sort storing the result in the first element and we have to be able to extract that result and move it around. I'm not real keen on a target workaround. While extremely safe, I wouldn't be surprised if other ports could trigger the ICE and we'd end up patching up multiple targets for what is, IMHO, a more generic issue. As Richi noted using validate_subreg here isn't great. Does it work to factor out this code from extract_low_bits: > if (!int_mode_for_mode (src_mode).exists (&src_int_mode) > || !int_mode_for_mode (mode).exists (&int_mode)) > return NULL_RTX; > > if (!targetm.modes_tieable_p (src_int_mode, src_mode)) > return NULL_RTX; > if (!targetm.modes_tieable_p (int_mode, mode)) > return NULL_RTX; And use that in the condition (and in extract_low_bits rather than duplicating the code)? jeff ps. No need to apologize for the pings. This completely fell off my radar.