Lines Matching refs:DII
482 for (auto *DII : DbgUsers) { in replaceDbgUsesWithUndef() local
484 DII->setOperand(0, MetadataAsValue::get(DII->getContext(), in replaceDbgUsesWithUndef()
1259 static bool valueCoversEntireFragment(Type *ValTy, DbgVariableIntrinsic *DII) { in valueCoversEntireFragment() argument
1260 const DataLayout &DL = DII->getModule()->getDataLayout(); in valueCoversEntireFragment()
1262 if (auto FragmentSize = DII->getFragmentSizeInBits()) in valueCoversEntireFragment()
1267 if (DII->isAddressOfVariable()) in valueCoversEntireFragment()
1268 if (auto *AI = dyn_cast_or_null<AllocaInst>(DII->getVariableLocation())) in valueCoversEntireFragment()
1277 void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII, in ConvertDebugDeclareToDebugValue() argument
1279 assert(DII->isAddressOfVariable()); in ConvertDebugDeclareToDebugValue()
1280 auto *DIVar = DII->getVariable(); in ConvertDebugDeclareToDebugValue()
1282 auto *DIExpr = DII->getExpression(); in ConvertDebugDeclareToDebugValue()
1285 if (!valueCoversEntireFragment(SI->getValueOperand()->getType(), DII)) { in ConvertDebugDeclareToDebugValue()
1289 << *DII << '\n'); in ConvertDebugDeclareToDebugValue()
1295 Builder.insertDbgValueIntrinsic(DV, DIVar, DIExpr, DII->getDebugLoc(), in ConvertDebugDeclareToDebugValue()
1301 Builder.insertDbgValueIntrinsic(DV, DIVar, DIExpr, DII->getDebugLoc(), in ConvertDebugDeclareToDebugValue()
1307 void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII, in ConvertDebugDeclareToDebugValue() argument
1309 auto *DIVar = DII->getVariable(); in ConvertDebugDeclareToDebugValue()
1310 auto *DIExpr = DII->getExpression(); in ConvertDebugDeclareToDebugValue()
1316 if (!valueCoversEntireFragment(LI->getType(), DII)) { in ConvertDebugDeclareToDebugValue()
1321 << *DII << '\n'); in ConvertDebugDeclareToDebugValue()
1330 LI, DIVar, DIExpr, DII->getDebugLoc(), (Instruction *)nullptr); in ConvertDebugDeclareToDebugValue()
1336 void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII, in ConvertDebugDeclareToDebugValue() argument
1338 auto *DIVar = DII->getVariable(); in ConvertDebugDeclareToDebugValue()
1339 auto *DIExpr = DII->getExpression(); in ConvertDebugDeclareToDebugValue()
1345 if (!valueCoversEntireFragment(APN->getType(), DII)) { in ConvertDebugDeclareToDebugValue()
1350 << *DII << '\n'); in ConvertDebugDeclareToDebugValue()
1361 Builder.insertDbgValueIntrinsic(APN, DIVar, DIExpr, DII->getDebugLoc(), in ConvertDebugDeclareToDebugValue()
1487 if (auto *DII = dyn_cast<DbgVariableIntrinsic>(U)) in FindDbgAddrUses() local
1488 if (DII->isAddressOfVariable()) in FindDbgAddrUses()
1489 Declares.push_back(DII); in FindDbgAddrUses()
1516 if (DbgVariableIntrinsic *DII = dyn_cast<DbgVariableIntrinsic>(U)) in findDbgUsers() local
1517 DbgUsers.push_back(DII); in findDbgUsers()
1524 for (DbgVariableIntrinsic *DII : DbgAddrs) { in replaceDbgDeclare()
1525 DebugLoc Loc = DII->getDebugLoc(); in replaceDbgDeclare()
1526 auto *DIVar = DII->getVariable(); in replaceDbgDeclare()
1527 auto *DIExpr = DII->getExpression(); in replaceDbgDeclare()
1533 if (DII == InsertBefore) in replaceDbgDeclare()
1535 DII->eraseFromParent(); in replaceDbgDeclare()
1602 auto doSalvage = [&](DbgVariableIntrinsic *DII, SmallVectorImpl<uint64_t> &Ops) { in salvageDebugInfo() argument
1603 auto *DIExpr = DII->getExpression(); in salvageDebugInfo()
1608 bool WithStackValue = isa<DbgValueInst>(DII); in salvageDebugInfo()
1611 DII->setOperand(0, wrapMD(I.getOperand(0))); in salvageDebugInfo()
1612 DII->setOperand(2, MetadataAsValue::get(Ctx, DIExpr)); in salvageDebugInfo()
1613 LLVM_DEBUG(dbgs() << "SALVAGE: " << *DII << '\n'); in salvageDebugInfo()
1616 auto applyOffset = [&](DbgVariableIntrinsic *DII, uint64_t Offset) { in salvageDebugInfo() argument
1619 doSalvage(DII, Ops); in salvageDebugInfo()
1622 auto applyOps = [&](DbgVariableIntrinsic *DII, in salvageDebugInfo()
1625 doSalvage(DII, Ops); in salvageDebugInfo()
1634 for (auto *DII : DbgUsers) { in salvageDebugInfo() local
1635 DII->setOperand(0, CastSrc); in salvageDebugInfo()
1636 LLVM_DEBUG(dbgs() << "SALVAGE: " << *DII << '\n'); in salvageDebugInfo()
1647 for (auto *DII : DbgUsers) in salvageDebugInfo() local
1648 applyOffset(DII, Offset.getSExtValue()); in salvageDebugInfo()
1657 for (auto *DII : DbgUsers) { in salvageDebugInfo() local
1660 applyOffset(DII, Val); in salvageDebugInfo()
1663 applyOffset(DII, -int64_t(Val)); in salvageDebugInfo()
1666 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_mul}); in salvageDebugInfo()
1669 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_div}); in salvageDebugInfo()
1672 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_mod}); in salvageDebugInfo()
1675 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_or}); in salvageDebugInfo()
1678 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_and}); in salvageDebugInfo()
1681 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_xor}); in salvageDebugInfo()
1684 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_shl}); in salvageDebugInfo()
1687 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_shr}); in salvageDebugInfo()
1690 applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_shra}); in salvageDebugInfo()
1700 for (auto *DII : DbgUsers) { in salvageDebugInfo() local
1702 auto *DIExpr = DII->getExpression(); in salvageDebugInfo()
1704 DII->setOperand(0, AddrMD); in salvageDebugInfo()
1705 DII->setOperand(2, MetadataAsValue::get(Ctx, DIExpr)); in salvageDebugInfo()
1706 LLVM_DEBUG(dbgs() << "SALVAGE: " << *DII << '\n'); in salvageDebugInfo()
1721 function_ref<DbgValReplacement(DbgVariableIntrinsic &DII)> RewriteExpr) { in rewriteDebugUsers()
1734 for (auto *DII : Users) { in rewriteDebugUsers() local
1737 if (DomPointAfterFrom && DII->getNextNonDebugInstruction() == &DomPoint) { in rewriteDebugUsers()
1738 LLVM_DEBUG(dbgs() << "MOVE: " << *DII << '\n'); in rewriteDebugUsers()
1739 DII->moveAfter(&DomPoint); in rewriteDebugUsers()
1744 } else if (!DT.dominates(&DomPoint, DII)) { in rewriteDebugUsers()
1745 DeleteOrSalvage.insert(DII); in rewriteDebugUsers()
1751 for (auto *DII : Users) { in rewriteDebugUsers() local
1752 if (DeleteOrSalvage.count(DII)) in rewriteDebugUsers()
1755 LLVMContext &Ctx = DII->getContext(); in rewriteDebugUsers()
1756 DbgValReplacement DVR = RewriteExpr(*DII); in rewriteDebugUsers()
1760 DII->setOperand(0, wrapValueInMetadata(Ctx, &To)); in rewriteDebugUsers()
1761 DII->setOperand(2, MetadataAsValue::get(Ctx, *DVR)); in rewriteDebugUsers()
1762 LLVM_DEBUG(dbgs() << "REWRITE: " << *DII << '\n'); in rewriteDebugUsers()
1771 for (auto *DII : DeleteOrSalvage) { in rewriteDebugUsers() local
1772 if (DII->getVariableLocation() == &From) { in rewriteDebugUsers()
1773 LLVM_DEBUG(dbgs() << "Erased UseBeforeDef: " << *DII << '\n'); in rewriteDebugUsers()
1774 DII->eraseFromParent(); in rewriteDebugUsers()
1819 auto Identity = [&](DbgVariableIntrinsic &DII) -> DbgValReplacement { in replaceAllDbgUsesWith() argument
1820 return DII.getExpression(); in replaceAllDbgUsesWith()
1843 auto SignOrZeroExt = [&](DbgVariableIntrinsic &DII) -> DbgValReplacement { in replaceAllDbgUsesWith() argument
1844 DILocalVariable *Var = DII.getVariable(); in replaceAllDbgUsesWith()
1856 return Identity(DII); in replaceAllDbgUsesWith()
1865 return DIExpression::appendToStack(DII.getExpression(), Ops); in replaceAllDbgUsesWith()
2525 for (auto *DII : DbgUsers) in dropDebugUsers() local
2526 DII->eraseFromParent(); in dropDebugUsers()