Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Macros |Functions |Variables
InductiveRangeCheckElimination.cpp File Reference
#include "llvm/Transforms/Scalar/InductiveRangeCheckElimination.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/PriorityWorklist.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/LoopAnalysisManager.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/LoopConstrainer.h"
#include "llvm/Transforms/Utils/LoopSimplify.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#include <algorithm>
#include <cassert>
#include <optional>
#include <utility>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "irce"
 

Functions

staticconstSCEVNoopOrExtend (constSCEV *S,Type *Ty,ScalarEvolution &SE,boolSigned)
 If the type ofS matches withTy, returnS.
 
static std::optional<LoopConstrainer::SubRangescalculateSubRanges (ScalarEvolution &SE,constLoop &L, InductiveRangeCheck::Range &Range,constLoopStructure &MainLoopStructure)
 
static std::optional< InductiveRangeCheck::Range > IntersectSignedRange (ScalarEvolution &SE,const std::optional< InductiveRangeCheck::Range > &R1,const InductiveRangeCheck::Range &R2)
 
static std::optional< InductiveRangeCheck::Range > IntersectUnsignedRange (ScalarEvolution &SE,const std::optional< InductiveRangeCheck::Range > &R1,const InductiveRangeCheck::Range &R2)
 

Variables

staticcl::opt<unsignedLoopSizeCutoff ("irce-loop-size-cutoff", cl::Hidden, cl::init(64))
 
staticcl::opt<boolPrintChangedLoops ("irce-print-changed-loops", cl::Hidden, cl::init(false))
 
staticcl::opt<boolPrintRangeChecks ("irce-print-range-checks", cl::Hidden, cl::init(false))
 
staticcl::opt<boolSkipProfitabilityChecks ("irce-skip-profitability-checks", cl::Hidden, cl::init(false))
 
staticcl::opt<unsignedMinEliminatedChecks ("irce-min-eliminated-checks", cl::Hidden, cl::init(10))
 
staticcl::opt<boolAllowUnsignedLatchCondition ("irce-allow-unsigned-latch", cl::Hidden, cl::init(true))
 
staticcl::opt<boolAllowNarrowLatchCondition ("irce-allow-narrow-latch", cl::Hidden, cl::init(true),cl::desc("If set totrue, IRCE may eliminate wide rangechecks inloops " "with narrow latch condition."))
 
staticcl::opt<unsignedMaxTypeSizeForOverflowCheck ("irce-max-type-size-for-overflow-check", cl::Hidden, cl::init(32),cl::desc("Maximum size of range check typefor which can be produced runtime " "overflow check of its limit's computation"))
 
staticcl::opt<boolPrintScaledBoundaryRangeChecks ("irce-print-scaled-boundary-range-checks", cl::Hidden, cl::init(false))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "irce"

Definition at line129 of fileInductiveRangeCheckElimination.cpp.

Function Documentation

◆ calculateSubRanges()

static std::optional<LoopConstrainer::SubRanges > calculateSubRanges(ScalarEvolutionSE,
constLoopL,
InductiveRangeCheck::Range & Range,
constLoopStructureMainLoopStructure 
)
static

Definition at line582 of fileInductiveRangeCheckElimination.cpp.

ReferencesAllowNarrowLatchCondition,End,llvm::LoopStructure::ExitCountTy,llvm::ScalarEvolution::getAddExpr(),llvm::IntegerType::getBitWidth(),llvm::ScalarEvolution::getMinusSCEV(),llvm::ScalarEvolution::getOne(),llvm::ScalarEvolution::getSCEV(),llvm::ScalarEvolution::getSMaxExpr(),llvm::ScalarEvolution::getSMinExpr(),llvm::ScalarEvolution::getUMaxExpr(),llvm::ScalarEvolution::getUMinExpr(),llvm::LoopStructure::IndVarIncreasing,llvm::LoopStructure::IndVarStart,llvm::ScalarEvolution::isKnownPredicate(),llvm::LoopStructure::IsSignedPredicate,llvm::LoopStructure::LoopExitAt,NoopOrExtend(), andRange.

◆ IntersectSignedRange()

static std::optional< InductiveRangeCheck::Range > IntersectSignedRange(ScalarEvolutionSE,
const std::optional< InductiveRangeCheck::Range > & R1,
const InductiveRangeCheck::Range & R2 
)
static

Definition at line844 of fileInductiveRangeCheckElimination.cpp.

Referencesassert(),llvm::ScalarEvolution::getSMaxExpr(),llvm::ScalarEvolution::getSMinExpr(), andR2.

◆ IntersectUnsignedRange()

static std::optional< InductiveRangeCheck::Range > IntersectUnsignedRange(ScalarEvolutionSE,
const std::optional< InductiveRangeCheck::Range > & R1,
const InductiveRangeCheck::Range & R2 
)
static

Definition at line873 of fileInductiveRangeCheckElimination.cpp.

Referencesassert(),llvm::ScalarEvolution::getUMaxExpr(),llvm::ScalarEvolution::getUMinExpr(), andR2.

◆ NoopOrExtend()

staticconstSCEV * NoopOrExtend(constSCEVS,
TypeTy,
ScalarEvolutionSE,
bool Signed 
)
static

If the type ofS matches withTy, returnS.

Otherwise, return signed or unsigned extension ofS to typeTy.

Definition at line573 of fileInductiveRangeCheckElimination.cpp.

Referencesllvm::ScalarEvolution::getNoopOrSignExtend(),llvm::ScalarEvolution::getNoopOrZeroExtend(), andSigned.

Referenced bycalculateSubRanges().

Variable Documentation

◆ AllowNarrowLatchCondition

cl::opt<bool > AllowNarrowLatchCondition("irce-allow-narrow-latch", cl::Hidden, cl::init(true),cl::desc("If set totrue, IRCE may eliminate wide rangechecks inloops " "with narrow latch condition."))("irce-allow-narrow-latch" ,
cl::Hidden ,
cl::init(true,
cl::desc("If set totrue, IRCE may eliminate wide rangechecks inloops " "with narrow latch condition.")  
)
static

Referenced bycalculateSubRanges().

◆ AllowUnsignedLatchCondition

cl::opt<bool > AllowUnsignedLatchCondition("irce-allow-unsigned-latch", cl::Hidden, cl::init(true))("irce-allow-unsigned-latch" ,
cl::Hidden ,
cl::init(true 
)
static

◆ LoopSizeCutoff

cl::opt<unsigned > LoopSizeCutoff("irce-loop-size-cutoff", cl::Hidden, cl::init(64))("irce-loop-size-cutoff" ,
cl::Hidden ,
cl::init(64)  
)
static

◆ MaxTypeSizeForOverflowCheck

cl::opt<unsigned > MaxTypeSizeForOverflowCheck("irce-max-type-size-for-overflow-check", cl::Hidden, cl::init(32),cl::desc( "Maximum size of range check typefor which can be produced runtime " "overflow check of its limit's computation"))("irce-max-type-size-for-overflow-check" ,
cl::Hidden ,
cl::init(32) ,
cl::desc( "Maximum size of range check typefor which can be produced runtime " "overflow check of its limit's computation")  
)
static

◆ MinEliminatedChecks

cl::opt<unsigned > MinEliminatedChecks("irce-min-eliminated-checks", cl::Hidden, cl::init(10))("irce-min-eliminated-checks" ,
cl::Hidden ,
cl::init(10)  
)
static

◆ PrintChangedLoops

cl::opt<bool > PrintChangedLoops("irce-print-changed-loops", cl::Hidden, cl::init(false))("irce-print-changed-loops" ,
cl::Hidden ,
cl::init(false)  
)
static

◆ PrintRangeChecks

cl::opt<bool > PrintRangeChecks("irce-print-range-checks", cl::Hidden, cl::init(false))("irce-print-range-checks" ,
cl::Hidden ,
cl::init(false)  
)
static

◆ PrintScaledBoundaryRangeChecks

cl::opt<bool > PrintScaledBoundaryRangeChecks("irce-print-scaled-boundary-range-checks", cl::Hidden, cl::init(false))("irce-print-scaled-boundary-range-checks" ,
cl::Hidden ,
cl::init(false)  
)
static

◆ SkipProfitabilityChecks

cl::opt<bool > SkipProfitabilityChecks("irce-skip-profitability-checks", cl::Hidden, cl::init(false))("irce-skip-profitability-checks" ,
cl::Hidden ,
cl::init(false)  
)
static

Referenced byllvm::IRCEPass::run().


Generated on Thu Jul 17 2025 18:08:36 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp