Class: LLVM::PassManager

Inherits:
Object
  • Object
show all
Defined in:
lib/llvm/core/pass_manager.rb,
lib/llvm/transforms/ipo.rb,
lib/llvm/transforms/utils.rb,
lib/llvm/transforms/scalar.rb,
lib/llvm/transforms/vectorize.rb

Overview

The PassManager runs a queue of passes on a module. See llvm.org/docs/Passes.html for the list of available passes.

Direct Known Subclasses

FunctionPassManager

Instance Method Summary collapse

Constructor Details

#initialize(machine = nil) ⇒ PassManager

Creates a new pass manager.

Parameters:



15
16
17
18
19
# File 'lib/llvm/core/pass_manager.rb', line 15

def initialize(machine = nil)
  warn("[DEPRECATION] PassManager.new should be called without parameters") if machine

  @ptr = C.create_pass_manager()
end

Instance Method Details

#<<(name) ⇒ LLVM::PassManager

Append a pass to the pass queue.

Parameters:

  • name (Symbol)

Returns:



30
31
32
33
34
# File 'lib/llvm/core/pass_manager.rb', line 30

def <<(name)
  send(:"#{name}!")

  self
end

#adce!Object

/** See llvm::createAggressiveDCEPass function. */ void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);

Raises:



11
12
13
# File 'lib/llvm/transforms/scalar.rb', line 11

def adce!
  raise DeprecationError
end

#add_discriminators!Object

/** See llvm::createAddDiscriminatorsPass function. */ void LLVMAddAddDiscriminatorsPass(LLVMPassManagerRef PM);

Raises:



25
26
27
# File 'lib/llvm/transforms/utils.rb', line 25

def add_discriminators!
  raise DeprecationError
end

#alignment_from_assumptions!Object

/** See llvm::createAlignmentFromAssumptionsPass function. */ void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM);

Raises:



32
33
34
# File 'lib/llvm/transforms/scalar.rb', line 32

def alignment_from_assumptions!
  raise DeprecationError
end

#always_inline!Object

/** See llvm::createAlwaysInlinerPass function. */ void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM);

Raises:



59
60
61
# File 'lib/llvm/transforms/ipo.rb', line 59

def always_inline!
  raise DeprecationError
end

#arg_promote!Object

Raises:



10
11
12
# File 'lib/llvm/transforms/ipo.rb', line 10

def arg_promote!
  raise DeprecationError
end

#basicaa!Object

/** See llvm::createBasicAliasAnalysisPass function */ void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);

Raises:



304
305
306
# File 'lib/llvm/transforms/scalar.rb', line 304

def basicaa!
  raise DeprecationError
end

#bb_vectorize!Object

Raises:



9
10
11
# File 'lib/llvm/transforms/vectorize.rb', line 9

def bb_vectorize!
  raise DeprecationError
end

#bdce!Object

/** See llvm::createBitTrackingDCEPass function. */ void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM);

Raises:



25
26
27
# File 'lib/llvm/transforms/scalar.rb', line 25

def bdce!
  raise DeprecationError
end

#called_value_propagation!Object

/** See llvm::createCalledValuePropagationPass function. */ void LLVMAddCalledValuePropagationPass(LLVMPassManagerRef PM);

Raises:



31
32
33
# File 'lib/llvm/transforms/ipo.rb', line 31

def called_value_propagation!
  raise DeprecationError
end

#const_merge!Object

/** See llvm::createConstantMergePass function. */ void LLVMAddConstantMergePass(LLVMPassManagerRef PM);

Raises:



17
18
19
# File 'lib/llvm/transforms/ipo.rb', line 17

def const_merge!
  raise DeprecationError
end

#constprop!Object

Raises:



234
235
236
# File 'lib/llvm/transforms/scalar.rb', line 234

def constprop!
  raise DeprecationError
end

#cvprop!Object

/** See llvm::createCorrelatedValuePropagationPass function */ void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM);

Raises:



255
256
257
# File 'lib/llvm/transforms/scalar.rb', line 255

def cvprop!
  raise DeprecationError
end

#dae!Object

/** See llvm::createDeadArgEliminationPass function. */ void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM);

Raises:



38
39
40
# File 'lib/llvm/transforms/ipo.rb', line 38

def dae!
  raise DeprecationError
end

#dce!Object

/** See llvm::createDeadCodeEliminationPass function. */ void LLVMAddDCEPass(LLVMPassManagerRef PM);

Raises:



18
19
20
# File 'lib/llvm/transforms/scalar.rb', line 18

def dce!
  raise DeprecationError
end

#disposeObject

Disposes the pass manager.



45
46
47
48
49
50
51
52
# File 'lib/llvm/core/pass_manager.rb', line 45

def dispose
  return if @ptr.nil?

  finalize

  C.dispose_pass_manager(@ptr)
  @ptr = nil
end

#dse!Object

/** See llvm::createDeadStoreEliminationPass function. */ void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM);

Raises:



46
47
48
# File 'lib/llvm/transforms/scalar.rb', line 46

def dse!
  raise DeprecationError
end

#early_cse!Object

/** See llvm::createEarlyCSEPass function */ void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM);

Raises:



262
263
264
# File 'lib/llvm/transforms/scalar.rb', line 262

def early_cse!
  raise DeprecationError
end

#early_cse_memssa!Object

/** See llvm::createEarlyCSEPass function */ void LLVMAddEarlyCSEMemSSAPass(LLVMPassManagerRef PM);

Raises:



269
270
271
# File 'lib/llvm/transforms/scalar.rb', line 269

def early_cse_memssa!
  raise DeprecationError
end

#fun_attrs!Object

/** See llvm::createFunctionAttrsPass function. */ void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM);

Raises:



45
46
47
# File 'lib/llvm/transforms/ipo.rb', line 45

def fun_attrs!
  raise DeprecationError
end

#gdce!Object

/** See llvm::createGlobalDCEPass function. */ void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM);

Raises:



66
67
68
# File 'lib/llvm/transforms/ipo.rb', line 66

def gdce!
  raise DeprecationError
end

#global_opt!Object

/** See llvm::createGlobalOptimizerPass function. */ void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM);

Raises:



73
74
75
# File 'lib/llvm/transforms/ipo.rb', line 73

def global_opt!
  raise DeprecationError
end

#gvn!Object

/** See llvm::createGVNPass function. */ void LLVMAddGVNPass(LLVMPassManagerRef PM);

Raises:



67
68
69
# File 'lib/llvm/transforms/scalar.rb', line 67

def gvn!
  raise DeprecationError
end

#indvars!Object

/** See llvm::createIndVarSimplifyPass function. */ void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);

Raises:



81
82
83
# File 'lib/llvm/transforms/scalar.rb', line 81

def indvars!
  raise DeprecationError
end

#inline!Object

/** See llvm::createFunctionInliningPass function. */ void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM);

Raises:



52
53
54
# File 'lib/llvm/transforms/ipo.rb', line 52

def inline!
  raise DeprecationError
end

#instcombine!Object

/** See llvm::createInstructionCombiningPass function. */ void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);

Raises:



88
89
90
# File 'lib/llvm/transforms/scalar.rb', line 88

def instcombine!
  raise DeprecationError
end

#instsimplify!Object

/** See llvm::createInstSimplifyLegacyPass function. */ void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM);

Raises:



95
96
97
# File 'lib/llvm/transforms/scalar.rb', line 95

def instsimplify!
  raise DeprecationError
end

#internalize!(_all_but_main = true) ⇒ Object

/** See llvm::createInternalizePass function. */ void LLVMAddInternalizePass(LLVMPassManagerRef, unsigned AllButMain);

Raises:



99
100
101
# File 'lib/llvm/transforms/ipo.rb', line 99

def internalize!(_all_but_main = true)
  raise DeprecationError
end

#ipcp!Object

Raises:



78
79
80
# File 'lib/llvm/transforms/ipo.rb', line 78

def ipcp!
  raise DeprecationError
end

#ipsccp!Object

/** See llvm::createIPSCCPPass function. */ void LLVMAddIPSCCPPass(LLVMPassManagerRef PM);

Raises:



92
93
94
# File 'lib/llvm/transforms/ipo.rb', line 92

def ipsccp!
  raise DeprecationError
end

#jump_threading!Object

/** See llvm::createJumpThreadingPass function. */ void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);

Raises:



102
103
104
# File 'lib/llvm/transforms/scalar.rb', line 102

def jump_threading!
  raise DeprecationError
end

#licm!Object

/** See llvm::createLICMPass function. */ void LLVMAddLICMPass(LLVMPassManagerRef PM);

Raises:



109
110
111
# File 'lib/llvm/transforms/scalar.rb', line 109

def licm!
  raise DeprecationError
end

#loop_deletion!Object

/** See llvm::createLoopDeletionPass function. */ void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);

Raises:



116
117
118
# File 'lib/llvm/transforms/scalar.rb', line 116

def loop_deletion!
  raise DeprecationError
end

#loop_idiom!Object

/** See llvm::createLoopIdiomPass function */ void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);

Raises:



123
124
125
# File 'lib/llvm/transforms/scalar.rb', line 123

def loop_idiom!
  raise DeprecationError
end

#loop_reroll!Object

/** See llvm::createLoopRerollPass function. */ void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);

Raises:



137
138
139
# File 'lib/llvm/transforms/scalar.rb', line 137

def loop_reroll!
  raise DeprecationError
end

#loop_rotate!Object

/** See llvm::createLoopRotatePass function. */ void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);

Raises:



130
131
132
# File 'lib/llvm/transforms/scalar.rb', line 130

def loop_rotate!
  raise DeprecationError
end

#loop_unroll!Object

Raises:



144
145
146
# File 'lib/llvm/transforms/scalar.rb', line 144

def loop_unroll!
  raise DeprecationError
end

#loop_unroll_and_jam!Object

/** See llvm::createLoopUnrollAndJamPass function. */ void LLVMAddLoopUnrollAndJamPass(LLVMPassManagerRef PM);

Raises:



151
152
153
# File 'lib/llvm/transforms/scalar.rb', line 151

def loop_unroll_and_jam!
  raise DeprecationError
end

#loop_unswitch!Object

Raises:



156
157
158
# File 'lib/llvm/transforms/scalar.rb', line 156

def loop_unswitch!
  raise DeprecationError
end

#loop_vectorize!Object

/** See llvm::createLoopVectorizePass function. */ void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM);

Raises:



16
17
18
# File 'lib/llvm/transforms/vectorize.rb', line 16

def loop_vectorize!
  raise DeprecationError
end

#lower_constant_intrinsics!Object

/** See llvm::createLowerConstantIntrinsicsPass function */ void LLVMAddLowerConstantIntrinsicsPass(LLVMPassManagerRef PM);

Raises:



283
284
285
# File 'lib/llvm/transforms/scalar.rb', line 283

def lower_constant_intrinsics!
  raise DeprecationError
end

#lower_expect!Object

/** See llvm::createLowerExpectIntrinsicPass function */ void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM);

Raises:



276
277
278
# File 'lib/llvm/transforms/scalar.rb', line 276

def lower_expect!
  raise DeprecationError
end

#loweratomic!Object

/** See llvm::createLowerAtomicPass function. */ void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM);

Raises:



163
164
165
# File 'lib/llvm/transforms/scalar.rb', line 163

def loweratomic!
  raise DeprecationError
end

#lowerswitch!Object

/** See llvm::createLowerSwitchPass function. */ void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM);

Raises:



11
12
13
# File 'lib/llvm/transforms/utils.rb', line 11

def lowerswitch!
  raise DeprecationError
end

#mem2reg!Object

/** See llvm::createPromoteMemoryToRegisterPass function. */ void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);

Raises:



18
19
20
# File 'lib/llvm/transforms/utils.rb', line 18

def mem2reg!
  raise DeprecationError
end

#memcpyopt!Object

/** See llvm::createMemCpyOptPass function. */ void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);

Raises:



170
171
172
# File 'lib/llvm/transforms/scalar.rb', line 170

def memcpyopt!
  raise DeprecationError
end

#mergefunc!Object

/** See llvm::createMergeFunctionsPass function. */ void LLVMAddMergeFunctionsPass(LLVMPassManagerRef PM);

Raises:



24
25
26
# File 'lib/llvm/transforms/ipo.rb', line 24

def mergefunc!
  raise DeprecationError
end

#mergereturn!Object

/** See llvm::createUnifyFunctionExitNodesPass function */ void LLVMAddUnifyFunctionExitNodesPass(LLVMPassManagerRef PM);

Raises:



311
312
313
# File 'lib/llvm/transforms/scalar.rb', line 311

def mergereturn!
  raise DeprecationError
end

#mldst_motion!Object

/** See llvm::createMergedLoadStoreMotionPass function. */ void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM);

Raises:



60
61
62
# File 'lib/llvm/transforms/scalar.rb', line 60

def mldst_motion!
  raise DeprecationError
end

#newgvn!Object

/** See llvm::createGVNPass function. */ void LLVMAddNewGVNPass(LLVMPassManagerRef PM);

Raises:



74
75
76
# File 'lib/llvm/transforms/scalar.rb', line 74

def newgvn!
  raise DeprecationError
end

#partially_inline_libcalls!Object

/** See llvm::createPartiallyInlineLibCallsPass function. */ void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);

Raises:



177
178
179
# File 'lib/llvm/transforms/scalar.rb', line 177

def partially_inline_libcalls!
  raise DeprecationError
end

#prune_eh!Object

/** See llvm::createPruneEHPass function. */ void LLVMAddPruneEHPass(LLVMPassManagerRef PM);

Raises:



85
86
87
# File 'lib/llvm/transforms/ipo.rb', line 85

def prune_eh!
  raise DeprecationError
end

#reassociate!Object

/** See llvm::createReassociatePass function. */ void LLVMAddReassociatePass(LLVMPassManagerRef PM);

Raises:



184
185
186
# File 'lib/llvm/transforms/scalar.rb', line 184

def reassociate!
  raise DeprecationError
end

#reg2mem!Object

/** See llvm::demotePromoteMemoryToRegisterPass function. */ void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);

Raises:



241
242
243
# File 'lib/llvm/transforms/scalar.rb', line 241

def reg2mem!
  raise DeprecationError
end

#run(mod) ⇒ true, false

Run the pass queue on the given module.

Parameters:

Returns:

  • (true, false)

    Indicates whether the module was modified.



40
41
42
# File 'lib/llvm/core/pass_manager.rb', line 40

def run(mod)
  C.run_pass_manager(self, mod) != 0
end

#scalarizer!Object

/** See llvm::createScalarizerPass function. */ void LLVMAddScalarizerPass(LLVMPassManagerRef PM);

Raises:



53
54
55
# File 'lib/llvm/transforms/scalar.rb', line 53

def scalarizer!
  raise DeprecationError
end

#scalarrepl!Object

/** See llvm::createSROAPass function. */ void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);

Raises:



198
199
200
# File 'lib/llvm/transforms/scalar.rb', line 198

def scalarrepl!
  raise DeprecationError
end

#scalarrepl_ssa!Object

/** See llvm::createSROAPass function. */ void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM);

Raises:



205
206
207
# File 'lib/llvm/transforms/scalar.rb', line 205

def scalarrepl_ssa!
  raise DeprecationError
end

#scalarrepl_threshold!(_threshold = 0) ⇒ Object

/** See llvm::createSROAPass function. */ void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,

int Threshold);

threshold appears unused: llvm.org/doxygen/Scalar_8cpp_source.html#l00211

Raises:



214
215
216
# File 'lib/llvm/transforms/scalar.rb', line 214

def scalarrepl_threshold!(_threshold = 0)
  raise DeprecationError
end

#sccp!Object

/** See llvm::createSCCPPass function. */ void LLVMAddSCCPPass(LLVMPassManagerRef PM);

Raises:



191
192
193
# File 'lib/llvm/transforms/scalar.rb', line 191

def sccp!
  raise DeprecationError
end

#scoped_noalias_aa!Object

@ LLVMPass scoped-noalias-aa /** See llvm::createScopedNoAliasAAPass function */ void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM);

Raises:



297
298
299
# File 'lib/llvm/transforms/scalar.rb', line 297

def scoped_noalias_aa!
  raise DeprecationError
end

#sdp!Object

/** See llvm::createStripDeadPrototypesPass function. */ void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM);

Raises:



106
107
108
# File 'lib/llvm/transforms/ipo.rb', line 106

def sdp!
  raise DeprecationError
end

#simplify_libcalls!Object

/** See llvm::createSimplifyLibCallsPass function. */ void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM); removed: llvm.org/doxygen/Scalar_8cpp_source.html#l00211

Raises:



222
223
224
# File 'lib/llvm/transforms/scalar.rb', line 222

def simplify_libcalls!
  raise DeprecationError
end

#simplifycfg!Object

/** See llvm::createCFGSimplificationPass function. */ void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);

Raises:



39
40
41
# File 'lib/llvm/transforms/scalar.rb', line 39

def simplifycfg!
  raise DeprecationError
end

#slp_vectorize!Object

/** See llvm::createSLPVectorizerPass function. */ void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM);

Raises:



23
24
25
# File 'lib/llvm/transforms/vectorize.rb', line 23

def slp_vectorize!
  raise DeprecationError
end

#strip!Object

/** See llvm::createStripSymbolsPass function. */ void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM);

Raises:



113
114
115
# File 'lib/llvm/transforms/ipo.rb', line 113

def strip!
  raise DeprecationError
end

#tailcallelim!Object

/** See llvm::createTailCallEliminationPass function. */ void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);

Raises:



229
230
231
# File 'lib/llvm/transforms/scalar.rb', line 229

def tailcallelim!
  raise DeprecationError
end

#tbaa!Object

/** See llvm::createTypeBasedAliasAnalysisPass function */ void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);

Raises:



290
291
292
# File 'lib/llvm/transforms/scalar.rb', line 290

def tbaa!
  raise DeprecationError
end

#to_ptrObject



22
23
24
# File 'lib/llvm/core/pass_manager.rb', line 22

def to_ptr
  @ptr
end

#verify!Object

/** See llvm::createVerifierPass function. */ void LLVMAddVerifierPass(LLVMPassManagerRef PM);

Raises:



248
249
250
# File 'lib/llvm/transforms/scalar.rb', line 248

def verify!
  raise DeprecationError
end