Lines Matching defs:BDV

344 /// instruction 'I'.  If Index is null, returns a BDV for the entire vector
349 /// vector returned is a BDV (and possibly a base) of the entire vector 'I'.
350 /// If the later, the return pointer is a BDV (or possibly a base) for the
385 // not. To be conservatively correct, we treat it as a BDV and will
394 // not. To be conservatively correct, we treat it as a BDV and will
406 auto *BDV =
408 Cache[GEP] = BDV;
409 return BDV;
415 auto *BDV = findBaseDefiningValue(Freeze->getOperand(0), Cache, KnownBases);
416 Cache[Freeze] = BDV;
417 return BDV;
423 auto *BDV = findBaseDefiningValue(BC->getOperand(0), Cache, KnownBases);
424 Cache[BC] = BDV;
425 return BDV;
438 // algorithm is responsible for constructing a base value for this BDV.
508 auto *BDV = findBaseDefiningValue(Def, Cache, KnownBases);
509 Cache[CI] = BDV;
510 return BDV;
522 auto *BDV =
524 Cache[GEP] = BDV;
525 return BDV;
529 auto *BDV = findBaseDefiningValue(Freeze->getOperand(0), Cache, KnownBases);
530 Cache[Freeze] = BDV;
531 return BDV;
553 auto *BDV = findBaseDefiningValue(II->getOperand(0), Cache, KnownBases);
554 Cache[II] = BDV;
555 return BDV;
634 auto *BDV = findBaseDefiningValue(I, Cache, KnownBases);
635 Cache[I] = BDV;
656 // Only a BDV available
697 /// the base of this BDV.
842 auto isExpectedBDVType = [](Value *BDV) {
843 return isa<PHINode>(BDV) || isa<SelectInst>(BDV) ||
844 isa<ExtractElementInst>(BDV) || isa<InsertElementInst>(BDV) ||
845 isa<ShuffleVectorInst>(BDV);
849 // Once populated, will contain a mapping from each potentially non-base BDV
850 // to a lattice value (described above) which corresponds to that BDV.
864 auto visitBDVOperands = [](Value *BDV, std::function<void (Value*)> F) {
865 if (PHINode *PN = dyn_cast<PHINode>(BDV)) {
868 } else if (SelectInst *SI = dyn_cast<SelectInst>(BDV)) {
871 } else if (auto *EE = dyn_cast<ExtractElementInst>(BDV)) {
873 } else if (auto *IE = dyn_cast<InsertElementInst>(BDV)) {
876 } else if (auto *SV = dyn_cast<ShuffleVectorInst>(BDV)) {
883 llvm_unreachable("unexpected BDV type");
904 // correct BDV for InVal, by creating an entry in the lattice
934 Value *BDV = Pair.first;
936 // If the input of the BDV is the BDV itself we can prune it. This is
937 // only possible if the BDV is a PHI node.
938 if (V->stripPointerCasts() == BDV)
949 visitBDVOperands(BDV, [&](Value *Op) {
953 ToRemove.push_back(BDV);
990 // on all constants having the same BDV and therefore constant-only insns
1004 // select. Here the select's BDV is a vector (because of extract's BDV),
1007 // the end, this is due to the BDV algorithm being ignorant of BDV types at
1025 Value *BDV = Pair.first;
1029 assert((!isKnownBase(BDV, KnownBases) ||
1030 !areBothVectorOrScalar(BDV, Pair.second.getBaseValue())) &&
1033 BDVState NewState(BDV);
1034 visitBDVOperands(BDV, [&](Value *Op) {
1035 Value *BDV = findBaseOrBDV(Op, Cache, KnownBases);
1036 auto OpState = GetStateForBDV(BDV, Op);
1043 auto I = cast<Instruction>(BDV);
1051 States[BDV] = NewState;
1134 // instruction to propagate the base of it's BDV and have entered that newly
1139 Value *BDV = findBaseOrBDV(Input, Cache, KnownBases);
1141 if (!States.count(BDV)) {
1142 assert(areBothVectorOrScalar(BDV, Input));
1143 Base = BDV;
1146 assert(States.count(BDV));
1147 Base = States[BDV].getBaseValue();
1161 Instruction *BDV = cast<Instruction>(Pair.first);
1167 assert((!isKnownBase(BDV, KnownBases) ||
1168 !areBothVectorOrScalar(BDV, State.getBaseValue())) &&
1175 PHINode *PN = cast<PHINode>(BDV);
1215 SelectInst *SI = cast<SelectInst>(BDV);
1223 Value *InVal = cast<ExtractElementInst>(BDV)->getVectorOperand();
1228 auto *BdvIE = cast<InsertElementInst>(BDV);
1238 auto *BdvSV = cast<ShuffleVectorInst>(BDV);
1266 auto *BDV = Pair.first;
1268 assert(BDV && Base);
1271 assert(DL.getTypeAllocSize(BDV->getType()) ==
1278 (!isKnownBase(BDV, KnownBases) || !areBothVectorOrScalar(BDV, Base)) &&
1283 << " for: " << BDV->getName() << " from: "
1284 << (Cache.count(BDV) ? Cache[BDV]->getName().str() : "none")
1287 Cache[BDV] = Base;