From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 3C4F43857C67 for ; Thu, 16 Nov 2023 22:30:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C4F43857C67 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 3C4F43857C67 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700173805; cv=none; b=WlTFO6spkEtRco5aOnE3fBvgW4oEuUAkJ0+Kjnqv2odtdLiB7R8EMhB+VWFEx2+tiun6V/elVq44kNBhi1ZpLsKSJ8jqkbRNjeXbsQhP7g4ZsC1FJv4EBNLb4C4ktegW2U5Mm9ln5X2o1zTiUHt6fT7P18KS174qAlGk/7DaeZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700173805; c=relaxed/simple; bh=UvOCmIZ+3z+x3Oyg37rbu5HaCseUDbwSsewddK/YZSY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=l8e+hfBDOOG1x7hyIF4ZdAkNmVX7S5PIjjPNvPtrzDmtfTSy4GQHSEZM16YuXbtQ0VvGFGe6WCuLjdh6jMLCb1JAclSCt+T9Nzifeo5n/cZB1nCqZxu2a++inzpI8wIJ73WdDezrthqvsUU8VjGHUwmE9pg0/8R2AK9m4nqLpLk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c5028e5b88so19209341fa.3 for ; Thu, 16 Nov 2023 14:30:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700173803; x=1700778603; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tD2IztiF6D9c8XROEBqfjHbE9Wu3Piqp2at0l9btLZg=; b=MicM9JpgQpStfcxEaIx3VVdbYt6H3Ks5SROHNa8BVp3NxoVss0OMOm6hlsNmsYlGMc aUGsj0Z2Myiv2UwbPVP2nGNs2FlpIu4ZG0GcuAA95c8lk0xE0Sg1tDXNjnEzN5LL8JRM pTrc2ktZLIcZvfKI8VxuXcFX7fTJwzHQIo86SkOVvemEyFoqBq6qxDMXkYZ9nc9kTl8L KfuZo5RnvrbONy1q6OmMLoJu8a+eon0Sjz7ddWXc/a9m2V9yKUozHLear0b/BZNABl1G 702eLuDJPiC5CoSJHcl/Pe3dENhvRBbz3EiQVZ/6gp1srX/QrnMRVkj+zF/g0z6U6WeJ PD5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700173803; x=1700778603; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tD2IztiF6D9c8XROEBqfjHbE9Wu3Piqp2at0l9btLZg=; b=kG3RZScrXcIVpgdLdJGIRwWMmkSFxodBXA6y2puUpxDY0rwSCzXsf5n1EMp9SD3aXs I+zhM3v/kGhV+ci1P7OHfLs99rO8Ym92UGv4N3bKPJYltKho0R+mOZz/wzUY345DHu4A gPG3cgTv8ajwJOb7kMd0TeFY0+BqDsuR5NBkRg59ju7DjtlKd6COMD9g1kYs04wnDKiW E1BoXf0HnzIb8hNj8drqJq5Lxn202EKHdp63IoO/QApL2hGIIPdPM+vrspK/ySm5VU6u DS2XdC5MgSkEI90fW4k8XpMWj83TnXAo1AliqlqqYrpfK3A+DoGhNF2QDBPWuMeHGjqZ OxDQ== X-Gm-Message-State: AOJu0YwdwYXnNq9WwSX5UE7IQhFJnM2WWhUHCoIH0t+qbj3bzYnV77G8 Y3c7ZB9gZcWI4knwq0hUX+M= X-Google-Smtp-Source: AGHT+IGnzuI7KdxfCmO2zlCCag7h7zcitnnPwkMmxs1jJBqQQsTj6NhVtbjH2jKi4ICj0QkGHr1Aow== X-Received: by 2002:a2e:3c03:0:b0:2c5:999:de64 with SMTP id j3-20020a2e3c03000000b002c50999de64mr6986706lja.16.1700173802411; Thu, 16 Nov 2023 14:30:02 -0800 (PST) Received: from [192.168.1.24] (ip-046-223-203-173.um13.pools.vodafone-ip.de. [46.223.203.173]) by smtp.gmail.com with ESMTPSA id gr8-20020a170906e2c800b009ad829ed144sm107767ejb.130.2023.11.16.14.30.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Nov 2023 14:30:02 -0800 (PST) Message-ID: Date: Thu, 16 Nov 2023 23:30:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: rdapp.gcc@gmail.com, gcc-patches , Tamar Christina Subject: Re: [PATCH] vect: Use statement vectype for conditional mask. To: Richard Biener References: Content-Language: en-US From: Robin Dapp In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 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,T_SCC_BODY_TEXT_LINE 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: > For the fortran testcase we don't even run into this but hit an > internal def and assert on > > gcc_assert (STMT_VINFO_VEC_STMTS (def_stmt_info).length () == ncopies); > > I think this shows missing handling of .COND_* in the bool pattern recognition > as we get the 'bool' condition as boolean data vector rather than a mask. The > same is true for the testcase with the invariant condition. This causes us to > select the wrong vector type here. The "easiest" might be to look at > how COND_EXPR is handled in vect_recog_bool_pattern and friends and > handle .COND_* IFNs the same for the mask operand. For the first (imagick) testcase adding a bool pattern does not help because we always pass NULL as vectype to vect_get_vec_defs. Doing so we will always use get_vectype_for_scalar_type (i.e. a "full" bool vector) because vectype of the (conditional) stmt is the lhs type and not the mask's type. For cond_exprs in vectorizable_condition we directly pass a comp_vectype instead (truth_type). Wouldn't that, independently of the pattern recog, make sense? Now for the Fortran testcase I'm still a bit lost. Opposed to before we now vectorize with a variable VF and hit the problem in the epilogue with ncopies = 2. .COND_ADD (_7, __gcov0.__brute_force_MOD_brute_I_lsm.21_67, 1, __gcov0.__brute_force_MOD_brute_I_lsm.21_67); where _7 = *_6 which is an internal_def. I played around with doing it analogously to the COND_EXPR handling, so creating a COND_ADD (_7 != 0) which will required several fixups in other places because we're not prepared to handle that. In the end it seems to only shift the problem because we will still need the definition of _7. I guess you're implying that the definition should have already been handled by pattern recognition so that at the point when we need it, it has a related pattern stmt with the proper mask type? Regards Robin