mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Make some DataLayout pointers const.
No functionality change. Just reduces the noise of an upcoming patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202087 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
70b3b7d06f
commit
ec89b9fb9e
@ -122,7 +122,7 @@ class IVUsers : public LoopPass {
|
|||||||
LoopInfo *LI;
|
LoopInfo *LI;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
SmallPtrSet<Instruction*,16> Processed;
|
SmallPtrSet<Instruction*,16> Processed;
|
||||||
|
|
||||||
/// IVUses - A list of all tracked IV uses of induction variable expressions
|
/// IVUses - A list of all tracked IV uses of induction variable expressions
|
||||||
|
@ -26,7 +26,7 @@ namespace llvm {
|
|||||||
/// LazyValueInfo - This pass computes, caches, and vends lazy value constraint
|
/// LazyValueInfo - This pass computes, caches, and vends lazy value constraint
|
||||||
/// information.
|
/// information.
|
||||||
class LazyValueInfo : public FunctionPass {
|
class LazyValueInfo : public FunctionPass {
|
||||||
class DataLayout *DL;
|
const DataLayout *DL;
|
||||||
class TargetLibraryInfo *TLI;
|
class TargetLibraryInfo *TLI;
|
||||||
void *PImpl;
|
void *PImpl;
|
||||||
LazyValueInfo(const LazyValueInfo&) LLVM_DELETED_FUNCTION;
|
LazyValueInfo(const LazyValueInfo&) LLVM_DELETED_FUNCTION;
|
||||||
|
@ -323,7 +323,7 @@ namespace llvm {
|
|||||||
|
|
||||||
/// Current AA implementation, just a cache.
|
/// Current AA implementation, just a cache.
|
||||||
AliasAnalysis *AA;
|
AliasAnalysis *AA;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
OwningPtr<PredIteratorCache> PredCache;
|
OwningPtr<PredIteratorCache> PredCache;
|
||||||
public:
|
public:
|
||||||
|
@ -227,7 +227,7 @@ namespace llvm {
|
|||||||
|
|
||||||
/// The DataLayout information for the target we are targeting.
|
/// The DataLayout information for the target we are targeting.
|
||||||
///
|
///
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
|
|
||||||
/// TLI - The target library information for the target we are targeting.
|
/// TLI - The target library information for the target we are targeting.
|
||||||
///
|
///
|
||||||
|
@ -102,7 +102,7 @@ namespace {
|
|||||||
Module *Mod;
|
Module *Mod;
|
||||||
AliasAnalysis *AA;
|
AliasAnalysis *AA;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
TargetLibraryInfo *TLI;
|
TargetLibraryInfo *TLI;
|
||||||
|
|
||||||
std::string Messages;
|
std::string Messages;
|
||||||
@ -503,7 +503,7 @@ void Lint::visitShl(BinaryOperator &I) {
|
|||||||
"Undefined result: Shift count out of range", &I);
|
"Undefined result: Shift count out of range", &I);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isZero(Value *V, DataLayout *DL) {
|
static bool isZero(Value *V, const DataLayout *DL) {
|
||||||
// Assume undef could be zero.
|
// Assume undef could be zero.
|
||||||
if (isa<UndefValue>(V))
|
if (isa<UndefValue>(V))
|
||||||
return true;
|
return true;
|
||||||
|
@ -104,7 +104,7 @@ bool NVPTXLowerAggrCopies::runOnFunction(Function &F) {
|
|||||||
SmallVector<MemTransferInst *, 4> aggrMemcpys;
|
SmallVector<MemTransferInst *, 4> aggrMemcpys;
|
||||||
SmallVector<MemSetInst *, 4> aggrMemsets;
|
SmallVector<MemSetInst *, 4> aggrMemsets;
|
||||||
|
|
||||||
DataLayout *DL = &getAnalysis<DataLayout>();
|
const DataLayout *DL = &getAnalysis<DataLayout>();
|
||||||
LLVMContext &Context = F.getParent()->getContext();
|
LLVMContext &Context = F.getParent()->getContext();
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -109,7 +109,7 @@ namespace {
|
|||||||
PPCTargetMachine *TM;
|
PPCTargetMachine *TM;
|
||||||
LoopInfo *LI;
|
LoopInfo *LI;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
const TargetLibraryInfo *LibInfo;
|
const TargetLibraryInfo *LibInfo;
|
||||||
};
|
};
|
||||||
|
@ -84,7 +84,7 @@ namespace {
|
|||||||
const GlobalStatus &GS);
|
const GlobalStatus &GS);
|
||||||
bool OptimizeEmptyGlobalCXXDtors(Function *CXAAtExitFn);
|
bool OptimizeEmptyGlobalCXXDtors(Function *CXAAtExitFn);
|
||||||
|
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
TargetLibraryInfo *TLI;
|
TargetLibraryInfo *TLI;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -266,7 +266,8 @@ static bool CleanupPointerRootUsers(GlobalVariable *GV,
|
|||||||
/// quick scan over the use list to clean up the easy and obvious cruft. This
|
/// quick scan over the use list to clean up the easy and obvious cruft. This
|
||||||
/// returns true if it made a change.
|
/// returns true if it made a change.
|
||||||
static bool CleanupConstantGlobalUsers(Value *V, Constant *Init,
|
static bool CleanupConstantGlobalUsers(Value *V, Constant *Init,
|
||||||
DataLayout *DL, TargetLibraryInfo *TLI) {
|
const DataLayout *DL,
|
||||||
|
TargetLibraryInfo *TLI) {
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
// Note that we need to use a weak value handle for the worklist items. When
|
// Note that we need to use a weak value handle for the worklist items. When
|
||||||
// we delete a constant array, we may also be holding pointer to one of its
|
// we delete a constant array, we may also be holding pointer to one of its
|
||||||
@ -743,7 +744,7 @@ static bool OptimizeAwayTrappingUsesOfValue(Value *V, Constant *NewV) {
|
|||||||
/// if the loaded value is dynamically null, then we know that they cannot be
|
/// if the loaded value is dynamically null, then we know that they cannot be
|
||||||
/// reachable with a null optimize away the load.
|
/// reachable with a null optimize away the load.
|
||||||
static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV,
|
static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV,
|
||||||
DataLayout *DL,
|
const DataLayout *DL,
|
||||||
TargetLibraryInfo *TLI) {
|
TargetLibraryInfo *TLI) {
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
||||||
@ -806,8 +807,8 @@ static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV,
|
|||||||
|
|
||||||
/// ConstantPropUsersOf - Walk the use list of V, constant folding all of the
|
/// ConstantPropUsersOf - Walk the use list of V, constant folding all of the
|
||||||
/// instructions that are foldable.
|
/// instructions that are foldable.
|
||||||
static void ConstantPropUsersOf(Value *V,
|
static void ConstantPropUsersOf(Value *V, const DataLayout *DL,
|
||||||
DataLayout *DL, TargetLibraryInfo *TLI) {
|
TargetLibraryInfo *TLI) {
|
||||||
for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; )
|
for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; )
|
||||||
if (Instruction *I = dyn_cast<Instruction>(*UI++))
|
if (Instruction *I = dyn_cast<Instruction>(*UI++))
|
||||||
if (Constant *NewC = ConstantFoldInstruction(I, DL, TLI)) {
|
if (Constant *NewC = ConstantFoldInstruction(I, DL, TLI)) {
|
||||||
@ -830,7 +831,7 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV,
|
|||||||
CallInst *CI,
|
CallInst *CI,
|
||||||
Type *AllocTy,
|
Type *AllocTy,
|
||||||
ConstantInt *NElements,
|
ConstantInt *NElements,
|
||||||
DataLayout *DL,
|
const DataLayout *DL,
|
||||||
TargetLibraryInfo *TLI) {
|
TargetLibraryInfo *TLI) {
|
||||||
DEBUG(errs() << "PROMOTING GLOBAL: " << *GV << " CALL = " << *CI << '\n');
|
DEBUG(errs() << "PROMOTING GLOBAL: " << *GV << " CALL = " << *CI << '\n');
|
||||||
|
|
||||||
@ -1278,7 +1279,7 @@ static void RewriteUsesOfLoadForHeapSRoA(LoadInst *Load,
|
|||||||
/// PerformHeapAllocSRoA - CI is an allocation of an array of structures. Break
|
/// PerformHeapAllocSRoA - CI is an allocation of an array of structures. Break
|
||||||
/// it up into multiple allocations of arrays of the fields.
|
/// it up into multiple allocations of arrays of the fields.
|
||||||
static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, CallInst *CI,
|
static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, CallInst *CI,
|
||||||
Value *NElems, DataLayout *DL,
|
Value *NElems, const DataLayout *DL,
|
||||||
const TargetLibraryInfo *TLI) {
|
const TargetLibraryInfo *TLI) {
|
||||||
DEBUG(dbgs() << "SROA HEAP ALLOC: " << *GV << " MALLOC = " << *CI << '\n');
|
DEBUG(dbgs() << "SROA HEAP ALLOC: " << *GV << " MALLOC = " << *CI << '\n');
|
||||||
Type *MAT = getMallocAllocatedType(CI, TLI);
|
Type *MAT = getMallocAllocatedType(CI, TLI);
|
||||||
@ -1470,7 +1471,7 @@ static bool TryToOptimizeStoreOfMallocToGlobal(GlobalVariable *GV,
|
|||||||
Type *AllocTy,
|
Type *AllocTy,
|
||||||
AtomicOrdering Ordering,
|
AtomicOrdering Ordering,
|
||||||
Module::global_iterator &GVI,
|
Module::global_iterator &GVI,
|
||||||
DataLayout *DL,
|
const DataLayout *DL,
|
||||||
TargetLibraryInfo *TLI) {
|
TargetLibraryInfo *TLI) {
|
||||||
if (!DL)
|
if (!DL)
|
||||||
return false;
|
return false;
|
||||||
@ -1569,7 +1570,8 @@ static bool TryToOptimizeStoreOfMallocToGlobal(GlobalVariable *GV,
|
|||||||
static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
|
static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
|
||||||
AtomicOrdering Ordering,
|
AtomicOrdering Ordering,
|
||||||
Module::global_iterator &GVI,
|
Module::global_iterator &GVI,
|
||||||
DataLayout *DL, TargetLibraryInfo *TLI) {
|
const DataLayout *DL,
|
||||||
|
TargetLibraryInfo *TLI) {
|
||||||
// Ignore no-op GEPs and bitcasts.
|
// Ignore no-op GEPs and bitcasts.
|
||||||
StoredOnceVal = StoredOnceVal->stripPointerCasts();
|
StoredOnceVal = StoredOnceVal->stripPointerCasts();
|
||||||
|
|
||||||
|
@ -108,12 +108,12 @@ public:
|
|||||||
static const ComparableFunction TombstoneKey;
|
static const ComparableFunction TombstoneKey;
|
||||||
static DataLayout * const LookupOnly;
|
static DataLayout * const LookupOnly;
|
||||||
|
|
||||||
ComparableFunction(Function *Func, DataLayout *DL)
|
ComparableFunction(Function *Func, const DataLayout *DL)
|
||||||
: Func(Func), Hash(profileFunction(Func)), DL(DL) {}
|
: Func(Func), Hash(profileFunction(Func)), DL(DL) {}
|
||||||
|
|
||||||
Function *getFunc() const { return Func; }
|
Function *getFunc() const { return Func; }
|
||||||
unsigned getHash() const { return Hash; }
|
unsigned getHash() const { return Hash; }
|
||||||
DataLayout *getDataLayout() const { return DL; }
|
const DataLayout *getDataLayout() const { return DL; }
|
||||||
|
|
||||||
// Drops AssertingVH reference to the function. Outside of debug mode, this
|
// Drops AssertingVH reference to the function. Outside of debug mode, this
|
||||||
// does nothing.
|
// does nothing.
|
||||||
@ -129,7 +129,7 @@ private:
|
|||||||
|
|
||||||
AssertingVH<Function> Func;
|
AssertingVH<Function> Func;
|
||||||
unsigned Hash;
|
unsigned Hash;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ComparableFunction ComparableFunction::EmptyKey = ComparableFunction(0);
|
const ComparableFunction ComparableFunction::EmptyKey = ComparableFunction(0);
|
||||||
|
@ -81,7 +81,7 @@ public:
|
|||||||
class LLVM_LIBRARY_VISIBILITY InstCombiner
|
class LLVM_LIBRARY_VISIBILITY InstCombiner
|
||||||
: public FunctionPass,
|
: public FunctionPass,
|
||||||
public InstVisitor<InstCombiner, Instruction*> {
|
public InstVisitor<InstCombiner, Instruction*> {
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
TargetLibraryInfo *TLI;
|
TargetLibraryInfo *TLI;
|
||||||
bool MadeIRChange;
|
bool MadeIRChange;
|
||||||
LibCallSimplifier *Simplifier;
|
LibCallSimplifier *Simplifier;
|
||||||
@ -108,7 +108,7 @@ public:
|
|||||||
|
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||||
|
|
||||||
DataLayout *getDataLayout() const { return DL; }
|
const DataLayout *getDataLayout() const { return DL; }
|
||||||
|
|
||||||
TargetLibraryInfo *getTargetLibraryInfo() const { return TLI; }
|
TargetLibraryInfo *getTargetLibraryInfo() const { return TLI; }
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ isEliminableCastPair(
|
|||||||
const CastInst *CI, ///< The first cast instruction
|
const CastInst *CI, ///< The first cast instruction
|
||||||
unsigned opcode, ///< The opcode of the second cast instruction
|
unsigned opcode, ///< The opcode of the second cast instruction
|
||||||
Type *DstTy, ///< The target type for the second cast instruction
|
Type *DstTy, ///< The target type for the second cast instruction
|
||||||
DataLayout *DL ///< The target data for pointer size
|
const DataLayout *DL ///< The target data for pointer size
|
||||||
) {
|
) {
|
||||||
|
|
||||||
Type *SrcTy = CI->getOperand(0)->getType(); // A from above
|
Type *SrcTy = CI->getOperand(0)->getType(); // A from above
|
||||||
|
@ -503,7 +503,7 @@ FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, GlobalVariable *GV,
|
|||||||
/// If we can't emit an optimized form for this expression, this returns null.
|
/// If we can't emit an optimized form for this expression, this returns null.
|
||||||
///
|
///
|
||||||
static Value *EvaluateGEPOffsetExpression(User *GEP, InstCombiner &IC) {
|
static Value *EvaluateGEPOffsetExpression(User *GEP, InstCombiner &IC) {
|
||||||
DataLayout &DL = *IC.getDataLayout();
|
const DataLayout &DL = *IC.getDataLayout();
|
||||||
gep_type_iterator GTI = gep_type_begin(GEP);
|
gep_type_iterator GTI = gep_type_begin(GEP);
|
||||||
|
|
||||||
// Check to see if this gep only has a single variable index. If so, and if
|
// Check to see if this gep only has a single variable index. If so, and if
|
||||||
|
@ -334,7 +334,7 @@ struct AddressSanitizer : public FunctionPass {
|
|||||||
SmallString<64> BlacklistFile;
|
SmallString<64> BlacklistFile;
|
||||||
|
|
||||||
LLVMContext *C;
|
LLVMContext *C;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
int LongSize;
|
int LongSize;
|
||||||
Type *IntptrTy;
|
Type *IntptrTy;
|
||||||
ShadowMapping Mapping;
|
ShadowMapping Mapping;
|
||||||
@ -383,7 +383,7 @@ class AddressSanitizerModule : public ModulePass {
|
|||||||
SetOfDynamicallyInitializedGlobals DynamicallyInitializedGlobals;
|
SetOfDynamicallyInitializedGlobals DynamicallyInitializedGlobals;
|
||||||
Type *IntptrTy;
|
Type *IntptrTy;
|
||||||
LLVMContext *C;
|
LLVMContext *C;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
ShadowMapping Mapping;
|
ShadowMapping Mapping;
|
||||||
Function *AsanPoisonGlobals;
|
Function *AsanPoisonGlobals;
|
||||||
Function *AsanUnpoisonGlobals;
|
Function *AsanUnpoisonGlobals;
|
||||||
|
@ -164,7 +164,7 @@ class DataFlowSanitizer : public ModulePass {
|
|||||||
WK_Custom
|
WK_Custom
|
||||||
};
|
};
|
||||||
|
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
Module *Mod;
|
Module *Mod;
|
||||||
LLVMContext *Ctx;
|
LLVMContext *Ctx;
|
||||||
IntegerType *ShadowTy;
|
IntegerType *ShadowTy;
|
||||||
|
@ -222,7 +222,7 @@ class MemorySanitizer : public FunctionPass {
|
|||||||
/// \brief Track origins (allocation points) of uninitialized values.
|
/// \brief Track origins (allocation points) of uninitialized values.
|
||||||
bool TrackOrigins;
|
bool TrackOrigins;
|
||||||
|
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
LLVMContext *C;
|
LLVMContext *C;
|
||||||
Type *IntptrTy;
|
Type *IntptrTy;
|
||||||
Type *OriginTy;
|
Type *OriginTy;
|
||||||
|
@ -96,7 +96,7 @@ struct ThreadSanitizer : public FunctionPass {
|
|||||||
bool addrPointsToConstantData(Value *Addr);
|
bool addrPointsToConstantData(Value *Addr);
|
||||||
int getMemoryAccessFuncIndex(Value *Addr);
|
int getMemoryAccessFuncIndex(Value *Addr);
|
||||||
|
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
Type *IntptrTy;
|
Type *IntptrTy;
|
||||||
SmallString<64> BlacklistFile;
|
SmallString<64> BlacklistFile;
|
||||||
OwningPtr<SpecialCaseList> BL;
|
OwningPtr<SpecialCaseList> BL;
|
||||||
|
@ -67,7 +67,7 @@ bool ConstantPropagation::runOnFunction(Function &F) {
|
|||||||
WorkList.insert(&*i);
|
WorkList.insert(&*i);
|
||||||
}
|
}
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
DataLayout *DL = getAnalysisIfAvailable<DataLayout>();
|
const DataLayout *DL = getAnalysisIfAvailable<DataLayout>();
|
||||||
TargetLibraryInfo *TLI = &getAnalysis<TargetLibraryInfo>();
|
TargetLibraryInfo *TLI = &getAnalysis<TargetLibraryInfo>();
|
||||||
|
|
||||||
while (!WorkList.empty()) {
|
while (!WorkList.empty()) {
|
||||||
|
@ -71,7 +71,7 @@ namespace {
|
|||||||
LoopInfo *LI;
|
LoopInfo *LI;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
TargetLibraryInfo *TLI;
|
TargetLibraryInfo *TLI;
|
||||||
|
|
||||||
SmallVector<WeakVH, 16> DeadInsts;
|
SmallVector<WeakVH, 16> DeadInsts;
|
||||||
|
@ -76,7 +76,7 @@ namespace {
|
|||||||
/// revectored to the false side of the second if.
|
/// revectored to the false side of the second if.
|
||||||
///
|
///
|
||||||
class JumpThreading : public FunctionPass {
|
class JumpThreading : public FunctionPass {
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
TargetLibraryInfo *TLI;
|
TargetLibraryInfo *TLI;
|
||||||
LazyValueInfo *LVI;
|
LazyValueInfo *LVI;
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
|
@ -108,7 +108,7 @@ namespace {
|
|||||||
LoopInfo *LI; // Current LoopInfo
|
LoopInfo *LI; // Current LoopInfo
|
||||||
DominatorTree *DT; // Dominator Tree for the current Loop.
|
DominatorTree *DT; // Dominator Tree for the current Loop.
|
||||||
|
|
||||||
DataLayout *DL; // DataLayout for constant folding.
|
const DataLayout *DL; // DataLayout for constant folding.
|
||||||
TargetLibraryInfo *TLI; // TargetLibraryInfo for constant folding.
|
TargetLibraryInfo *TLI; // TargetLibraryInfo for constant folding.
|
||||||
|
|
||||||
// State that is updated as we process loops.
|
// State that is updated as we process loops.
|
||||||
|
@ -141,7 +141,7 @@ protected:
|
|||||||
AliasAnalysis *AA;
|
AliasAnalysis *AA;
|
||||||
LoopInfo *LI;
|
LoopInfo *LI;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
TargetLibraryInfo *TLI;
|
TargetLibraryInfo *TLI;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ namespace {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool HasDomTree;
|
bool HasDomTree;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
|
|
||||||
/// DeadInsts - Keep track of instructions we have made dead, so that
|
/// DeadInsts - Keep track of instructions we have made dead, so that
|
||||||
/// we can remove them after we are done working.
|
/// we can remove them after we are done working.
|
||||||
|
@ -214,7 +214,7 @@ namespace {
|
|||||||
AliasAnalysis *AA;
|
AliasAnalysis *AA;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
const TargetTransformInfo *TTI;
|
const TargetTransformInfo *TTI;
|
||||||
|
|
||||||
// FIXME: const correct?
|
// FIXME: const correct?
|
||||||
|
@ -219,7 +219,7 @@ class LoopVectorizationCostModel;
|
|||||||
class InnerLoopVectorizer {
|
class InnerLoopVectorizer {
|
||||||
public:
|
public:
|
||||||
InnerLoopVectorizer(Loop *OrigLoop, ScalarEvolution *SE, LoopInfo *LI,
|
InnerLoopVectorizer(Loop *OrigLoop, ScalarEvolution *SE, LoopInfo *LI,
|
||||||
DominatorTree *DT, DataLayout *DL,
|
DominatorTree *DT, const DataLayout *DL,
|
||||||
const TargetLibraryInfo *TLI, unsigned VecWidth,
|
const TargetLibraryInfo *TLI, unsigned VecWidth,
|
||||||
unsigned UnrollFactor)
|
unsigned UnrollFactor)
|
||||||
: OrigLoop(OrigLoop), SE(SE), LI(LI), DT(DT), DL(DL), TLI(TLI),
|
: OrigLoop(OrigLoop), SE(SE), LI(LI), DT(DT), DL(DL), TLI(TLI),
|
||||||
@ -379,7 +379,7 @@ protected:
|
|||||||
/// Dominator Tree.
|
/// Dominator Tree.
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
/// Data Layout.
|
/// Data Layout.
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
/// Target Library Info.
|
/// Target Library Info.
|
||||||
const TargetLibraryInfo *TLI;
|
const TargetLibraryInfo *TLI;
|
||||||
|
|
||||||
@ -428,7 +428,7 @@ protected:
|
|||||||
class InnerLoopUnroller : public InnerLoopVectorizer {
|
class InnerLoopUnroller : public InnerLoopVectorizer {
|
||||||
public:
|
public:
|
||||||
InnerLoopUnroller(Loop *OrigLoop, ScalarEvolution *SE, LoopInfo *LI,
|
InnerLoopUnroller(Loop *OrigLoop, ScalarEvolution *SE, LoopInfo *LI,
|
||||||
DominatorTree *DT, DataLayout *DL,
|
DominatorTree *DT, const DataLayout *DL,
|
||||||
const TargetLibraryInfo *TLI, unsigned UnrollFactor) :
|
const TargetLibraryInfo *TLI, unsigned UnrollFactor) :
|
||||||
InnerLoopVectorizer(OrigLoop, SE, LI, DT, DL, TLI, 1, UnrollFactor) { }
|
InnerLoopVectorizer(OrigLoop, SE, LI, DT, DL, TLI, 1, UnrollFactor) { }
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ public:
|
|||||||
unsigned NumStores;
|
unsigned NumStores;
|
||||||
unsigned NumPredStores;
|
unsigned NumPredStores;
|
||||||
|
|
||||||
LoopVectorizationLegality(Loop *L, ScalarEvolution *SE, DataLayout *DL,
|
LoopVectorizationLegality(Loop *L, ScalarEvolution *SE, const DataLayout *DL,
|
||||||
DominatorTree *DT, TargetLibraryInfo *TLI)
|
DominatorTree *DT, TargetLibraryInfo *TLI)
|
||||||
: NumLoads(0), NumStores(0), NumPredStores(0), TheLoop(L), SE(SE), DL(DL),
|
: NumLoads(0), NumStores(0), NumPredStores(0), TheLoop(L), SE(SE), DL(DL),
|
||||||
DT(DT), TLI(TLI), Induction(0), WidestIndTy(0), HasFunNoNaNAttr(false),
|
DT(DT), TLI(TLI), Induction(0), WidestIndTy(0), HasFunNoNaNAttr(false),
|
||||||
@ -725,7 +725,7 @@ private:
|
|||||||
/// Scev analysis.
|
/// Scev analysis.
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
/// DataLayout analysis.
|
/// DataLayout analysis.
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
/// Dominators.
|
/// Dominators.
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
/// Target Library Info.
|
/// Target Library Info.
|
||||||
@ -775,7 +775,7 @@ public:
|
|||||||
LoopVectorizationCostModel(Loop *L, ScalarEvolution *SE, LoopInfo *LI,
|
LoopVectorizationCostModel(Loop *L, ScalarEvolution *SE, LoopInfo *LI,
|
||||||
LoopVectorizationLegality *Legal,
|
LoopVectorizationLegality *Legal,
|
||||||
const TargetTransformInfo &TTI,
|
const TargetTransformInfo &TTI,
|
||||||
DataLayout *DL, const TargetLibraryInfo *TLI)
|
const DataLayout *DL, const TargetLibraryInfo *TLI)
|
||||||
: TheLoop(L), SE(SE), LI(LI), Legal(Legal), TTI(TTI), DL(DL), TLI(TLI) {}
|
: TheLoop(L), SE(SE), LI(LI), Legal(Legal), TTI(TTI), DL(DL), TLI(TLI) {}
|
||||||
|
|
||||||
/// Information about vectorization costs
|
/// Information about vectorization costs
|
||||||
@ -848,7 +848,7 @@ private:
|
|||||||
/// Vector target information.
|
/// Vector target information.
|
||||||
const TargetTransformInfo &TTI;
|
const TargetTransformInfo &TTI;
|
||||||
/// Target data layout information.
|
/// Target data layout information.
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
/// Target Library Info.
|
/// Target Library Info.
|
||||||
const TargetLibraryInfo *TLI;
|
const TargetLibraryInfo *TLI;
|
||||||
};
|
};
|
||||||
@ -1009,7 +1009,7 @@ struct LoopVectorize : public FunctionPass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
LoopInfo *LI;
|
LoopInfo *LI;
|
||||||
TargetTransformInfo *TTI;
|
TargetTransformInfo *TTI;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
@ -1283,7 +1283,7 @@ Value *InnerLoopVectorizer::getConsecutiveVector(Value* Val, int StartIdx,
|
|||||||
/// \brief Find the operand of the GEP that should be checked for consecutive
|
/// \brief Find the operand of the GEP that should be checked for consecutive
|
||||||
/// stores. This ignores trailing indices that have no effect on the final
|
/// stores. This ignores trailing indices that have no effect on the final
|
||||||
/// pointer.
|
/// pointer.
|
||||||
static unsigned getGEPInductionOperand(DataLayout *DL,
|
static unsigned getGEPInductionOperand(const DataLayout *DL,
|
||||||
const GetElementPtrInst *Gep) {
|
const GetElementPtrInst *Gep) {
|
||||||
unsigned LastOperand = Gep->getNumOperands() - 1;
|
unsigned LastOperand = Gep->getNumOperands() - 1;
|
||||||
unsigned GEPAllocSize = DL->getTypeAllocSize(
|
unsigned GEPAllocSize = DL->getTypeAllocSize(
|
||||||
@ -3298,7 +3298,7 @@ bool LoopVectorizationLegality::canVectorize() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Type *convertPointerToIntegerType(DataLayout &DL, Type *Ty) {
|
static Type *convertPointerToIntegerType(const DataLayout &DL, Type *Ty) {
|
||||||
if (Ty->isPointerTy())
|
if (Ty->isPointerTy())
|
||||||
return DL.getIntPtrType(Ty);
|
return DL.getIntPtrType(Ty);
|
||||||
|
|
||||||
@ -3310,7 +3310,7 @@ static Type *convertPointerToIntegerType(DataLayout &DL, Type *Ty) {
|
|||||||
return Ty;
|
return Ty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Type* getWiderType(DataLayout &DL, Type *Ty0, Type *Ty1) {
|
static Type* getWiderType(const DataLayout &DL, Type *Ty0, Type *Ty1) {
|
||||||
Ty0 = convertPointerToIntegerType(DL, Ty0);
|
Ty0 = convertPointerToIntegerType(DL, Ty0);
|
||||||
Ty1 = convertPointerToIntegerType(DL, Ty1);
|
Ty1 = convertPointerToIntegerType(DL, Ty1);
|
||||||
if (Ty0->getScalarSizeInBits() > Ty1->getScalarSizeInBits())
|
if (Ty0->getScalarSizeInBits() > Ty1->getScalarSizeInBits())
|
||||||
@ -3508,7 +3508,7 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
|
|||||||
///\brief Remove GEPs whose indices but the last one are loop invariant and
|
///\brief Remove GEPs whose indices but the last one are loop invariant and
|
||||||
/// return the induction operand of the gep pointer.
|
/// return the induction operand of the gep pointer.
|
||||||
static Value *stripGetElementPtr(Value *Ptr, ScalarEvolution *SE,
|
static Value *stripGetElementPtr(Value *Ptr, ScalarEvolution *SE,
|
||||||
DataLayout *DL, Loop *Lp) {
|
const DataLayout *DL, Loop *Lp) {
|
||||||
GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr);
|
GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr);
|
||||||
if (!GEP)
|
if (!GEP)
|
||||||
return Ptr;
|
return Ptr;
|
||||||
@ -3544,7 +3544,7 @@ static Value *getUniqueCastUse(Value *Ptr, Loop *Lp, Type *Ty) {
|
|||||||
/// Looks for symbolic strides "a[i*stride]". Returns the symbolic stride as a
|
/// Looks for symbolic strides "a[i*stride]". Returns the symbolic stride as a
|
||||||
/// pointer to the Value, or null otherwise.
|
/// pointer to the Value, or null otherwise.
|
||||||
static Value *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE,
|
static Value *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE,
|
||||||
DataLayout *DL, Loop *Lp) {
|
const DataLayout *DL, Loop *Lp) {
|
||||||
const PointerType *PtrTy = dyn_cast<PointerType>(Ptr->getType());
|
const PointerType *PtrTy = dyn_cast<PointerType>(Ptr->getType());
|
||||||
if (!PtrTy || PtrTy->isAggregateType())
|
if (!PtrTy || PtrTy->isAggregateType())
|
||||||
return 0;
|
return 0;
|
||||||
@ -3679,7 +3679,7 @@ public:
|
|||||||
/// \brief Set of potential dependent memory accesses.
|
/// \brief Set of potential dependent memory accesses.
|
||||||
typedef EquivalenceClasses<MemAccessInfo> DepCandidates;
|
typedef EquivalenceClasses<MemAccessInfo> DepCandidates;
|
||||||
|
|
||||||
AccessAnalysis(DataLayout *Dl, DepCandidates &DA) :
|
AccessAnalysis(const DataLayout *Dl, DepCandidates &DA) :
|
||||||
DL(Dl), DepCands(DA), AreAllWritesIdentified(true),
|
DL(Dl), DepCands(DA), AreAllWritesIdentified(true),
|
||||||
AreAllReadsIdentified(true), IsRTCheckNeeded(false) {}
|
AreAllReadsIdentified(true), IsRTCheckNeeded(false) {}
|
||||||
|
|
||||||
@ -3745,7 +3745,7 @@ private:
|
|||||||
/// Set of underlying objects already written to.
|
/// Set of underlying objects already written to.
|
||||||
SmallPtrSet<Value*, 16> WriteObjects;
|
SmallPtrSet<Value*, 16> WriteObjects;
|
||||||
|
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
|
|
||||||
/// Sets of potentially dependent accesses - members of one set share an
|
/// Sets of potentially dependent accesses - members of one set share an
|
||||||
/// underlying pointer. The set "CheckDeps" identfies which sets really need a
|
/// underlying pointer. The set "CheckDeps" identfies which sets really need a
|
||||||
@ -3772,7 +3772,7 @@ static bool hasComputableBounds(ScalarEvolution *SE, ValueToValueMap &Strides,
|
|||||||
|
|
||||||
/// \brief Check the stride of the pointer and ensure that it does not wrap in
|
/// \brief Check the stride of the pointer and ensure that it does not wrap in
|
||||||
/// the address space.
|
/// the address space.
|
||||||
static int isStridedPtr(ScalarEvolution *SE, DataLayout *DL, Value *Ptr,
|
static int isStridedPtr(ScalarEvolution *SE, const DataLayout *DL, Value *Ptr,
|
||||||
const Loop *Lp, ValueToValueMap &StridesMap);
|
const Loop *Lp, ValueToValueMap &StridesMap);
|
||||||
|
|
||||||
bool AccessAnalysis::canCheckPtrAtRT(
|
bool AccessAnalysis::canCheckPtrAtRT(
|
||||||
@ -3992,7 +3992,7 @@ public:
|
|||||||
typedef PointerIntPair<Value *, 1, bool> MemAccessInfo;
|
typedef PointerIntPair<Value *, 1, bool> MemAccessInfo;
|
||||||
typedef SmallPtrSet<MemAccessInfo, 8> MemAccessInfoSet;
|
typedef SmallPtrSet<MemAccessInfo, 8> MemAccessInfoSet;
|
||||||
|
|
||||||
MemoryDepChecker(ScalarEvolution *Se, DataLayout *Dl, const Loop *L)
|
MemoryDepChecker(ScalarEvolution *Se, const DataLayout *Dl, const Loop *L)
|
||||||
: SE(Se), DL(Dl), InnermostLoop(L), AccessIdx(0),
|
: SE(Se), DL(Dl), InnermostLoop(L), AccessIdx(0),
|
||||||
ShouldRetryWithRuntimeCheck(false) {}
|
ShouldRetryWithRuntimeCheck(false) {}
|
||||||
|
|
||||||
@ -4030,7 +4030,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DataLayout *DL;
|
const DataLayout *DL;
|
||||||
const Loop *InnermostLoop;
|
const Loop *InnermostLoop;
|
||||||
|
|
||||||
/// \brief Maps access locations (ptr, read/write) to program order.
|
/// \brief Maps access locations (ptr, read/write) to program order.
|
||||||
@ -4079,7 +4079,7 @@ static bool isInBoundsGep(Value *Ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Check whether the access through \p Ptr has a constant stride.
|
/// \brief Check whether the access through \p Ptr has a constant stride.
|
||||||
static int isStridedPtr(ScalarEvolution *SE, DataLayout *DL, Value *Ptr,
|
static int isStridedPtr(ScalarEvolution *SE, const DataLayout *DL, Value *Ptr,
|
||||||
const Loop *Lp, ValueToValueMap &StridesMap) {
|
const Loop *Lp, ValueToValueMap &StridesMap) {
|
||||||
const Type *Ty = Ptr->getType();
|
const Type *Ty = Ptr->getType();
|
||||||
assert(Ty->isPointerTy() && "Unexpected non-ptr");
|
assert(Ty->isPointerTy() && "Unexpected non-ptr");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user