comparison include/llvm/Transforms/Scalar.h @ 77:54457678186b LLVM3.6

LLVM 3.6
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Mon, 08 Sep 2014 22:06:00 +0900
parents e4204d083e25
children 67baa08a3894 60c9769439b8
comparison
equal deleted inserted replaced
34:e874dbf0ad9d 77:54457678186b
17 17
18 #include "llvm/ADT/StringRef.h" 18 #include "llvm/ADT/StringRef.h"
19 19
20 namespace llvm { 20 namespace llvm {
21 21
22 class BasicBlockPass;
22 class FunctionPass; 23 class FunctionPass;
23 class Pass; 24 class Pass;
24 class GetElementPtrInst; 25 class GetElementPtrInst;
25 class PassInfo; 26 class PassInfo;
26 class TerminatorInst; 27 class TerminatorInst;
33 // 34 //
34 FunctionPass *createConstantPropagationPass(); 35 FunctionPass *createConstantPropagationPass();
35 36
36 //===----------------------------------------------------------------------===// 37 //===----------------------------------------------------------------------===//
37 // 38 //
39 // AlignmentFromAssumptions - Use assume intrinsics to set load/store
40 // alignments.
41 //
42 FunctionPass *createAlignmentFromAssumptionsPass();
43
44 //===----------------------------------------------------------------------===//
45 //
38 // SCCP - Sparse conditional constant propagation. 46 // SCCP - Sparse conditional constant propagation.
39 // 47 //
40 FunctionPass *createSCCPPass(); 48 FunctionPass *createSCCPPass();
41 49
42 //===----------------------------------------------------------------------===// 50 //===----------------------------------------------------------------------===//
120 // LoopStrengthReduce - This pass is strength reduces GEP instructions that use 128 // LoopStrengthReduce - This pass is strength reduces GEP instructions that use
121 // a loop's canonical induction variable as one of their indices. 129 // a loop's canonical induction variable as one of their indices.
122 // 130 //
123 Pass *createLoopStrengthReducePass(); 131 Pass *createLoopStrengthReducePass();
124 132
125 Pass *createGlobalMergePass(const TargetMachine *TM = 0); 133 Pass *createGlobalMergePass(const TargetMachine *TM = nullptr);
126 134
127 //===----------------------------------------------------------------------===// 135 //===----------------------------------------------------------------------===//
128 // 136 //
129 // LoopUnswitch - This pass is a simple loop unswitching pass. 137 // LoopUnswitch - This pass is a simple loop unswitching pass.
130 // 138 //
140 // 148 //
141 // LoopUnroll - This pass is a simple loop unrolling pass. 149 // LoopUnroll - This pass is a simple loop unrolling pass.
142 // 150 //
143 Pass *createLoopUnrollPass(int Threshold = -1, int Count = -1, 151 Pass *createLoopUnrollPass(int Threshold = -1, int Count = -1,
144 int AllowPartial = -1, int Runtime = -1); 152 int AllowPartial = -1, int Runtime = -1);
153 // Create an unrolling pass for full unrolling only.
154 Pass *createSimpleLoopUnrollPass();
145 155
146 //===----------------------------------------------------------------------===// 156 //===----------------------------------------------------------------------===//
147 // 157 //
148 // LoopReroll - This pass is a simple loop rerolling pass. 158 // LoopReroll - This pass is a simple loop rerolling pass.
149 // 159 //
151 161
152 //===----------------------------------------------------------------------===// 162 //===----------------------------------------------------------------------===//
153 // 163 //
154 // LoopRotate - This pass is a simple loop rotating pass. 164 // LoopRotate - This pass is a simple loop rotating pass.
155 // 165 //
156 Pass *createLoopRotatePass(); 166 Pass *createLoopRotatePass(int MaxHeaderSize = -1);
157 167
158 //===----------------------------------------------------------------------===// 168 //===----------------------------------------------------------------------===//
159 // 169 //
160 // LoopIdiom - This pass recognizes and replaces idioms in loops. 170 // LoopIdiom - This pass recognizes and replaces idioms in loops.
161 // 171 //
162 Pass *createLoopIdiomPass(); 172 Pass *createLoopIdiomPass();
163 173
164 //===----------------------------------------------------------------------===// 174 //===----------------------------------------------------------------------===//
165 // 175 //
166 // PromoteMemoryToRegister - This pass is used to promote memory references to 176 // PromoteMemoryToRegister - This pass is used to promote memory references to
167 // be register references. A simple example of the transformation performed by 177 // be register references. A simple example of the transformation performed by
168 // this pass is: 178 // this pass is:
197 // 207 //
198 // JumpThreading - Thread control through mult-pred/multi-succ blocks where some 208 // JumpThreading - Thread control through mult-pred/multi-succ blocks where some
199 // preds always go to some succ. 209 // preds always go to some succ.
200 // 210 //
201 FunctionPass *createJumpThreadingPass(); 211 FunctionPass *createJumpThreadingPass();
202 212
203 //===----------------------------------------------------------------------===// 213 //===----------------------------------------------------------------------===//
204 // 214 //
205 // CFGSimplification - Merge basic blocks, eliminate unreachable blocks, 215 // CFGSimplification - Merge basic blocks, eliminate unreachable blocks,
206 // simplify terminator instructions, etc... 216 // simplify terminator instructions, etc...
207 // 217 //
260 FunctionPass *createLowerSwitchPass(); 270 FunctionPass *createLowerSwitchPass();
261 extern char &LowerSwitchID; 271 extern char &LowerSwitchID;
262 272
263 //===----------------------------------------------------------------------===// 273 //===----------------------------------------------------------------------===//
264 // 274 //
265 // LowerInvoke - This pass converts invoke and unwind instructions to use sjlj 275 // LowerInvoke - This pass removes invoke instructions, converting them to call
266 // exception handling mechanisms. Note that after this pass runs the CFG is not 276 // instructions.
267 // entirely accurate (exceptional control flow edges are not correct anymore) so 277 //
268 // only very simple things should be done after the lowerinvoke pass has run 278 FunctionPass *createLowerInvokePass();
269 // (like generation of native code). This should *NOT* be used as a general
270 // purpose "my LLVM-to-LLVM pass doesn't support the invoke instruction yet"
271 // lowering pass.
272 //
273 FunctionPass *createLowerInvokePass(const TargetMachine *TM = 0,
274 bool useExpensiveEHSupport = false);
275 extern char &LowerInvokePassID; 279 extern char &LowerInvokePassID;
276 280
277 //===----------------------------------------------------------------------===// 281 //===----------------------------------------------------------------------===//
278 // 282 //
279 // LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop 283 // LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
286 // 290 //
287 // EarlyCSE - This pass performs a simple and fast CSE pass over the dominator 291 // EarlyCSE - This pass performs a simple and fast CSE pass over the dominator
288 // tree. 292 // tree.
289 // 293 //
290 FunctionPass *createEarlyCSEPass(); 294 FunctionPass *createEarlyCSEPass();
291 295
292 //===----------------------------------------------------------------------===// 296 //===----------------------------------------------------------------------===//
293 // 297 //
294 // GVN - This pass performs global value numbering and redundant load 298 // MergedLoadStoreMotion - This pass merges loads and stores in diamonds. Loads
299 // are hoisted into the header, while stores sink into the footer.
300 //
301 FunctionPass *createMergedLoadStoreMotionPass();
302
303 //===----------------------------------------------------------------------===//
304 //
305 // GVN - This pass performs global value numbering and redundant load
295 // elimination cotemporaneously. 306 // elimination cotemporaneously.
296 // 307 //
297 FunctionPass *createGVNPass(bool NoLoads = false); 308 FunctionPass *createGVNPass(bool NoLoads = false);
298 309
299 //===----------------------------------------------------------------------===// 310 //===----------------------------------------------------------------------===//
307 // 318 //
308 // LoopDeletion - This pass performs DCE of non-infinite loops that it 319 // LoopDeletion - This pass performs DCE of non-infinite loops that it
309 // can prove are dead. 320 // can prove are dead.
310 // 321 //
311 Pass *createLoopDeletionPass(); 322 Pass *createLoopDeletionPass();
312 323
313 //===----------------------------------------------------------------------===// 324 //===----------------------------------------------------------------------===//
314 // 325 //
315 // CodeGenPrepare - This pass prepares a function for instruction selection. 326 // ConstantHoisting - This pass prepares a function for expensive constants.
316 // 327 //
317 FunctionPass *createCodeGenPreparePass(const TargetMachine *TM = 0); 328 FunctionPass *createConstantHoistingPass();
318 329
319 //===----------------------------------------------------------------------===// 330 //===----------------------------------------------------------------------===//
320 // 331 //
321 // InstructionNamer - Give any unnamed non-void instructions "tmp" names. 332 // InstructionNamer - Give any unnamed non-void instructions "tmp" names.
322 // 333 //
323 FunctionPass *createInstructionNamerPass(); 334 FunctionPass *createInstructionNamerPass();
324 extern char &InstructionNamerID; 335 extern char &InstructionNamerID;
325 336
326 //===----------------------------------------------------------------------===// 337 //===----------------------------------------------------------------------===//
327 // 338 //
328 // Sink - Code Sinking 339 // Sink - Code Sinking
329 // 340 //
330 FunctionPass *createSinkingPass(); 341 FunctionPass *createSinkingPass();
345 // 356 //
346 // InstructionSimplifier - Remove redundant instructions. 357 // InstructionSimplifier - Remove redundant instructions.
347 // 358 //
348 FunctionPass *createInstructionSimplifierPass(); 359 FunctionPass *createInstructionSimplifierPass();
349 extern char &InstructionSimplifierID; 360 extern char &InstructionSimplifierID;
350
351 361
352 //===----------------------------------------------------------------------===// 362 //===----------------------------------------------------------------------===//
353 // 363 //
354 // LowerExpectIntrinsics - Removes llvm.expect intrinsics and creates 364 // LowerExpectIntrinsics - Removes llvm.expect intrinsics and creates
355 // "block_weights" metadata. 365 // "block_weights" metadata.
356 FunctionPass *createLowerExpectIntrinsicPass(); 366 FunctionPass *createLowerExpectIntrinsicPass();
357
358 367
359 //===----------------------------------------------------------------------===// 368 //===----------------------------------------------------------------------===//
360 // 369 //
361 // PartiallyInlineLibCalls - Tries to inline the fast path of library 370 // PartiallyInlineLibCalls - Tries to inline the fast path of library
362 // calls such as sqrt. 371 // calls such as sqrt.
374 // 383 //
375 // ScalarizerPass - Converts vector operations into scalar operations 384 // ScalarizerPass - Converts vector operations into scalar operations
376 // 385 //
377 FunctionPass *createScalarizerPass(); 386 FunctionPass *createScalarizerPass();
378 387
388 //===----------------------------------------------------------------------===//
389 //
390 // AddDiscriminators - Add DWARF path discriminators to the IR.
391 FunctionPass *createAddDiscriminatorsPass();
392
393 //===----------------------------------------------------------------------===//
394 //
395 // SeparateConstOffsetFromGEP - Split GEPs for better CSE
396 //
397 FunctionPass *createSeparateConstOffsetFromGEPPass();
398
399 //===----------------------------------------------------------------------===//
400 //
401 // LoadCombine - Combine loads into bigger loads.
402 //
403 BasicBlockPass *createLoadCombinePass();
404
379 } // End llvm namespace 405 } // End llvm namespace
380 406
381 #endif 407 #endif