/
OtherFuncs
108 lines (75 loc) · 2.21 KB
/
OtherFuncs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# source("../funcGroups.R")
# group(setdiff(llvmFuns, unique(xpathSApply(doc, "//r:func", xmlValue))))
[need example] findFunction
Related to .llvm
[done] makeRFunction()
[ignore] run()
Context
getContext(), getGlobalContext()
[ignore] llvmLoadDLL
[done] llvmAddSymbol
[finish] findFunction to get address of routine in an ExecutionEngine and can pass that to
a regular C routine.
Example of compiling a routine and passing that to a routine.
sort is one example
numerical optimization
% Mention in exporting/importing IR code with other languages.
I/O of code
{write,read}BitCode, parseIR, parseAssembly
Pass manager
getPassManager
passManager
addPass, addAnalysisPasses
addPassesToEmitFile, stringRawOstream, rawFDOstream, formattedRawOstream
Different targets:
getLLVMTargets
getTargetTriple
{g,s}etDataLayout
lookupTarget
targetLibraryInfo
InitializeNVPTXTarget, InitializeCppBackendTarget
System-level commands
[done] llvmVersion
InitializeNativeTarget - should this be in back-ends
setAlignment
Explain module instance is specific to an execution engine
Module
Optimize
showModule
verifyModule
declareFunction
getModuleFunctions, getModuleGlobals
global variables, initializer
getGlobalVariables
getGlobalValue
setInitializer
Types
getType(any Value object)
pointerType, arrayType, structType, vectorType
getIntegerType
getTypeID
isBasicType, isArrayType, isPointerType, ...
sameType
getElementType
Walk the instructions and blocks
[done] getOperands, getOperand, getNumOperands
getCalledFunction and other class-specific functions
[not really very important] is* functions for querying type of instruction
[done] getParent,
[done]getBlocks
getName(getBlocks(module$v_dnorm)[[2]])
setName(getBlocks(module$dnorm)[[1]], "entry")
[done] block[] or getBlockInstructions
[done] getOpcode
[done] getTerminator
may* Functions
[done] setInsertPoint, setInsertBlock
[done] eraseFromParent, insertBefore, insertAfter, moveBefore
Attributes
[done] {set,get}FuncAttributes
[done]setParamAttributes
implement getParamAttributes
[done] Metadata
{get,set}Metadata
hasMetadata (and hasMetadataOtherThanDebugLoc)
e.g. declare a function a kernel for PTX.