File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
docs/codeql/ql-language-reference Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,38 @@ into the places where it is called. This can be useful when a predicate body is
289289compute entirely, as it ensures that the predicate is evaluated with the other contextual information
290290at the places where it is called.
291291
292+ ``pragma[inline_late] ``
293+ -----------------------
294+
295+ **Available for **: |non-member predicates |
296+
297+ The ``pragma[inline_late] `` annotation must be used in conjunction with a
298+ ``bindingset[...] `` pragma and together they tell the QL optimiser to inline
299+ the annotated predicate after join ordering and to join order callers and callee
300+ based on the given binding set. This can be useful to prevent the optimiser
301+ from choosing a sub-optimal join order.
302+
303+ For instance, in the example below, the ``pragma[inline_late] `` and
304+ ``bindingset[x] `` annotation specifies that calls to ``p `` should be join ordered
305+ in a context where ``x `` is already bound. This forces the join orderer to
306+ order the ``q(x) `` call before ``p(x) ``, which is more computationally efficient
307+ than ordering ``p(x) `` before ``q(x) ``.
308+
309+ .. code-block :: ql
310+
311+ bindingset[x]
312+ pragma[inline_late]
313+ predicate p(int x) { x in [0..100000000] }
314+
315+ predicate q(int x) { x in [0..10000] }
316+
317+ from int x
318+ where p(x) and q(x)
319+ select x
320+
321+ ..
322+
323+
292324``pragma[noinline] ``
293325--------------------
294326
You can’t perform that action at this time.
0 commit comments