Lines Matching defs:BDV
345 /// instruction 'I'. If Index is null, returns a BDV for the entire vector
350 /// vector returned is a BDV (and possibly a base) of the entire vector 'I'.
351 /// If the later, the return pointer is a BDV (or possibly a base) for the
386 // not. To be conservatively correct, we treat it as a BDV and will
395 // not. To be conservatively correct, we treat it as a BDV and will
407 auto *BDV =
409 Cache[GEP] = BDV;
410 return BDV;
416 auto *BDV = findBaseDefiningValue(Freeze->getOperand(0), Cache, KnownBases);
417 Cache[Freeze] = BDV;
418 return BDV;
424 auto *BDV = findBaseDefiningValue(BC->getOperand(0), Cache, KnownBases);
425 Cache[BC] = BDV;
426 return BDV;
439 // algorithm is responsible for constructing a base value for this BDV.
509 auto *BDV = findBaseDefiningValue(Def, Cache, KnownBases);
510 Cache[CI] = BDV;
511 return BDV;
523 auto *BDV =
525 Cache[GEP] = BDV;
526 return BDV;
530 auto *BDV = findBaseDefiningValue(Freeze->getOperand(0), Cache, KnownBases);
531 Cache[Freeze] = BDV;
532 return BDV;
554 auto *BDV = findBaseDefiningValue(II->getOperand(0), Cache, KnownBases);
555 Cache[II] = BDV;
556 return BDV;
628 auto *BDV = findBaseDefiningValue(I, Cache, KnownBases);
629 Cache[I] = BDV;
650 // Only a BDV available
691 /// the base of this BDV.
836 auto isExpectedBDVType = [](Value *BDV) {
837 return isa<PHINode>(BDV) || isa<SelectInst>(BDV) ||
838 isa<ExtractElementInst>(BDV) || isa<InsertElementInst>(BDV) ||
839 isa<ShuffleVectorInst>(BDV);
843 // Once populated, will contain a mapping from each potentially non-base BDV
844 // to a lattice value (described above) which corresponds to that BDV.
858 auto visitBDVOperands = [](Value *BDV, std::function<void (Value*)> F) {
859 if (PHINode *PN = dyn_cast<PHINode>(BDV)) {
862 } else if (SelectInst *SI = dyn_cast<SelectInst>(BDV)) {
865 } else if (auto *EE = dyn_cast<ExtractElementInst>(BDV)) {
867 } else if (auto *IE = dyn_cast<InsertElementInst>(BDV)) {
870 } else if (auto *SV = dyn_cast<ShuffleVectorInst>(BDV)) {
877 llvm_unreachable("unexpected BDV type");
898 // correct BDV for InVal, by creating an entry in the lattice
928 Value *BDV = Pair.first;
930 // If the input of the BDV is the BDV itself we can prune it. This is
931 // only possible if the BDV is a PHI node.
932 if (V->stripPointerCasts() == BDV)
943 visitBDVOperands(BDV, [&](Value *Op) {
947 ToRemove.push_back(BDV);
984 // on all constants having the same BDV and therefore constant-only insns
998 // select. Here the select's BDV is a vector (because of extract's BDV),
1001 // the end, this is due to the BDV algorithm being ignorant of BDV types at
1019 Value *BDV = Pair.first;
1023 assert((!isKnownBase(BDV, KnownBases) ||
1024 !areBothVectorOrScalar(BDV, Pair.second.getBaseValue())) &&
1027 BDVState NewState(BDV);
1028 visitBDVOperands(BDV, [&](Value *Op) {
1029 Value *BDV = findBaseOrBDV(Op, Cache, KnownBases);
1030 auto OpState = GetStateForBDV(BDV, Op);
1037 auto I = cast<Instruction>(BDV);
1045 States[BDV] = NewState;
1128 // instruction to propagate the base of it's BDV and have entered that newly
1133 Value *BDV = findBaseOrBDV(Input, Cache, KnownBases);
1135 if (!States.count(BDV)) {
1136 assert(areBothVectorOrScalar(BDV, Input));
1137 Base = BDV;
1140 assert(States.count(BDV));
1141 Base = States[BDV].getBaseValue();
1155 Instruction *BDV = cast<Instruction>(Pair.first);
1161 assert((!isKnownBase(BDV, KnownBases) ||
1162 !areBothVectorOrScalar(BDV, State.getBaseValue())) &&
1169 PHINode *PN = cast<PHINode>(BDV);
1209 SelectInst *SI = cast<SelectInst>(BDV);
1217 Value *InVal = cast<ExtractElementInst>(BDV)->getVectorOperand();
1222 auto *BdvIE = cast<InsertElementInst>(BDV);
1232 auto *BdvSV = cast<ShuffleVectorInst>(BDV);
1260 auto *BDV = Pair.first;
1262 assert(BDV && Base);
1265 assert(DL.getTypeAllocSize(BDV->getType()) ==
1272 (!isKnownBase(BDV, KnownBases) || !areBothVectorOrScalar(BDV, Base)) &&
1277 << " for: " << BDV->getName() << " from: "
1278 << (Cache.count(BDV) ? Cache[BDV]->getName().str() : "none")
1281 Cache[BDV] = Base;