forked from OSchip/llvm-project
Further remove now invalid SCEVAffFunc features.
This also removes the construction of MayAliasSets that became invalid when removing the use of SCEVAffFunc. llvm-svn: 144230
This commit is contained in:
parent
6e9f25a5d5
commit
499f0a48d8
|
@ -36,9 +36,6 @@ class MayAliasSetInfo;
|
|||
///
|
||||
/// A helper class for collect affine function information
|
||||
class SCEVAffFunc {
|
||||
// Temporary hack
|
||||
friend class TempScopInfo;
|
||||
|
||||
public:
|
||||
// The scalar evolution expression from which we derived this affine
|
||||
// expression.
|
||||
|
@ -58,7 +55,6 @@ private:
|
|||
// The base address of the address SCEV, if the Value is a pointer, this is
|
||||
// an array access, otherwise, this is a value access.
|
||||
// And the Write/Read modifier
|
||||
Value *BaseAddr;
|
||||
unsigned ElemBytes : 28;
|
||||
SCEVAffFuncType FuncType : 3;
|
||||
|
||||
|
@ -67,8 +63,7 @@ public:
|
|||
/// condition type
|
||||
explicit SCEVAffFunc(SCEVAffFuncType Type, const SCEV *OriginalSCEV,
|
||||
unsigned elemBytes = 0)
|
||||
: OriginalSCEV(OriginalSCEV), BaseAddr(0),
|
||||
ElemBytes(elemBytes), FuncType(Type) {}
|
||||
: OriginalSCEV(OriginalSCEV), ElemBytes(elemBytes), FuncType(Type) {}
|
||||
|
||||
enum SCEVAffFuncType getType() const { return FuncType; }
|
||||
|
||||
|
@ -77,8 +72,6 @@ public:
|
|||
}
|
||||
|
||||
bool isRead() const { return FuncType == ReadMem; }
|
||||
|
||||
const Value *getBaseAddr() const { return BaseAddr; }
|
||||
};
|
||||
|
||||
class Comparison {
|
||||
|
|
|
@ -44,49 +44,4 @@ void MayAliasSet::dump() const {
|
|||
}
|
||||
|
||||
void MayAliasSetInfo::buildMayAliasSets(TempScop &Scop, AliasAnalysis &AA) {
|
||||
AliasSetTracker AST(AA);
|
||||
Region &MaxR = Scop.getMaxRegion();
|
||||
|
||||
// Find out all base pointers that appeared in Scop and build the Alias set.
|
||||
// Note: We may build the alias sets while we are building access functions
|
||||
// to obtain better performance.
|
||||
for (Region::block_iterator I = MaxR.block_begin(), E = MaxR.block_end();
|
||||
I != E; ++I) {
|
||||
BasicBlock *BB = I->getNodeAs<BasicBlock>();
|
||||
if (const AccFuncSetType *AFS = Scop.getAccessFunctions(BB)) {
|
||||
for (AccFuncSetType::const_iterator AI = AFS->begin(), AE = AFS->end();
|
||||
AI != AE; ++AI) {
|
||||
const SCEVAffFunc &AccFunc = AI->first;
|
||||
Instruction *Inst = AI->second;
|
||||
Value *BaseAddr = const_cast<Value*>(AccFunc.getBaseAddr());
|
||||
|
||||
AST.add(BaseAddr, AliasAnalysis::UnknownSize,
|
||||
Inst->getMetadata(LLVMContext::MD_tbaa));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build the may-alias set with the AliasSetTracker.
|
||||
for (AliasSetTracker::iterator I = AST.begin(), E = AST.end(); I != E; ++I) {
|
||||
AliasSet &AS = *I;
|
||||
|
||||
// Ignore the dummy alias set.
|
||||
if (AS.isForwardingAliasSet()) continue;
|
||||
|
||||
// The most simple case: All pointers in the set must-alias each others.
|
||||
if (AS.isMustAlias()) {
|
||||
MayAliasSet *MayAS = new (MayASAllocator.Allocate()) MayAliasSet();
|
||||
|
||||
for (AliasSet::iterator PI = AS.begin(), PE = AS.end(); PI != PE; ++PI) {
|
||||
Value *Ptr = PI.getPointer();
|
||||
|
||||
MayAS->addMustAliasPtr(Ptr);
|
||||
BasePtrMap.insert(std::make_pair(Ptr, MayAS));
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
assert(0 && "SCoPDetection pass should not allow May-Alias set!");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue