Lines Matching defs:auto
72 const auto [Value, IsOffset] = Elem;
73 for (auto &U : Value->uses()) {
74 auto *I = cast<Instruction>(U.getUser());
76 if (auto *LI = dyn_cast<LoadInst>(I)) {
94 if (auto *GEP = dyn_cast<GetElementPtrInst>(I)) {
101 if (auto *Call = dyn_cast<CallBase>(I)) {
267 const auto *ASC = dyn_cast<AddrSpaceCastInst>(I);
290 for (auto *Inst : ValuesToRevisit)
297 for (auto *U : I.users()) {
298 auto *Inst = cast<Instruction>(&*U);
299 if (auto *Load = dyn_cast<LoadInst>(Inst)) {
303 } else if (auto *PHI = dyn_cast<PHINode>(Inst)) {
322 } else if (auto *SI = dyn_cast<SelectInst>(Inst)) {
339 } else if (auto *MI = dyn_cast<MemTransferInst>(Inst)) {
366 if (auto *LT = dyn_cast<LoadInst>(I)) {
367 auto *V = getReplacement(LT->getPointerOperand());
369 auto *NewI = new LoadInst(LT->getType(), V, "", LT->isVolatile(),
378 } else if (auto *PHI = dyn_cast<PHINode>(I)) {
380 auto *NewPHI = PHINode::Create(NewTy, PHI->getNumIncomingValues(),
386 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(I)) {
387 auto *V = getReplacement(GEP->getPointerOperand());
390 auto *NewI =
396 } else if (auto *SI = dyn_cast<SelectInst>(I)) {
403 auto *NewSI = SelectInst::Create(SI->getCondition(), TrueValue, FalseValue,
408 } else if (auto *MemCpy = dyn_cast<MemTransferInst>(I)) {
409 auto *DestV = MemCpy->getRawDest();
410 auto *SrcV = MemCpy->getRawSource();
412 if (auto *DestReplace = getReplacement(DestV))
414 if (auto *SrcReplace = getReplacement(SrcV))
418 auto *NewI = IC.Builder.CreateMemTransferInst(
427 } else if (auto *ASC = dyn_cast<AddrSpaceCastInst>(I)) {
428 auto *V = getReplacement(ASC->getPointerOperand());
436 auto *NewI = new AddrSpaceCastInst(V, ASC->getType(), "");
451 auto *PT = cast<PointerType>(Root.getType());
452 auto *NT = cast<PointerType>(V->getType());
462 if (auto *I = simplifyAllocaArraySize(*this, AI, DT))
590 for (const auto &MDPair : MD) {
669 if (auto *BC = dyn_cast<BitCastInst>(Load.user_back())) {
675 if (auto *CastUser = dyn_cast<CastInst>(Load.user_back())) {
705 if (auto *ST = dyn_cast<StructType>(T)) {
707 auto NumElements = ST->getNumElements();
719 auto *SL = DL.getStructLayout(ST);
728 const auto Align = LI.getAlign();
729 auto *Addr = LI.getPointerOperand();
730 auto *IdxType = Type::getInt32Ty(T->getContext());
731 auto *Zero = ConstantInt::get(IdxType, 0);
739 auto *Ptr = IC.Builder.CreateInBoundsGEP(ST, Addr, ArrayRef(Indices),
741 auto *L = IC.Builder.CreateAlignedLoad(
753 if (auto *AT = dyn_cast<ArrayType>(T)) {
754 auto *ET = AT->getElementType();
755 auto NumElements = AT->getNumElements();
772 const auto Align = LI.getAlign();
774 auto *Addr = LI.getPointerOperand();
775 auto *IdxType = Type::getInt64Ty(T->getContext());
776 auto *Zero = ConstantInt::get(IdxType, 0);
785 auto *Ptr = IC.Builder.CreateInBoundsGEP(AT, Addr, ArrayRef(Indices),
787 auto EltAlign = commonAlignment(Align, Offset.getKnownMinValue());
788 auto *L = IC.Builder.CreateAlignedLoad(AT->getElementType(), Ptr,
898 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) {
937 auto IsAllNonNegative = [&]() {
985 auto *Ptr = SI.getPointerOperand();
1120 while (auto *IV = dyn_cast<InsertValueInst>(V)) {
1121 auto *E = dyn_cast<ExtractElementInst>(IV->getInsertedValueOperand());
1124 auto *W = E->getVectorOperand();
1129 auto *CI = dyn_cast<ConstantInt>(E->getIndexOperand());
1137 auto *UT = cast<VectorType>(U->getType());
1138 auto *VT = V->getType();
1140 const auto &DL = IC.getDataLayout();
1144 if (auto *AT = dyn_cast<ArrayType>(VT)) {
1148 auto *ST = cast<StructType>(VT);
1151 for (const auto *EltT : ST->elements()) {
1192 if (auto *BC = dyn_cast<BitCastInst>(V)) {
1229 if (auto *ST = dyn_cast<StructType>(T)) {
1241 auto *SL = DL.getStructLayout(ST);
1250 const auto Align = SI.getAlign();
1254 auto *Addr = SI.getPointerOperand();
1258 auto *IdxType = Type::getInt32Ty(ST->getContext());
1259 auto *Zero = ConstantInt::get(IdxType, 0);
1265 auto *Ptr =
1267 auto *Val = IC.Builder.CreateExtractValue(V, i, EltName);
1268 auto EltAlign = commonAlignment(Align, SL->getElementOffset(i));
1276 if (auto *AT = dyn_cast<ArrayType>(T)) {
1278 auto NumElements = AT->getNumElements();
1294 const auto Align = SI.getAlign();
1298 auto *Addr = SI.getPointerOperand();
1302 auto *IdxType = Type::getInt64Ty(T->getContext());
1303 auto *Zero = ConstantInt::get(IdxType, 0);
1311 auto *Ptr =
1313 auto *Val = IC.Builder.CreateExtractValue(V, i, EltName);
1314 auto EltAlign = commonAlignment(Align, Offset.getKnownMinValue());
1515 auto OtherStoreIsMergeable = [&](StoreInst *OtherStore) -> bool {
1520 auto *SIVTy = SI.getValueOperand()->getType();
1521 auto *OSVTy = OtherStore->getValueOperand()->getType();