Changeset View
Changeset View
Standalone View
Standalone View
lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | return (Basis.Ins != C.Ins && // skip the same instruction | ||||
// Basis must dominate C in order to rewrite C with respect to Basis. | // Basis must dominate C in order to rewrite C with respect to Basis. | ||||
DT->dominates(Basis.Ins->getParent(), C.Ins->getParent()) && | DT->dominates(Basis.Ins->getParent(), C.Ins->getParent()) && | ||||
// They share the same base, stride, and candidate kind. | // They share the same base, stride, and candidate kind. | ||||
Basis.Base == C.Base && | Basis.Base == C.Base && | ||||
Basis.Stride == C.Stride && | Basis.Stride == C.Stride && | ||||
Basis.CandidateKind == C.CandidateKind); | Basis.CandidateKind == C.CandidateKind); | ||||
} | } | ||||
// TODO: use TTI->getGEPCost. | |||||
static bool isGEPFoldable(GetElementPtrInst *GEP, | static bool isGEPFoldable(GetElementPtrInst *GEP, | ||||
const TargetTransformInfo *TTI, | const TargetTransformInfo *TTI, | ||||
const DataLayout *DL) { | const DataLayout *DL) { | ||||
GlobalVariable *BaseGV = nullptr; | GlobalVariable *BaseGV = nullptr; | ||||
int64_t BaseOffset = 0; | int64_t BaseOffset = 0; | ||||
bool HasBaseReg = false; | bool HasBaseReg = false; | ||||
int64_t Scale = 0; | int64_t Scale = 0; | ||||
▲ Show 20 Lines • Show All 468 Lines • Show Last 20 Lines |