From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101545 invoked by alias); 11 Jun 2015 20:26:21 -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 101530 invoked by uid 89); 11 Jun 2015 20:26:20 -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-f51.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:date:message-id:subject:from:to :content-type; bh=AhIsYeEthY3AFpoSIJPJZeDQOPf7ev86zNamzoqJP+w=; b=N7Kk4FD7HgG6EFfc4Ly5vRy7yD/B02yJemobRGHxJIcuvW7bZ5qf6iCHHIaA1XMNIK pYV3cer+gR84Rs15hwHse8V+P4Q/MLPEmCiecQMe7yhuJd/AJZX2G4AxIFPKDXzIESZz vtxdPnq237B6sI9om4wOIMLg2kSzB+08J3aU6BkBRttCDmzDhR9wUphTp/Qyqwbdmu0n vkPa9m8gekH+xA2DCwOQpqwRaTd4h4rA584gKhC2Rsj8cpQ6mQHT254NZK7YEsDnGD8x BCgdwsjf2DlQfQsUmQETd60DOMfGccn0tluh9VsEkHUQ5tWH756BCNAO40GKgFzP+/ul d2Yw== X-Gm-Message-State: ALoCoQn0oaGsx4JlY/guZEYvyIGcmGC1b2zc9sVKE357v6dCKF4FO1GBi3XeZzQaQcHVmIV8lG5e MIME-Version: 1.0 X-Received: by 10.170.208.82 with SMTP id z79mr14425562yke.106.1434054377508; Thu, 11 Jun 2015 13:26:17 -0700 (PDT) Date: Thu, 01 Jan 2015 00:00:00 -0000 Message-ID: Subject: Basic blocks, jump targets and locals From: Dibyendu Majumdar To: jit@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-q2/txt/msg00043.txt.bz2 Hi, In LLVM the IRBuilder has the concept of a current block where instructions are inserted. Reading the libgccjit docs I think that there is no notion of current block - i.e. this needs to be maintained by the caller - is that correct? 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? The scenario is this: when compiling Lua bytecode I already know all the jump targets. So I pre-create all the basic blocks that relate to the jump targets up front - and as each jump is encountered I can easily set the jump target to the right block. As and when I cross the bytecode that is a jump target the block gets added to the function. I hope above is clear - if not I can explain by an example. Can I do something similar with libgccjit? 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? Thanks and Regards Dibyendu