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=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=ham 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 17DEEC4742C for ; Fri, 13 Nov 2020 11:16:33 +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 A1F7220797 for ; Fri, 13 Nov 2020 11:16:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vGlDPqzo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1F7220797 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ucvfVOxUARoctLv1RyPI6XBzy6EqSnXyctKqtizGJ1k=; b=vGlDPqzoAAIZ6UyR3BGa8XmXU YTe1v0hb7XP8BVq6Gv7eaU1m5VWRjcCv3Ge/cIPBzVM2lGXjSk8ii/4HAI6FOOSGY+EU5Tmma8kUY bkfvT1R5i1a0y5w9j311GTQfLzYqeFSIdmbYGIRwwNbEAxvk6VvDiia0g1T16yD8aNLyBvWcAieT8 GGezO+BdeZDiXa8+P5KjEf8f7zBz1aHhGjMMyD2BMiMm/VsHkv4BNweA4YWrgvtVxSOOJKvM22GIy t7Z9DGooAGgu41PoJAelWPzLBTqenX5N+GJQ0x+7yu8r+2VNk9CtlVHgVMPtGba0BXg2hnuBiFjM6 EL8vQIC/Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdX3p-0008C6-Lg; Fri, 13 Nov 2020 11:16:09 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdX3n-0008BY-Ai for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 11:16:08 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 52DAE1F468E4 From: Adrian Ratiu To: Ard Biesheuvel Subject: Re: [PATCH v2 2/2] arm: lib: xor-neon: move pragma options to makefile In-Reply-To: References: <20201112212457.2042105-1-adrian.ratiu@collabora.com> <20201112212457.2042105-3-adrian.ratiu@collabora.com> Date: Fri, 13 Nov 2020 13:17:38 +0200 Message-ID: <87k0upjyjx.fsf@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_061607_499564_E4441D9E X-CRM114-Status: GOOD ( 21.74 ) 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 , Nick Desaulniers , Russell King , Linux Kernel Mailing List , clang-built-linux , Arvind Sankar , Nathan Chancellor , kernel@collabora.com, Linux ARM Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 13 Nov 2020, Ard Biesheuvel wrote: > On Thu, 12 Nov 2020 at 22:23, Adrian Ratiu > wrote: >> >> Using a pragma like GCC optimize is a bad idea because it tags >> all functions with an __attribute__((optimize)) which replaces >> optimization options rather than appending so could result in >> dropping important flags. Not recommended for production use. >> >> Because these options should always be enabled for this file, >> it's better to set them via command line. tree-vectorize is on >> by default in Clang, but it doesn't hurt to make it explicit. >> >> Suggested-by: Arvind Sankar >> Suggested-by: Ard Biesheuvel Signed-off-by: >> Adrian Ratiu --- >> arch/arm/lib/Makefile | 2 +- arch/arm/lib/xor-neon.c | 10 >> ---------- 2 files changed, 1 insertion(+), 11 deletions(-) >> >> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile >> index 6d2ba454f25b..12d31d1a7630 100644 --- >> a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -45,6 >> +45,6 @@ $(obj)/csumpartialcopyuser.o: >> $(obj)/csumpartialcopygeneric.S >> >> ifeq ($(CONFIG_KERNEL_MODE_NEON),y) >> NEON_FLAGS := -march=armv7-a >> -mfloat-abi=softfp -mfpu=neon >> - CFLAGS_xor-neon.o += $(NEON_FLAGS) + >> CFLAGS_xor-neon.o += $(NEON_FLAGS) -ftree-vectorize >> -Wno-unused-variable >> obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o >> endif >> diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c >> index e1e76186ec23..62b493e386c4 100644 --- >> a/arch/arm/lib/xor-neon.c +++ b/arch/arm/lib/xor-neon.c @@ >> -14,16 +14,6 @@ MODULE_LICENSE("GPL"); >> #error You should compile this file with '-march=armv7-a >> -mfloat-abi=softfp -mfpu=neon' #endif >> >> -/* - * Pull in the reference implementations while instructing >> GCC (through - * -ftree-vectorize) to attempt to exploit >> implicit parallelism and emit - * NEON instructions. - */ >> -#ifdef CONFIG_CC_IS_GCC -#pragma GCC optimize "tree-vectorize" >> -#endif - -#pragma GCC diagnostic ignored "-Wunused-variable" >> #include >> >> struct xor_block_template const xor_block_neon_inner = { >> -- 2.29.2 >> > > So what is the status now here? How does putting > -ftree-vectorize on the command line interact with Clang? Clang needs to be fixed separately as -ftree-vectorize does not change anything, the option is enabled by default. I know it sucks to have such a silent failure, but it's always been there (the "upgrade your GCC" warning during Clang builds was bogus) and I do not want to rush a Clang fix without fully understanding it. Warning Clang users that the optimization doesn't work was discussed but dropped because users can't do anything about it. If we are positively certain this is a kernel bug and not a Clang bug (i.e. the xor-neon use case is not enabling/triggering the optimization properly) I could add a TODO comment in the code FWIW. Adrian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel