From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1141FC388F7 for ; Tue, 10 Nov 2020 22:54:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BF50205CA for ; Tue, 10 Nov 2020 22:54:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zN4P/APT"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iiVm82Cd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BF50205CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S4LufiADAowYG+Y4VF7uh4/EZ8WgbjCJefkjSj9tSjM=; b=zN4P/APTI2MVjtgX7jCcQkFrE m2Ds9dSGvhTARRVsOf2abPdluwKTgZ5u8msx9fxtXix6dJKA2AjijsSgpRVg0FKIiZ6mvlGIETYYA FsBuZ/3dOWf05xivBCe711z5HLVNcD2otsJPi/6foHbI7+DpxGGMXE8dgDA2JhLCLFupZaLyKzFbR tX8vs+16q9v21ZEt0fKKYRV3Gvv9HEubId6Atkt20MgTSBNg6q/eID3UOhTpD5eoX7zTAtrzG3K06 sGL398H+o3b9HMeRqg6difGm1TKA3z8ZnCYDLsRacGRQgxo22StUAM7CHYzhzi8OLf/VbDXwwH88k 5gNsXvNAQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kccX0-0005HV-85; Tue, 10 Nov 2020 22:54:30 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kccWv-0005GF-SB for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 22:54:27 +0000 Received: by mail-qk1-x742.google.com with SMTP id y197so13298140qkb.7 for ; Tue, 10 Nov 2020 14:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kZBhzUj2Y7GYazkoiwLmVUtJfQQKiQzBUyUc3hTXKBs=; b=iiVm82Cd9Nb9mgxHysJirFSlnXFSG+3OU7srYM6Zi/SeuY+Xa39DFgPcoddZkrTjaA mx0EUy3XE8ksqqtbLfBCui90R0edogGe3JBug119KsiPtXwP0eXpyYzVt1hhTDNrM4B7 fuaShuePti5tyt4uK/2c0wuMbx8rDF4kP9hUarytlc+88nKF+uM12mTuD6rOOI2a5nZ+ wJ5kgQ2/T3wEEDIRKUcVKxeXZjlQ4qknJPXD1qrW3HXfYaDOUmrIN6r9PYaMx41lpkNX ooUWv4T/fu0Y7ncrL9aMtdHSPSjaPYjNyx2y0jdwxcGz9o9/Ez5aPXnGhYGo+bd4wptT W3Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=kZBhzUj2Y7GYazkoiwLmVUtJfQQKiQzBUyUc3hTXKBs=; b=cDgW3uQ1AUcA/OosPxcPmviXOIh0hpOQfF8vZwETxCxOv+CvrguY6qkWf3sYu3lxqL jm30OvleZQQOTZYP3C5QB9X9FWuNYsaa5HiTVoL/L4TNzS25IwHGZZwKTHJshWkZfScO TfBT6kilA/1FzFraO8GZBfjwh7hXy1nNP4A9RbU4oFbq6ZHX0n4lZ/APxoTXiiB27KQx TqLIAVEgTGNP4ZTI0q/EWWKRvZeBMIEvo2v5yWV0DKRawzfy7yYzwck0SfcXrT8dKfUk TacC1toGA70Z99lA+3v6YZFEdBOBrzkTv+E1L6yXjE4TdxzOyScCl9WK2w28KPXz1nn9 474g== X-Gm-Message-State: AOAM530cPBF7GHQ1eXnTgWhqlQHVKXWU8WzjPny2rGuyx23Y0CB/Y6VL I4dEj41yssC/OHWEvTl5K6w= X-Google-Smtp-Source: ABdhPJwVU9WNoKx/aQtlS6gxOQd5cEUuaTMxYDwIy86/L71QTkYZxeqs4NhS8KmLIU5g16VeJK14wA== X-Received: by 2002:a37:9f14:: with SMTP id i20mr4165418qke.137.1605048864135; Tue, 10 Nov 2020 14:54:24 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id y82sm218959qkb.129.2020.11.10.14.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 14:54:23 -0800 (PST) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 10 Nov 2020 17:54:21 -0500 To: Nick Desaulniers Subject: Re: [PATCH 2/2] arm: lib: xor-neon: disable clang vectorization Message-ID: <20201110225421.GA29900@rani.riverdale.lan> References: <20201106051436.2384842-3-adrian.ratiu@collabora.com> <20201106101419.GB3811063@ubuntu-m3-large-x86> <87wnyyvh56.fsf@collabora.com> <871rh2i9xg.fsf@iwork.i-did-not-set--mail-host-address--so-tickle-me> <20201110221511.GA1373528@rani.riverdale.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_175425_983741_60559D44 X-CRM114-Status: GOOD ( 26.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Adrian Ratiu , Russell King , LKML , clang-built-linux , Arvind Sankar , Nathan Chancellor , Collabora Kernel ML , Ard Biesheuvel , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 10, 2020 at 02:39:59PM -0800, Nick Desaulniers wrote: > On Tue, Nov 10, 2020 at 2:39 PM Nick Desaulniers > wrote: > > > > On Tue, Nov 10, 2020 at 2:36 PM Nick Desaulniers > > wrote: > > > > > > On Tue, Nov 10, 2020 at 2:15 PM Arvind Sankar wrote: > > > > > > > > On Tue, Nov 10, 2020 at 01:41:17PM -0800, Nick Desaulniers wrote: > > > > > On Mon, Nov 9, 2020 at 11:51 AM Adrian Ratiu wrote: > > > > > > > > > > > > On Fri, 06 Nov 2020, Nick Desaulniers > > > > > > wrote: > > > > > > > +#pragma clang loop vectorize(enable) > > > > > > > do { > > > > > > > p1[0] ^= p2[0] ^ p3[0] ^ p4[0] ^ p5[0]; p1[1] ^= > > > > > > > p2[1] ^ p3[1] ^ p4[1] ^ p5[1]; > > > > > > > ``` seems to generate the vectorized code. > > > > > > > > > > > > > > Why don't we find a way to make those pragma's more toolchain > > > > > > > portable, rather than open coding them like I have above rather > > > > > > > than this series? > > > > > > > > > > > > Hi again Nick, > > > > > > > > > > > > How did you verify the above pragmas generate correct vectorized > > > > > > code? Have you tested this specific use case? > > > > > > > > > > I read the disassembly before and after my suggested use of pragmas; > > > > > look for vld/vstr. You can also add -Rpass-missed=loop-vectorize to > > > > > CFLAGS_xor-neon.o in arch/arm/lib/Makefile and rebuild > > > > > arch/arm/lib/xor-neon.o with CONFIG_BTRFS enabled. > > > > > > > > > > > > > https://godbolt.org/z/1oo9M6 > > > > > > > > With the __restrict__ keywords added, clang seems to vectorize the loop, > > > > but still reports that vectorization wasn't beneficial -- any idea > > > > what's going on? > > > > Anyways, it's not safe to make that change in the kernel unless you > > can guarantee that callers of these routines do not alias or overlap. > > s/callers/parameters passed by callers/ > Yep, but that seems likely, it doesn't seem like the function would do anything useful if the destination overlapped one of the sources. The kernel just doesn't seem to make use of the restrict keyword. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel