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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1851EC43334 for ; Fri, 15 Jul 2022 13:27:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234657AbiGON1b (ORCPT ); Fri, 15 Jul 2022 09:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232388AbiGON1a (ORCPT ); Fri, 15 Jul 2022 09:27:30 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 9127279690 for ; Fri, 15 Jul 2022 06:27:27 -0700 (PDT) Received: (qmail 39379 invoked by uid 1000); 15 Jul 2022 09:27:26 -0400 Date: Fri, 15 Jul 2022 09:27:26 -0400 From: Alan Stern To: Paul =?iso-8859-1?Q?Heidekr=FCger?= Cc: clang-built-linux , linux-toolchains@vger.kernel.org, Andrea Parri , Will Deacon , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Nathan Chancellor , Nick Desaulniers , Tom Rix , Palmer Dabbelt , LKML , linux-arch , Marco Elver , Charalampos Mainas , Pramod Bhatotia , Soham Chakraborty , Martin Fink Subject: Re: [PATCH RFC] tools/memory-model: Adjust ctrl dependency definition Message-ID: References: <20220615114330.2573952-1-paul.heidekrueger@in.tum.de> <50B9D7C1-B11D-4583-9814-BFFF2C80D8CA@in.tum.de> <04B4DBD6-1262-4905-9E85-9466FC104895@in.tum.de> <20F4C097-24B4-416B-95EE-AC11F5952B44@in.tum.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20F4C097-24B4-416B-95EE-AC11F5952B44@in.tum.de> Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Fri, Jul 15, 2022 at 02:27:28PM +0200, Paul Heidekrüger wrote: > I have just been thinking about how to word this patch; am I correct in > assuming that the LKMM does not deal with loop conditions? Or in other > words, there is no way for a loop condition to impose a ctrl dependency on > any WRITE_ONCE's in the loop body? It are only if and switch statements the > LKMM is concerned with in the case of ctrl dependencies? In theory, the LKMM does say that a loop condition imposes a control dependency on any memory accesses within the loop body. However, the herd7 tool has only very limited support for looping constructs, so in practice it's not possible to create suitable litmus tests with loops. Alan