PR rtl-optimization/82913
[official-gcc.git] / gcc / jit / TODO.rst
blobca0ddbb821eddef728ac9284bc4e5efe3abfe9e4
1 TODOs
2 -----
4 API
5 ===
6 * error-handling:
7     * have a client-provided error-handling callback for the context, and
8       call it, rather than asserting/crashing etc, to make the API resilient and helpful
10 * probably should turn off signal handlers and backtracing, leaving that to
11   the client code
13 * enums and ABI: give enums specific numbers, in ranges, to make it
14   possible to maintain a logical ordering whilst preserving ABI.
16 * expose the statements in the API? (mostly so they can be stringified?)
18 * support more arithmetic ops and comparison modes
20 * access to a function by address::
22     extern gcc_jit_function *
23     gcc_jit_context_get_function (ctxt,
24                                   void *); /* need type information */
26   so you can access "static" fns in your code.
28 * ability to turn a function into a function pointer::
30     gcc_jit_function_as_rvalue ()
32 * expressing branch probabilies (like __builtin_expect)::
34     extern gcc_jit_rvalue *
35     gcc_jit_rvalue_likely (gcc_jit_rvalue *rvalue,
36                            int is_likely);
38   though would:
40     extern void
41     gcc_jit_block_set_likelihood (gcc_jit_block *block,
42                                   int hotness);
44   be better?  (for expressing how hot the current location is)
46 * add a SONAME to the library (and potentially version the symbols?)
48 * do we need alternative forms of division (floor vs rounding)?
50 * are we missing any ops?
52 * error-checking:
54     * gcc_jit_context_new_unary_op: various checks needed
56     * gcc_jit_context_new_binary_op: various checks needed
58     * gcc_jit_context_new_comparison: must be numeric or pointer types
60     * gcc_jit_context_new_array_access: "index" must be of numeric type.
62     * gcc_jit_lvalue_access_field: must be field of correct struct
64     * gcc_jit_rvalue_access_field: must be field of correct struct
66     * gcc_jit_block_add_assignment_op: check the types
68 * Implement more kinds of casts e.g. pointers
70 Bugs
71 ====
72 * fixing all the state issues: make it work repeatedly with optimization
73   turned up to full.
75 * make the dirty dirty hacks less egregious...
77 * test under valgrind; fix memory leaks
79 * re-architect gcc so we don't have to reinitialize everything every time
80   a context is compiled
82 Test suite
83 ==========
84 * measure code coverage in testing of libgccjit.so
86 Future milestones
87 =================
88 * try porting llvmpipe to gcc
90 * inline assembler?
92 * Detect and issue warnings/errors about uses of uninitialized variables
94 * Warn about unused objects in a context (e.g. rvalues/lvalues)?  (e.g.
95   for gcc_jit_context_new_call vs gcc_jit_block_add_eval)
97 Nice to have
98 ============
99 * Currently each function has a single stmt_list, which is built in
100   postprocessing by walking the list of blocks.  Presumably we could
101   have each block have its own stmt_list, avoiding the need for this
102   traversal, and having the block structure show up within tree dumps.
103   Alternatively, could we skip tree and go straight to gimple?
105 * ability to give contexts names, for ease of debugging?
108 Probably not needed
109 ===================
110 * "switch" and "case" ?
112 * sizeof (should this be an API hook?)  do we even need it? presumably
113   client code can just do the sizeof() in its own code.
115 * do we need unary plus?
117 etc etc