1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | #ifndef _OPT_SUPPORT_H |
10 | #define _OPT_SUPPORT_H |
11 | |
12 | #include "mal.h" |
13 | #include "mal_function.h" |
14 | #include "mal_scenario.h" |
15 | #include "mal_builder.h" |
16 | |
17 | /* |
18 | * The optimizers should all be equiped with debugging code |
19 | * to easily trace their performance. |
20 | */ |
21 | mal_export str MALoptimizer(Client c); |
22 | mal_export str optimizeMALBlock(Client cntxt, MalBlkPtr mb); |
23 | mal_export void showOptimizerStep(str fnme,int i, int flg); |
24 | mal_export void showOptimizerHistory(void); |
25 | |
26 | mal_export int optimizerIsApplied(MalBlkPtr mb, str name); |
27 | mal_export int isUnsafeInstruction(InstrPtr q); |
28 | mal_export int isUnsafeFunction(InstrPtr q); |
29 | mal_export int isSealedFunction(InstrPtr q); |
30 | mal_export int safetyBarrier(InstrPtr p, InstrPtr q); |
31 | mal_export int hasSameSignature(MalBlkPtr mb, InstrPtr p, InstrPtr q); |
32 | mal_export int hasSameArguments(MalBlkPtr mb, InstrPtr p, InstrPtr q); |
33 | mal_export int hasCommonResults(InstrPtr p, InstrPtr q); |
34 | mal_export int isUpdateInstruction(InstrPtr p); |
35 | mal_export int hasSideEffects(MalBlkPtr mb, InstrPtr p, int strict); |
36 | mal_export int mayhaveSideEffects(Client cntxt, MalBlkPtr mb, InstrPtr p, int strict); |
37 | mal_export int isSideEffectFree(MalBlkPtr mb); |
38 | mal_export int isBlocking(InstrPtr p); |
39 | mal_export int isFragmentGroup(InstrPtr q); |
40 | mal_export int isFragmentGroup2(InstrPtr q); |
41 | mal_export int isDelta(InstrPtr q); |
42 | mal_export int isMatJoinOp(InstrPtr q); |
43 | mal_export int isMatLeftJoinOp(InstrPtr q); |
44 | mal_export int isMapOp(InstrPtr q); |
45 | mal_export int isLikeOp(InstrPtr q); |
46 | mal_export int isTopn(InstrPtr q); |
47 | mal_export int isSlice(InstrPtr q); |
48 | mal_export int isSample(InstrPtr q); |
49 | mal_export int isOrderby(InstrPtr q); |
50 | mal_export int isSelect(InstrPtr q); |
51 | mal_export int isSubJoin(InstrPtr q); |
52 | mal_export int isMultiplex(InstrPtr q); |
53 | mal_export int isOptimizerEnabled(MalBlkPtr mb, str opt); |
54 | |
55 | #endif /* _OPT_SUPPORT_H */ |
56 | |
57 | |