LLVM  13.0.0git
Macros | Functions | Variables
LoopRerollPass.cpp File Reference
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AliasSetTracker.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/LoopReroll.h"
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <map>
#include <utility>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loop-reroll"
 

Functions

 STATISTIC (NumRerolledLoops, "Number of rerolled loops")
 
 INITIALIZE_PASS_BEGIN (LoopRerollLegacyPass, "loop-reroll", "Reroll loops", false, false) INITIALIZE_PASS_END(LoopRerollLegacyPass
 
static bool hasUsesOutsideLoop (Instruction *I, Loop *L)
 
static bool isUnorderedLoadStore (Instruction *I)
 
static bool isSimpleArithmeticOp (User *IVU)
 Return true if IVU is a "simple" arithmetic operation. More...
 
static bool isLoopIncrement (User *U, Instruction *IV)
 
static bool isIgnorableInst (const Instruction *I)
 

Variables

static cl::opt< unsigned > NumToleratedFailedMatches ("reroll-num-tolerated-failed-matches", cl::init(400), cl::Hidden, cl::desc("The maximum number of failures to tolerate" " during fuzzy matching. (default: 400)"))
 
loop reroll
 
loop Reroll loops
 
loop Reroll false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loop-reroll"

Definition at line 69 of file LoopRerollPass.cpp.

Function Documentation

◆ hasUsesOutsideLoop()

static bool hasUsesOutsideLoop ( Instruction I,
Loop L 
)
static

Definition at line 511 of file LoopRerollPass.cpp.

References llvm::LoopBase< BlockT, LoopT >::contains(), and I.

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( LoopRerollLegacyPass  ,
"loop-reroll ,
"Reroll loops ,
false  ,
false   
)

◆ isIgnorableInst()

static bool isIgnorableInst ( const Instruction I)
static

Definition at line 1138 of file LoopRerollPass.cpp.

References llvm::IntrinsicInst::getIntrinsicID(), and I.

◆ isLoopIncrement()

static bool isLoopIncrement ( User U,
Instruction IV 
)
static

◆ isSimpleArithmeticOp()

static bool isSimpleArithmeticOp ( User IVU)
static

Return true if IVU is a "simple" arithmetic operation.

This is used for narrowing the search space for DAGRoots; only arithmetic and GEPs can be part of a DAGRoot.

Definition at line 752 of file LoopRerollPass.cpp.

References llvm::MCID::Add, and I.

◆ isUnorderedLoadStore()

static bool isUnorderedLoadStore ( Instruction I)
static

Definition at line 739 of file LoopRerollPass.cpp.

References I, MI, and SI.

◆ STATISTIC()

STATISTIC ( NumRerolledLoops  ,
"Number of rerolled loops  
)

Variable Documentation

◆ false

loop Reroll false

Definition at line 503 of file LoopRerollPass.cpp.

◆ loops

loop Reroll loops

Definition at line 503 of file LoopRerollPass.cpp.

◆ NumToleratedFailedMatches

cl::opt<unsigned> NumToleratedFailedMatches("reroll-num-tolerated-failed-matches", cl::init(400), cl::Hidden, cl::desc("The maximum number of failures to tolerate" " during fuzzy matching. (default: 400)"))
static

◆ reroll

bool LoopReroll::reroll

Definition at line 503 of file LoopRerollPass.cpp.