comparison include/llvm/Transforms/Scalar.h @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 60c9769439b8
children b0dd3743370f 7d135dc70f03
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
14 14
15 #ifndef LLVM_TRANSFORMS_SCALAR_H 15 #ifndef LLVM_TRANSFORMS_SCALAR_H
16 #define LLVM_TRANSFORMS_SCALAR_H 16 #define LLVM_TRANSFORMS_SCALAR_H
17 17
18 #include "llvm/ADT/StringRef.h" 18 #include "llvm/ADT/StringRef.h"
19 #include <functional>
19 20
20 namespace llvm { 21 namespace llvm {
21 22
22 class BasicBlockPass; 23 class BasicBlockPass;
24 class Function;
23 class FunctionPass; 25 class FunctionPass;
24 class ModulePass; 26 class ModulePass;
25 class Pass; 27 class Pass;
26 class GetElementPtrInst; 28 class GetElementPtrInst;
27 class PassInfo; 29 class PassInfo;
89 91
90 //===----------------------------------------------------------------------===// 92 //===----------------------------------------------------------------------===//
91 // 93 //
92 // SROA - Replace aggregates or pieces of aggregates with scalar SSA values. 94 // SROA - Replace aggregates or pieces of aggregates with scalar SSA values.
93 // 95 //
94 FunctionPass *createSROAPass(bool RequiresDomTree = true); 96 FunctionPass *createSROAPass();
95 97
96 //===----------------------------------------------------------------------===// 98 //===----------------------------------------------------------------------===//
97 // 99 //
98 // ScalarReplAggregates - Break up alloca's of aggregates into multiple allocas 100 // ScalarReplAggregates - Break up alloca's of aggregates into multiple allocas
99 // if possible. 101 // if possible.
138 // 140 //
139 Pass *createLICMPass(); 141 Pass *createLICMPass();
140 142
141 //===----------------------------------------------------------------------===// 143 //===----------------------------------------------------------------------===//
142 // 144 //
145 // LoopInterchange - This pass interchanges loops to provide a more
146 // cache-friendly memory access patterns.
147 //
148 Pass *createLoopInterchangePass();
149
150 //===----------------------------------------------------------------------===//
151 //
143 // LoopStrengthReduce - This pass is strength reduces GEP instructions that use 152 // LoopStrengthReduce - This pass is strength reduces GEP instructions that use
144 // a loop's canonical induction variable as one of their indices. 153 // a loop's canonical induction variable as one of their indices.
145 // 154 //
146 Pass *createLoopStrengthReducePass(); 155 Pass *createLoopStrengthReducePass();
147 156
148 Pass *createGlobalMergePass(const TargetMachine *TM = nullptr); 157 //===----------------------------------------------------------------------===//
158 //
159 // GlobalMerge - This pass merges internal (by default) globals into structs
160 // to enable reuse of a base pointer by indexed addressing modes.
161 // It can also be configured to focus on size optimizations only.
162 //
163 Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
164 bool OnlyOptimizeForSize = false,
165 bool MergeExternalByDefault = false);
149 166
150 //===----------------------------------------------------------------------===// 167 //===----------------------------------------------------------------------===//
151 // 168 //
152 // LoopUnswitch - This pass is a simple loop unswitching pass. 169 // LoopUnswitch - This pass is a simple loop unswitching pass.
153 // 170 //
229 //===----------------------------------------------------------------------===// 246 //===----------------------------------------------------------------------===//
230 // 247 //
231 // CFGSimplification - Merge basic blocks, eliminate unreachable blocks, 248 // CFGSimplification - Merge basic blocks, eliminate unreachable blocks,
232 // simplify terminator instructions, etc... 249 // simplify terminator instructions, etc...
233 // 250 //
234 FunctionPass *createCFGSimplificationPass(int Threshold = -1); 251 FunctionPass *createCFGSimplificationPass(
252 int Threshold = -1, std::function<bool(const Function &)> Ftor = nullptr);
235 253
236 //===----------------------------------------------------------------------===// 254 //===----------------------------------------------------------------------===//
237 // 255 //
238 // FlattenCFG - flatten CFG, reduce number of conditional branches by using 256 // FlattenCFG - flatten CFG, reduce number of conditional branches by using
239 // parallel-and and parallel-or mode, etc... 257 // parallel-and and parallel-or mode, etc...
388 // 406 //
389 FunctionPass *createPartiallyInlineLibCallsPass(); 407 FunctionPass *createPartiallyInlineLibCallsPass();
390 408
391 //===----------------------------------------------------------------------===// 409 //===----------------------------------------------------------------------===//
392 // 410 //
393 // SampleProfilePass - Loads sample profile data from disk and generates
394 // IR metadata to reflect the profile.
395 FunctionPass *createSampleProfileLoaderPass();
396 FunctionPass *createSampleProfileLoaderPass(StringRef Name);
397
398 //===----------------------------------------------------------------------===//
399 //
400 // ScalarizerPass - Converts vector operations into scalar operations 411 // ScalarizerPass - Converts vector operations into scalar operations
401 // 412 //
402 FunctionPass *createScalarizerPass(); 413 FunctionPass *createScalarizerPass();
403 414
404 //===----------------------------------------------------------------------===// 415 //===----------------------------------------------------------------------===//
414 createSeparateConstOffsetFromGEPPass(const TargetMachine *TM = nullptr, 425 createSeparateConstOffsetFromGEPPass(const TargetMachine *TM = nullptr,
415 bool LowerGEP = false); 426 bool LowerGEP = false);
416 427
417 //===----------------------------------------------------------------------===// 428 //===----------------------------------------------------------------------===//
418 // 429 //
430 // SpeculativeExecution - Aggressively hoist instructions to enable
431 // speculative execution on targets where branches are expensive.
432 //
433 FunctionPass *createSpeculativeExecutionPass();
434
435 //===----------------------------------------------------------------------===//
436 //
419 // LoadCombine - Combine loads into bigger loads. 437 // LoadCombine - Combine loads into bigger loads.
420 // 438 //
421 BasicBlockPass *createLoadCombinePass(); 439 BasicBlockPass *createLoadCombinePass();
422 440
441 //===----------------------------------------------------------------------===//
442 //
443 // StraightLineStrengthReduce - This pass strength-reduces some certain
444 // instruction patterns in straight-line code.
445 //
423 FunctionPass *createStraightLineStrengthReducePass(); 446 FunctionPass *createStraightLineStrengthReducePass();
424
425 447
426 //===----------------------------------------------------------------------===// 448 //===----------------------------------------------------------------------===//
427 // 449 //
428 // PlaceSafepoints - Rewrite any IR calls to gc.statepoints and insert any 450 // PlaceSafepoints - Rewrite any IR calls to gc.statepoints and insert any
429 // safepoint polls (method entry, backedge) that might be required. This pass 451 // safepoint polls (method entry, backedge) that might be required. This pass
430 // does not generate explicit relocation sequences - that's handled by 452 // does not generate explicit relocation sequences - that's handled by
431 // RewriteStatepointsForGC which can be run at an arbitrary point in the pass 453 // RewriteStatepointsForGC which can be run at an arbitrary point in the pass
432 // order following this pass. 454 // order following this pass.
433 // 455 //
434 ModulePass *createPlaceSafepointsPass(); 456 FunctionPass *createPlaceSafepointsPass();
457
458 //===----------------------------------------------------------------------===//
459 //
460 // RewriteStatepointsForGC - Rewrite any gc.statepoints which do not yet have
461 // explicit relocations to include explicit relocations.
462 //
463 ModulePass *createRewriteStatepointsForGCPass();
464
465 //===----------------------------------------------------------------------===//
466 //
467 // Float2Int - Demote floats to ints where possible.
468 //
469 FunctionPass *createFloat2IntPass();
470
471 //===----------------------------------------------------------------------===//
472 //
473 // NaryReassociate - Simplify n-ary operations by reassociation.
474 //
475 FunctionPass *createNaryReassociatePass();
476
477 //===----------------------------------------------------------------------===//
478 //
479 // LoopDistribute - Distribute loops.
480 //
481 FunctionPass *createLoopDistributePass();
435 482
436 } // End llvm namespace 483 } // End llvm namespace
437 484
438 #endif 485 #endif