From patchwork Fri Oct 31 17:02:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 405431 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 572F0140085 for ; Sat, 1 Nov 2014 04:28:47 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=fBXVFDE5wCv8oRduHFBPzP1zTciHJSqz4W/zi615bSrrWOOVs7sCJ 9erMfNDHzamKTqt6zLUJshIe/BkfrOADJ/5TOT/hlaoYG4NUfiGBFcICGT0Tlrfp 9Ev6O7UWDn8nVB0DcDjLCTmQsMvTkSC6ezHq9hNqWArvYLGAY2r0Sc= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=nAxXQPbZRAqgYu92qBCLJ2QicNE=; b=yV498ngtAi8gkVGc5GSU W0q35OGfporelGms72Wdrhz6y2KhXWMU+gDaf+3tux0ERXKs9Cjme5pGZ+c/bgs7 VwwcvZQN3Z/7namxwbzh8uep7ncAazmv+cByBWUNkkLrmd2dLQq0GwyEZbgC7q+B RXFoV9LfZ0C4kwQmjjfC4+Q= Received: (qmail 13133 invoked by alias); 31 Oct 2014 17:28:27 -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 13086 invoked by uid 89); 31 Oct 2014 17:28:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 31 Oct 2014 17:28:25 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkFfd-0005rR-LK for gcc-patches@gcc.gnu.org; Fri, 31 Oct 2014 13:07:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkFfd-0005qX-Eb; Fri, 31 Oct 2014 13:07:29 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9VH7RRN008261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Oct 2014 13:07:28 -0400 Received: from surprise.redhat.com (vpn-236-100.phx2.redhat.com [10.3.236.100]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9VH7ESL008517; Fri, 31 Oct 2014 13:07:27 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 18/27] New file: gcc/jit/TODO.rst Date: Fri, 31 Oct 2014 13:02:51 -0400 Message-Id: <1414774977-25605-19-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1414774977-25605-1-git-send-email-dmalcolm@redhat.com> References: <1414774977-25605-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes This is a list of TODOs for working on the JIT. gcc/jit/ * TODO.rst: New. --- gcc/jit/TODO.rst | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 gcc/jit/TODO.rst diff --git a/gcc/jit/TODO.rst b/gcc/jit/TODO.rst new file mode 100644 index 0000000..09c4d9d --- /dev/null +++ b/gcc/jit/TODO.rst @@ -0,0 +1,119 @@ +TODOs +----- + +API +=== +* error-handling: + * have a client-provided error-handling callback for the context, and + call it, rather than asserting/crashing etc, to make the API resilient and helpful + +* probably should turn off signal handlers and backtracing, leaving that to + the client code + +* enums and ABI: give enums specific numbers, in ranges, to make it + possible to maintain a logical ordering whilst preserving ABI. + +* expose the statements in the API? (mostly so they can be stringified?) + +* support more arithmetic ops and comparison modes + +* access to a function by address:: + + extern gcc_jit_function * + gcc_jit_context_get_function (ctxt, + void *); /* need type information */ + + so you can access "static" fns in your code. + +* ability to turn a function into a function pointer:: + + gcc_jit_function_as_rvalue () + +* expressing branch probabilies (like __builtin_expect):: + + extern gcc_jit_rvalue * + gcc_jit_rvalue_likely (gcc_jit_rvalue *rvalue, + int is_likely); + + though would: + + extern void + gcc_jit_block_set_likelihood (gcc_jit_block *block, + int hotness); + + be better? (for expressing how hot the current location is) + +* add a SONAME to the library (and potentially version the symbols?) + +* do we need alternative forms of division (floor vs rounding)? + +* are we missing any ops? + +* error-checking: + + * gcc_jit_context_new_unary_op: various checks needed + + * gcc_jit_context_new_binary_op: various checks needed + + * gcc_jit_context_new_comparison: must be numeric or pointer types + + * gcc_jit_context_new_array_access: "index" must be of numeric type. + + * gcc_jit_lvalue_access_field: must be field of correct struct + + * gcc_jit_rvalue_access_field: must be field of correct struct + + * gcc_jit_block_add_assignment_op: check the types + +* Implement more kinds of casts e.g. pointers + +Bugs +==== +* fixing all the state issues: make it work repeatedly with optimization + turned up to full. + +* make the dirty dirty hacks less egregious... + +* test under valgrind; fix memory leaks + +* re-architect gcc so we don't have to reinitialize everything every time + a context is compiled + +Test suite +========== +* get DejaGnu to build and run C++ testcases + +* measure code coverage in testing of libgccjit.so + +Future milestones +================= +* try porting llvmpipe to gcc + +* inline assembler? + +* Detect and issue warnings/errors about uses of uninitialized variables + +* Warn about unused objects in a context (e.g. rvalues/lvalues)? (e.g. + for gcc_jit_context_new_call vs gcc_jit_block_add_eval) + +Nice to have +============ +* Currently each function has a single stmt_list, which is built in + postprocessing by walking the list of blocks. Presumably we could + have each block have its own stmt_list, avoiding the need for this + traversal, and having the block structure show up within tree dumps. + Alternatively, could we skip tree and go straight to gimple? + +* ability to give contexts names, for ease of debugging? + + +Probably not needed +=================== +* "switch" and "case" ? + +* sizeof (should this be an API hook?) do we even need it? presumably + client code can just do the sizeof() in its own code. + +* do we need unary plus? + +etc etc