From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D11511A1E45 for ; Thu, 29 Sep 2016 23:57:01 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 29 Sep 2016 23:57:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,271,1473145200"; d="scan'208,217";a="767456358" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 29 Sep 2016 23:57:00 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 29 Sep 2016 23:57:00 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 29 Sep 2016 23:56:59 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.15]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.118]) with mapi id 14.03.0248.002; Fri, 30 Sep 2016 14:56:56 +0800 From: "Gao, Liming" To: "Gao, Liming" , Laszlo Ersek CC: "Justen, Jordan L" , "edk2-devel@ml01.01.org" , Ard Biesheuvel Thread-Topic: [edk2] [Patch 4/4] BaseTools Makefile: Enable Ofast option for GCC tool chain Thread-Index: AQHSGlujbCDnpvwYIE+qoowp9/pCSqCQRAKAgADofUCAAGwAsA== Date: Fri, 30 Sep 2016 06:56:56 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B47F136@shsmsx102.ccr.corp.intel.com> References: <1475158367-13120-1-git-send-email-liming.gao@intel.com> <1475158367-13120-5-git-send-email-liming.gao@intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14B47EDEF@shsmsx102.ccr.corp.intel.com> In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14B47EDEF@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [Patch 4/4] BaseTools Makefile: Enable Ofast option for GCC tool chain X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 06:57:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ersek: I try O2 option. Compared to Ofast, there is a little different. I think = it is acceptable. I will use O2 option. And, this warning message also exis= ts without O2 enable. It is not introduced by this patch. Tool Compression time Decompr= ession time LzmaCompress (GCC O0) 3.476s 0.204s LzmaCompress (GCC Ofast) 1.655s 0.107s LzmaCompress (GCC O2) 1.687s 0.105s Thanks Liming From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Gao,= Liming Sent: Friday, September 30, 2016 8:24 AM To: Laszlo Ersek Cc: Justen, Jordan L ; edk2-devel@ml01.01.org; A= rd Biesheuvel Subject: Re: [edk2] [Patch 4/4] BaseTools Makefile: Enable Ofast option for= GCC tool chain Laszlo: Thanks for your suggestion. I will try O2 option and see the performance an= d warning. Thanks Liming From: Laszlo Ersek [mailto:lersek@redhat.com] Sent: Friday, September 30, 2016 2:30 AM To: Gao, Liming Cc: edk2-devel@ml01.01.org; Ard Biesheuvel ;= Justen, Jordan L Subject: Re: [edk2] [Patch 4/4] BaseTools Makefile: Enable Ofast option for= GCC tool chain Hi Liming, On 09/29/16 16:12, Liming Gao wrote: > Enable Ofast option to generate fast code for performance improvement. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Liming Gao > --- > BaseTools/Source/C/Makefiles/header.makefile | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Sou= rce/C/Makefiles/header.makefile > index f2041f8..ca2dc2e 100644 > --- a/BaseTools/Source/C/Makefiles/header.makefile > +++ b/BaseTools/Source/C/Makefiles/header.makefile > @@ -44,12 +44,12 @@ ARCH_INCLUDE =3D -I $(MAKEROOT)/Include/AArch64/ > endif > > INCLUDE =3D $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common = -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKERO= OT)/Common/ -I .. -I . $(ARCH_INCLUDE) > -BUILD_CPPFLAGS =3D $(INCLUDE) > +BUILD_CPPFLAGS =3D $(INCLUDE) -Ofast > ifeq ($(DARWIN),Darwin) > # assume clang or clang compatible flags on OS X > -BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -W= no-deprecated-declarations -Wno-self-assign -nostdlib -c -g > +BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -W= no-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c= -g > else > -BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -W= no-deprecated-declarations -nostdlib -c -g > +BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -W= no-deprecated-declarations -Wno-unused-result -nostdlib -c -g > endif > BUILD_LFLAGS =3D > BUILD_CXXFLAGS =3D > are you sure -Ofast is a good idea? The gcc manual says, -Ofast Disregard strict standards compliance. -Ofast enables all -O3 optimizations. It also enables optimizations that are not valid for all standard-compliant programs. It turns on -ffast-math and the Fortran-specific -fno-protect-parens and -fstack-arrays. To me this sounds quite scary -- I'm worried it might break the base utilities in various obscure ways, which in turn could break the firmware built with these tools in obscure ways. Most upstream projects and GNU/Linux distributions use -O2 for performance-optimized builds. Can you try that please and see if the performance improvements (relative to the current status) are still acceptable? If so, I would strongly prefer -O2 over -Ofast. Also, while building BaseTools with your series applied (using gcc-4.8), I saw one warning issued: > g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include= /IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/ -Ofast VfrFor= mPkg.cpp -o VfrFormPkg.o > VfrFormPkg.cpp: In member function 'void CIfrRecordInfoDB::IfrUpdateRecor= dInfoForDynamicOpcode(BOOLEAN)': > VfrFormPkg.cpp:1360:91: warning: deprecated conversion from string consta= nt to 'CHAR8* {aka char*}' [-Wwrite-strings] > gCVfrErrorHandle.PrintMsg (0, "Error", "Can not find the adjust offset in= the record."); ^ Thanks! Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel