From patchwork Fri Nov 2 13:38:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 150035 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2092465ljp; Fri, 2 Nov 2018 06:38:19 -0700 (PDT) X-Google-Smtp-Source: AJdET5ejXZBSBaW0b7wt2T/P410rZPgfekd8HE+FvKnt06+Eh3YkSPvrtaWuwkQwY+2BOQghIESJ X-Received: by 2002:a62:1f13:: with SMTP id f19-v6mr11919743pff.168.1541165899479; Fri, 02 Nov 2018 06:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541165899; cv=none; d=google.com; s=arc-20160816; b=VtAw+rEQOHJrUBfKoeCqSEC4Ytabv9g1rksBEOACLeDmLNzYrRgs00G0uwAXTo2uOB 081wCVfdr03I7xa8o6Vh6xt6x0K/ON1G32ybZ2QjysuMGSHBJ0/R2mDpfVAR8DOzAgka hLbBCBohZK1ZRaL1fGAH01dbMV5OBLnQ4165ziSzBJ+D8f+qh/X6tYLyQyOIOZx+Wb/b aVCZU9Kwt+xgg5Mn7ERTIBFy6JnU+CNO0VHFt56Te7C7Tm6T0yfHQB3KkikhztTKGlFz 9zPGH2PqfNP7AKhS7cJ0zYz30+ppqdbJ2dhZhPGbkJdgCyZpzaBIk8KPqgXalfUKU514 LLqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:date:message-id:openpgp:subject:from:to :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=HOpeiuV7mCQYKVWvH8dX3f3YaSyqbxxrNOzqNZZcbi0=; b=k1QpSGmcf1ccmXrYRzKGS7NlA3soZZmgYX9/bcAL4mo6dy6h52Htsjvayct67xLSUg y82eSkqNJ7Rz0P4c0OBgQ9uMwASWNaNLZn37wmQz5UApJu9sMVdab4P/xDoEHg0HInh4 FvGhtip9rrBPn5n4yUCKAjb2pf2mDXQzd3relpf2XVcwsai09rSlEk3t8AkZlhaf4zD/ S1sgm4oObyu5wUefA7nIVO7tglRSxGmRY5i6ymAqdyRjyYKUWyjOIwS+4h9oAb/WyBpN a22Q4RyF7s/TGNyZGzlJ19OAKE60oNSiLQrVZ59A7kNQZO0aLo2waV9kazcqSjStpa+C mUVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=j8tS7tR8; spf=pass (google.com: domain of gcc-patches-return-488890-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-488890-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f7-v6si28928508plr.213.2018.11.02.06.38.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 06:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-488890-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=j8tS7tR8; spf=pass (google.com: domain of gcc-patches-return-488890-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-488890-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=OKr/71Rf/es2Lbx54M73rfeAQD7e83Q1R+0TAP5Y4bFgCUM2XT TsrEU6fS5bNVsZDaQEjHqFhdnAOaNZRAJN8bMJeZkQLHbYNcMdLVeLE6/mjm7OxO qOPcPeBd6ow4V6qrLrDj9PMfBGLL06CiwjKmvHRKdnhWoAYFg7HU6HtSE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=y5IRW79L2td5IwPUi71n3LxC2O8=; b=j8tS7tR83GJ8sU1OZYuX EqB+NEOWN6VBrWf6brtNcZlakJNNjnSXp+aze8QR1e6CfBWg89pwEf1R/RTGNO+h XXT/UIgTgOLGiybzsDnbW16JJfjgklqCTJpDWN7uYvkcfi2WZuSygEO8JHmrO5n0 wmh7+H+7JpuqrtUCIYvp48I= Received: (qmail 109262 invoked by alias); 2 Nov 2018 13:38:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 109243 invoked by uid 89); 2 Nov 2018 13:38:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Nov 2018 13:38:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 11986A78; Fri, 2 Nov 2018 06:38:03 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.206.194]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8A64C3F71D; Fri, 2 Nov 2018 06:38:02 -0700 (PDT) To: gcc-patches From: "Richard Earnshaw (lists)" Subject: [aarch64] disable shrink wrapping when tracking speculative execution Openpgp: preference=signencrypt Message-ID: <5198b7ac-afa0-193f-6c2c-47feacc91cf2@arm.com> Date: Fri, 2 Nov 2018 13:38:00 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Although there's no fundamental reason why shrink wrapping and speculation tracking are incompatible, a phase-ordering requirement (we need to do speculation tracking before the final basic block clean-up) means that the shrink wrapping pass can undo some of the changes the speculation tracking pass makes. The result is that the tracking, while still safe is less comprehensive than we really want. So to keep things simple, and because the tracking code is quite expensive anyway, it seems best to just disable that pass when we are tracking speculative execution. * config/aarch64/aarch64.c (aarch64_override_options): Disable shrink-wrapping when -mtrack-speculation. Committed. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 54f57463e97..d356fa37823 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -11346,6 +11346,12 @@ aarch64_override_options (void) || (aarch64_arch_string && valid_arch)) gcc_assert (explicit_arch != aarch64_no_arch); + /* The pass to insert speculation tracking runs before + shrink-wrapping and the latter does not know how to update the + tracking status. So disable it in this case. */ + if (aarch64_track_speculation) + flag_shrink_wrap = 0; + aarch64_override_options_internal (&global_options); /* Save these options as the default ones in case we push and pop them later