Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Vectorize/VPlan.cpp
Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | if (EnableVPlanNativePath && (CBV = getCondBit())) { | ||||
ReplaceInstWithInst(CurrentTerminator, CondBr); | ReplaceInstWithInst(CurrentTerminator, CondBr); | ||||
} | } | ||||
LLVM_DEBUG(dbgs() << "LV: filled BB:" << *NewBB); | LLVM_DEBUG(dbgs() << "LV: filled BB:" << *NewBB); | ||||
} | } | ||||
void VPBasicBlock::dropAllReferences(VPValue *NewValue) { | void VPBasicBlock::dropAllReferences(VPValue *NewValue) { | ||||
for (VPRecipeBase &R : Recipes) { | for (VPRecipeBase &R : Recipes) { | ||||
if (auto *VPV = R.toVPValue()) | if (auto *InterleaveR = dyn_cast<VPInterleaveRecipe>(&R)) { | ||||
for (auto *Def : InterleaveR->Defs) | |||||
Def->replaceAllUsesWith(NewValue); | |||||
} else { | |||||
if (auto *VPV = R.toVPValue()) { | |||||
assert(VPV->isConcrete() && "virtual/sub-values need special handling"); | |||||
VPV->replaceAllUsesWith(NewValue); | VPV->replaceAllUsesWith(NewValue); | ||||
} | |||||
} | |||||
if (auto *User = R.toVPUser()) | if (auto *User = R.toVPUser()) | ||||
for (unsigned I = 0, E = User->getNumOperands(); I != E; I++) | for (unsigned I = 0, E = User->getNumOperands(); I != E; I++) | ||||
User->setOperand(I, NewValue); | User->setOperand(I, NewValue); | ||||
} | } | ||||
} | } | ||||
void VPRegionBlock::execute(VPTransformState *State) { | void VPRegionBlock::execute(VPTransformState *State) { | ||||
▲ Show 20 Lines • Show All 610 Lines • ▼ Show 20 Lines | void VPWidenCanonicalIVRecipe::print(raw_ostream &O, const Twine &Indent, | ||||
O << "\"EMIT "; | O << "\"EMIT "; | ||||
getVPValue()->printAsOperand(O, SlotTracker); | getVPValue()->printAsOperand(O, SlotTracker); | ||||
O << " = WIDEN-CANONICAL-INDUCTION"; | O << " = WIDEN-CANONICAL-INDUCTION"; | ||||
} | } | ||||
template void DomTreeBuilder::Calculate<VPDominatorTree>(VPDominatorTree &DT); | template void DomTreeBuilder::Calculate<VPDominatorTree>(VPDominatorTree &DT); | ||||
void VPValue::replaceAllUsesWith(VPValue *New) { | void VPValue::replaceAllUsesWith(VPValue *New) { | ||||
assert((isConcrete() || isSubValue()) && | |||||
dmgreen: Is this used at the moment? Should we be blindly replacing all the different uses with the same… | |||||
No it's not used (also not in follow-ups). I added an assert. fhahn: No it's not used (also not in follow-ups). I added an assert. | |||||
"can only replace concrete or sub-values"); | |||||
for (unsigned J = 0; J < getNumUsers();) { | for (unsigned J = 0; J < getNumUsers();) { | ||||
VPUser *User = Users[J]; | VPUser *User = Users[J]; | ||||
unsigned NumUsers = getNumUsers(); | unsigned NumUsers = getNumUsers(); | ||||
for (unsigned I = 0, E = User->getNumOperands(); I < E; ++I) | for (unsigned I = 0, E = User->getNumOperands(); I < E; ++I) | ||||
if (User->getOperand(I) == this) | if (User->getOperand(I) == this) | ||||
User->setOperand(I, New); | User->setOperand(I, New); | ||||
// If a user got removed after updating the current user, the next user to | // If a user got removed after updating the current user, the next user to | ||||
// update will be moved to the current position, so we only need to | // update will be moved to the current position, so we only need to | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
VPInterleavedAccessInfo::VPInterleavedAccessInfo(VPlan &Plan, | VPInterleavedAccessInfo::VPInterleavedAccessInfo(VPlan &Plan, | ||||
InterleavedAccessInfo &IAI) { | InterleavedAccessInfo &IAI) { | ||||
Old2NewTy Old2New; | Old2NewTy Old2New; | ||||
visitRegion(cast<VPRegionBlock>(Plan.getEntry()), Old2New, IAI); | visitRegion(cast<VPRegionBlock>(Plan.getEntry()), Old2New, IAI); | ||||
} | } | ||||
void VPSlotTracker::assignSlot(const VPValue *V) { | void VPSlotTracker::assignSlot(const VPValue *V) { | ||||
assert(Slots.find(V) == Slots.end() && "VPValue already has a slot!"); | assert(Slots.find(V) == Slots.end() && "VPValue already has a slot!"); | ||||
if (!V->isSubValue()) { | |||||
const Value *UV = V->getUnderlyingValue(); | const Value *UV = V->getUnderlyingValue(); | ||||
if (UV) | if (UV) | ||||
return; | return; | ||||
} | |||||
const auto *VPI = dyn_cast<VPInstruction>(V); | const auto *VPI = dyn_cast<VPInstruction>(V); | ||||
if (VPI && !VPI->hasResult()) | if (VPI && !VPI->hasResult()) | ||||
return; | return; | ||||
Slots[V] = NextSlot++; | Slots[V] = NextSlot++; | ||||
} | } | ||||
void VPSlotTracker::assignSlots(const VPBlockBase *VPBB) { | void VPSlotTracker::assignSlots(const VPBlockBase *VPBB) { | ||||
Show All 40 Lines |
Is this used at the moment? Should we be blindly replacing all the different uses with the same value?