From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 281A13858415 for ; Tue, 12 Sep 2023 03:47:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 281A13858415 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1c06f6f98c0so43297945ad.3 for ; Mon, 11 Sep 2023 20:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694490454; x=1695095254; 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=w9/BRizlFmHM96Q1FbBRqgssfFyHAibT4+FGWGccbOo=; b=VAE1jg7adbWzRG65LZl6BVEWTQP3/8s+ITgmFXUrfxNEpjj33SlKavOpuRQxyAODj1 Pl81g4vNUbPJuP6ARSCIdQB3aliyfc63j9eEJHu7EqEeAd8wloKHfSZo5i/cKMEjXiV+ iu/yntXyrWMFKRVKTPFXX4/TaYyhwjqUraKO+GMFlPPp/FERh1tCnpxh4cqFMoxn5wax xAHoKckT0hbdCPk/J7/4n9x7AOJcy51NAKYU2zBPSOMisYjSlQF3mx+jgwO9+k/LFcGd TeLOQ490iE7eLifxS1kwLVfnT++WErSJwX33MESn+WnfDlg1/083ogNGBNW3kx6yzuC7 xQYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694490454; x=1695095254; 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=w9/BRizlFmHM96Q1FbBRqgssfFyHAibT4+FGWGccbOo=; b=UyCV1oI2SLAIGbWIPgFCbtnPxYA0I3arfOOQamlRrzt96Gdx0JHv60GMWee4cR+yqe 2eUz3YKGwebu/UNTDKArFbhyzCPNd9JKhDctnOkK7Bvl4LZJLYYHYUUJOJ7QlsQymbbo Ox60qdJhrSrvkKrxQuxVPbeTRhFvfNnBgZBuB54QWXq3juLTMGVZdXif0t9cK+1Ep4ND DsQ3kyxtYf099Yxj6tluZ0nUmym7sXGF4EwJe81c/mlJwaHJVBHCG69TSpwmg5TjFZ3o hrZmNUBj6/U5hfZxMKmhOkCI+FeauVq97PA5mOQ2fanJiV0v31g4t2MtX2t5YBP3hZBy MQCw== X-Gm-Message-State: AOJu0YzuFQZCDesH6pu0BJOZSJMQSmtan8uxunOIWb/Ksouq4RBU25X3 XqKYiHbxdE/qqhL2qgslT/WC63LhVilhug== X-Google-Smtp-Source: AGHT+IGwI+aXxY9zvHSigC1XfZFsIi1Y3yOwW6q0LbeR8iFQCt4PUeSIhlycs31ZdzfCXs8i8Qzv2Q== X-Received: by 2002:a05:6a20:cea0:b0:137:74f8:62ee with SMTP id if32-20020a056a20cea000b0013774f862eemr11915908pzb.18.1694490454066; Mon, 11 Sep 2023 20:47:34 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id g11-20020aa7818b000000b006870ff20254sm6276287pfi.125.2023.09.11.20.47.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Sep 2023 20:47:33 -0700 (PDT) Message-ID: <10571303-863f-4cac-b3c8-bc9d1d21c3b3@gmail.com> Date: Mon, 11 Sep 2023 21:47:28 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] RISC-V: Finish Typing Un-Typed Instructions and Turn on Assert Content-Language: en-US To: Lehua Ding , Edwin Lu , gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com References: <20230911225308.2275313-1-ewlu@rivosinc.com> <9F63A23D4D863426+7ccedfd0-d4fe-4e8f-b06b-fe08817eabce@rivai.ai> 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 9/11/23 21:17, Lehua Ding wrote: > Hi Jeff, > > On 2023/9/12 11:00, Jeff Law wrote: >> I'd rather be consistent and make it policy that every insn has a type. > > Since the type set here will not be used by sched pass (these insn > pattern will not exit at shced pass since use define_insn_and_split with > condition `TARGET_VECTOR && can_create_pseudo_p ()`), I think it is easy > to cause misunderstanding and some problems are not easy to find (e.g. > accidentally went through the sched pass should be assert error). But that condition is _not_ generally sufficient to prevent these insns from existing during sched1. ie, a pass between split1 and sched1 could create these patterns and successfully match them. That in turn would trigger the assertion. can_create_pseudo_p is true up through the register allocator. As a result a condition like TARGET_VECTOR && can_create_pseudo_p() is _not_ sufficient to ensure the pattern does not exist during sched1. While no pass likely creates these kinds of insns right now in that window between split1 and sched1, there's no guarantee that will always be true. The simple rule is easy to follow. Every insn should have a type. That also gives us a degree of future-proof, even if someone adds additional passes/capabilities between split1 and sched1. jeff