Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/Transforms/Utils/LoopUtils.h
Show All 33 Lines | |||||
34 | namespace llvm { | 34 | namespace llvm { | ||
35 | 35 | | |||
36 | class AliasSet; | 36 | class AliasSet; | ||
37 | class AliasSetTracker; | 37 | class AliasSetTracker; | ||
38 | class BasicBlock; | 38 | class BasicBlock; | ||
39 | class DataLayout; | 39 | class DataLayout; | ||
40 | class Loop; | 40 | class Loop; | ||
41 | class LoopInfo; | 41 | class LoopInfo; | ||
42 | class MemorySSA; | ||||
43 | class MemorySSAUpdater; | ||||
42 | class OptimizationRemarkEmitter; | 44 | class OptimizationRemarkEmitter; | ||
43 | class PredicatedScalarEvolution; | 45 | class PredicatedScalarEvolution; | ||
44 | class PredIteratorCache; | 46 | class PredIteratorCache; | ||
45 | class ScalarEvolution; | 47 | class ScalarEvolution; | ||
46 | class SCEV; | 48 | class SCEV; | ||
47 | class TargetLibraryInfo; | 49 | class TargetLibraryInfo; | ||
48 | class TargetTransformInfo; | 50 | class TargetTransformInfo; | ||
49 | 51 | | |||
▲ Show 20 Lines • Show All 375 Lines • ▼ Show 20 Line(s) | |||||
425 | /// reverse depth first order w.r.t the DominatorTree. This allows us to visit | 427 | /// reverse depth first order w.r.t the DominatorTree. This allows us to visit | ||
426 | /// uses before definitions, allowing us to sink a loop body in one pass without | 428 | /// uses before definitions, allowing us to sink a loop body in one pass without | ||
427 | /// iteration. Takes DomTreeNode, AliasAnalysis, LoopInfo, DominatorTree, | 429 | /// iteration. Takes DomTreeNode, AliasAnalysis, LoopInfo, DominatorTree, | ||
428 | /// DataLayout, TargetLibraryInfo, Loop, AliasSet information for all | 430 | /// DataLayout, TargetLibraryInfo, Loop, AliasSet information for all | ||
429 | /// instructions of the loop and loop safety information as | 431 | /// instructions of the loop and loop safety information as | ||
430 | /// arguments. Diagnostics is emitted via \p ORE. It returns changed status. | 432 | /// arguments. Diagnostics is emitted via \p ORE. It returns changed status. | ||
431 | bool sinkRegion(DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *, | 433 | bool sinkRegion(DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *, | ||
432 | TargetLibraryInfo *, TargetTransformInfo *, Loop *, | 434 | TargetLibraryInfo *, TargetTransformInfo *, Loop *, | ||
433 | AliasSetTracker *, LoopSafetyInfo *, | 435 | AliasSetTracker *, LoopSafetyInfo *, MemorySSAUpdater *, | ||
434 | OptimizationRemarkEmitter *ORE); | 436 | MemorySSA *, OptimizationRemarkEmitter *ORE); | ||
435 | 437 | | |||
436 | /// \brief Walk the specified region of the CFG (defined by all blocks | 438 | /// \brief Walk the specified region of the CFG (defined by all blocks | ||
437 | /// dominated by the specified block, and that are in the current loop) in depth | 439 | /// dominated by the specified block, and that are in the current loop) in depth | ||
438 | /// first order w.r.t the DominatorTree. This allows us to visit definitions | 440 | /// first order w.r.t the DominatorTree. This allows us to visit definitions | ||
439 | /// before uses, allowing us to hoist a loop body in one pass without iteration. | 441 | /// before uses, allowing us to hoist a loop body in one pass without iteration. | ||
440 | /// Takes DomTreeNode, AliasAnalysis, LoopInfo, DominatorTree, DataLayout, | 442 | /// Takes DomTreeNode, AliasAnalysis, LoopInfo, DominatorTree, DataLayout, | ||
441 | /// TargetLibraryInfo, Loop, AliasSet information for all instructions of the | 443 | /// TargetLibraryInfo, Loop, AliasSet information for all instructions of the | ||
442 | /// loop and loop safety information as arguments. Diagnostics is emitted via \p | 444 | /// loop and loop safety information as arguments. Diagnostics is emitted via \p | ||
443 | /// ORE. It returns changed status. | 445 | /// ORE. It returns changed status. | ||
444 | bool hoistRegion(DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *, | 446 | bool hoistRegion(DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *, | ||
445 | TargetLibraryInfo *, Loop *, AliasSetTracker *, | 447 | TargetLibraryInfo *, Loop *, AliasSetTracker *, | ||
446 | LoopSafetyInfo *, OptimizationRemarkEmitter *ORE); | 448 | LoopSafetyInfo *, MemorySSAUpdater *, MemorySSA *, | ||
449 | OptimizationRemarkEmitter *); | ||||
447 | 450 | | |||
448 | /// This function deletes dead loops. The caller of this function needs to | 451 | /// This function deletes dead loops. The caller of this function needs to | ||
449 | /// guarantee that the loop is infact dead. | 452 | /// guarantee that the loop is infact dead. | ||
450 | /// The function requires a bunch or prerequisites to be present: | 453 | /// The function requires a bunch or prerequisites to be present: | ||
451 | /// - The loop needs to be in LCSSA form | 454 | /// - The loop needs to be in LCSSA form | ||
452 | /// - The loop needs to have a Preheader | 455 | /// - The loop needs to have a Preheader | ||
453 | /// - A unique dedicated exit block must exist | 456 | /// - A unique dedicated exit block must exist | ||
454 | /// | 457 | /// | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
524 | /// preheader to loop body (no speculation). | 527 | /// preheader to loop body (no speculation). | ||
525 | /// If SafetyInfo is not null, we are checking for hoisting/sinking | 528 | /// If SafetyInfo is not null, we are checking for hoisting/sinking | ||
526 | /// instructions from loop body to preheader/exit. Check if the instruction | 529 | /// instructions from loop body to preheader/exit. Check if the instruction | ||
527 | /// can execute speculatively. | 530 | /// can execute speculatively. | ||
528 | /// If \p ORE is set use it to emit optimization remarks. | 531 | /// If \p ORE is set use it to emit optimization remarks. | ||
529 | bool canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT, | 532 | bool canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT, | ||
530 | Loop *CurLoop, AliasSetTracker *CurAST, | 533 | Loop *CurLoop, AliasSetTracker *CurAST, | ||
531 | LoopSafetyInfo *SafetyInfo, | 534 | LoopSafetyInfo *SafetyInfo, | ||
535 | MemorySSAUpdater *MSSAUpdater, MemorySSA *MSSA, | ||||
532 | OptimizationRemarkEmitter *ORE = nullptr); | 536 | OptimizationRemarkEmitter *ORE = nullptr); | ||
533 | 537 | | |||
534 | /// Generates a vector reduction using shufflevectors to reduce the value. | 538 | /// Generates a vector reduction using shufflevectors to reduce the value. | ||
535 | Value *getShuffleReduction(IRBuilder<> &Builder, Value *Src, unsigned Op, | 539 | Value *getShuffleReduction(IRBuilder<> &Builder, Value *Src, unsigned Op, | ||
536 | RecurrenceDescriptor::MinMaxRecurrenceKind | 540 | RecurrenceDescriptor::MinMaxRecurrenceKind | ||
537 | MinMaxKind = RecurrenceDescriptor::MRK_Invalid, | 541 | MinMaxKind = RecurrenceDescriptor::MRK_Invalid, | ||
538 | ArrayRef<Value *> RedOps = ArrayRef<Value *>()); | 542 | ArrayRef<Value *> RedOps = ArrayRef<Value *>()); | ||
539 | 543 | | |||
Show All 29 Lines |