File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
docs/codeql/ql-language-reference Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,39 @@ into the places where it is called. This can be useful when a predicate body is
289
289
compute entirely, as it ensures that the predicate is evaluated with the other contextual information
290
290
at the places where it is called.
291
291
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. Together, they tell the QL optimiser to use the
299
+ specified binding set for assessing join orders both in the body of the
300
+ annotated predicate and at call sites and to inline the body into call sites
301
+ after join ordering. This can be useful to prevent the optimiser from choosing
302
+ a sub-optimal join order.
303
+
304
+ For instance, in the example below, the ``pragma[inline_late] `` and
305
+ ``bindingset[x] `` annotations specifiy that calls to ``p `` should be join ordered
306
+ in a context where ``x `` is already bound. This forces the join orderer to
307
+ order ``q(x) `` before ``p(x) ``, which is more computationally efficient
308
+ than ordering ``p(x) `` before ``q(x) ``.
309
+
310
+ .. code-block :: ql
311
+
312
+ bindingset[x]
313
+ pragma[inline_late]
314
+ predicate p(int x) { x in [0..100000000] }
315
+
316
+ predicate q(int x) { x in [0..10000] }
317
+
318
+ from int x
319
+ where p(x) and q(x)
320
+ select x
321
+
322
+ ..
323
+
324
+
292
325
``pragma[noinline] ``
293
326
--------------------
294
327
You can’t perform that action at this time.
0 commit comments