Changeset View
Changeset View
Standalone View
Standalone View
lib/Analysis/DependenceAnalysis.cpp
Show First 20 Lines • Show All 3,354 Lines • ▼ Show 20 Lines | DependenceAnalysis::depends(Instruction *Src, Instruction *Dst, | ||||
if (UsefulGEP) { | if (UsefulGEP) { | ||||
DEBUG(dbgs() << " using GEPs\n"); | DEBUG(dbgs() << " using GEPs\n"); | ||||
unsigned P = 0; | unsigned P = 0; | ||||
for (GEPOperator::const_op_iterator SrcIdx = SrcGEP->idx_begin(), | for (GEPOperator::const_op_iterator SrcIdx = SrcGEP->idx_begin(), | ||||
SrcEnd = SrcGEP->idx_end(), | SrcEnd = SrcGEP->idx_end(), | ||||
DstIdx = DstGEP->idx_begin(); | DstIdx = DstGEP->idx_begin(); | ||||
SrcIdx != SrcEnd; | SrcIdx != SrcEnd; | ||||
++SrcIdx, ++DstIdx, ++P) { | ++SrcIdx, ++DstIdx, ++P) { | ||||
// If not isSCEVable return dependency as not computable. | |||||
if (!SE->isSCEVable((*SrcIdx)->getType()) || | |||||
!SE->isSCEVable((*DstIdx)->getType())) { | |||||
return make_unique<Dependence>(Src, Dst); | |||||
} | |||||
Pair[P].Src = SE->getSCEV(*SrcIdx); | Pair[P].Src = SE->getSCEV(*SrcIdx); | ||||
Pair[P].Dst = SE->getSCEV(*DstIdx); | Pair[P].Dst = SE->getSCEV(*DstIdx); | ||||
unifySubscriptType(&Pair[P]); | unifySubscriptType(&Pair[P]); | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
DEBUG(dbgs() << " ignoring GEPs\n"); | DEBUG(dbgs() << " ignoring GEPs\n"); | ||||
const SCEV *SrcSCEV = SE->getSCEV(SrcPtr); | const SCEV *SrcSCEV = SE->getSCEV(SrcPtr); | ||||
▲ Show 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | const SCEV *DependenceAnalysis::getSplitIteration(const Dependence &Dep, | ||||
SmallVector<Subscript, 4> Pair(Pairs); | SmallVector<Subscript, 4> Pair(Pairs); | ||||
if (UsefulGEP) { | if (UsefulGEP) { | ||||
unsigned P = 0; | unsigned P = 0; | ||||
for (GEPOperator::const_op_iterator SrcIdx = SrcGEP->idx_begin(), | for (GEPOperator::const_op_iterator SrcIdx = SrcGEP->idx_begin(), | ||||
SrcEnd = SrcGEP->idx_end(), | SrcEnd = SrcGEP->idx_end(), | ||||
DstIdx = DstGEP->idx_begin(); | DstIdx = DstGEP->idx_begin(); | ||||
SrcIdx != SrcEnd; | SrcIdx != SrcEnd; | ||||
++SrcIdx, ++DstIdx, ++P) { | ++SrcIdx, ++DstIdx, ++P) { | ||||
if (!SE->isSCEVable((*SrcIdx)->getType()) || | |||||
!SE->isSCEVable((*DstIdx)->getType())) { | |||||
return nullptr; | |||||
} | |||||
Pair[P].Src = SE->getSCEV(*SrcIdx); | Pair[P].Src = SE->getSCEV(*SrcIdx); | ||||
Pair[P].Dst = SE->getSCEV(*DstIdx); | Pair[P].Dst = SE->getSCEV(*DstIdx); | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
const SCEV *SrcSCEV = SE->getSCEV(SrcPtr); | const SCEV *SrcSCEV = SE->getSCEV(SrcPtr); | ||||
const SCEV *DstSCEV = SE->getSCEV(DstPtr); | const SCEV *DstSCEV = SE->getSCEV(DstPtr); | ||||
Pair[0].Src = SrcSCEV; | Pair[0].Src = SrcSCEV; | ||||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |