From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17825 invoked by alias); 11 Jun 2015 20:44:23 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 17811 invoked by uid 89); 11 Jun 2015 20:44:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.7 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-yh0-f42.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=rNxX2w70icMBKj4DsLExxGhufQV8HKoXUI1njSECcxw=; b=PinTUaMIv7eMdT5x8you0a1y6rnAOaP3rGAFk7DAM3iinNDcEkobskYJEsN5TzVEHf dEPQySPirbEGhvG7ARP2GeZ+YZbapDRdlPfhRvvF4p/QiWW/jHy/nAnsUNfklfTysnHk Xs3/e1cj/4x+vnV3XydLjBAghJXl2fphiqeI+JksR29ADvvwitZW0eLAZWll44G3rN0u QCjtydUbgfsG97IK/bG4FoaoLzyLDyVlm39EMoCNXCTQ5zqCBGHS1X1kPQBw2NoZ+OSQ hD7+2fYbMI+Azqg2rMQ7H1/kUqmpQX3MI+nJmqgnFIRUrhxoxfh1Ykr1rcQqXS49Oida +hQQ== X-Gm-Message-State: ALoCoQmZKi7w94J99p98BgzKomt3Y1EA97wfGDDte1LDIhbJ1N/3wqtx9JatJRLlCPyFpqHwYJzi MIME-Version: 1.0 X-Received: by 10.13.212.138 with SMTP id w132mr14310844ywd.57.1434055459290; Thu, 11 Jun 2015 13:44:19 -0700 (PDT) In-Reply-To: <1434054685.12727.205.camel@surprise> References: <1434054685.12727.205.camel@surprise> Date: Thu, 01 Jan 2015 00:00:00 -0000 Message-ID: Subject: Re: Basic blocks, jump targets and locals From: Dibyendu Majumdar To: David Malcolm Cc: jit@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-q2/txt/msg00046.txt.bz2 On 11 June 2015 at 21:31, David Malcolm wrote: >> Can one create several blocks in advance - and set a block that is not >> yet inserted into the function as the target for a jump? > > Yes. See e.g.: > https://gcc.gnu.org/onlinedocs/jit/intro/tutorial04.html#populating-the-function > which does two passes: > (i) iterates through all of the bytecodes in a function, creating > gcc_jit_block instances for each one > (ii) iterates again, populating the gcc_jit_block instances with > statements > > >> Finally - how are local variable related to blocks. In LLVM one has to >> create the local vars in the entry block of the function. Is it the >> same with libgccjit? > > Local variables in libgccjit are local to a *function*; there's no > association between them and blocks. Blocks in libgccjit relate to > control flow, not to scope. > > Note that any initialization of a local variable has to be done > explicitly, by adding an assignment statement. Typically that > assignment statement would be added to the initial block, as in the > example above (so I suppose that's an association of sorts between > locals and the entry block). > > Hope this is clear Thanks Dave - all very clear.