@@ -148,11 +148,6 @@ static cl::opt<LinkageNameOption>
148
148
" Abstract subprograms" )),
149
149
cl::init(DefaultLinkageNames));
150
150
151
- static cl::opt<unsigned > LocationAnalysisSizeLimit (
152
- " singlevarlocation-input-bb-limit" ,
153
- cl::desc (" Maximum block size to analyze for single-location variables" ),
154
- cl::init(30000 ), cl::Hidden);
155
-
156
151
static const char *const DWARFGroupName = " dwarf" ;
157
152
static const char *const DWARFGroupDescription = " DWARF Emission" ;
158
153
static const char *const DbgTimerName = " writer" ;
@@ -1611,10 +1606,8 @@ static bool validThroughout(LexicalScopes &LScopes,
1611
1606
// [1-3) [(reg0, fragment 0, 32), (reg1, fragment 32, 32)]
1612
1607
// [3-4) [(reg1, fragment 32, 32), (123, fragment 64, 32)]
1613
1608
// [4-) [(@g, fragment 0, 96)]
1614
- bool DwarfDebug::buildLocationList (
1615
- SmallVectorImpl<DebugLocEntry> &DebugLoc,
1616
- const DbgValueHistoryMap::Entries &Entries,
1617
- DenseSet<const MachineBasicBlock *> &VeryLargeBlocks) {
1609
+ bool DwarfDebug::buildLocationList (SmallVectorImpl<DebugLocEntry> &DebugLoc,
1610
+ const DbgValueHistoryMap::Entries &Entries) {
1618
1611
using OpenRange =
1619
1612
std::pair<DbgValueHistoryMap::EntryIndex, DbgValueLoc>;
1620
1613
SmallVector<OpenRange, 4 > OpenRanges;
@@ -1710,14 +1703,8 @@ bool DwarfDebug::buildLocationList(
1710
1703
DebugLoc.pop_back ();
1711
1704
}
1712
1705
1713
- // If there's a single entry, safe for a single location, and not part of
1714
- // an over-sized basic block, then ask validThroughout whether this
1715
- // location can be represented as a single variable location.
1716
- if (DebugLoc.size () != 1 || !isSafeForSingleLocation)
1717
- return false ;
1718
- if (VeryLargeBlocks.count (StartDebugMI->getParent ()))
1719
- return false ;
1720
- return validThroughout (LScopes, StartDebugMI, EndMI, getInstOrdering ());
1706
+ return DebugLoc.size () == 1 && isSafeForSingleLocation &&
1707
+ validThroughout (LScopes, StartDebugMI, EndMI, getInstOrdering ());
1721
1708
}
1722
1709
1723
1710
DbgEntity *DwarfDebug::createConcreteEntity (DwarfCompileUnit &TheCU,
@@ -1749,13 +1736,6 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
1749
1736
// Grab the variable info that was squirreled away in the MMI side-table.
1750
1737
collectVariableInfoFromMFTable (TheCU, Processed);
1751
1738
1752
- // Identify blocks that are unreasonably sized, so that we can later
1753
- // skip lexical scope analysis over them.
1754
- DenseSet<const MachineBasicBlock *> VeryLargeBlocks;
1755
- for (const auto &MBB : *CurFn)
1756
- if (MBB.size () > LocationAnalysisSizeLimit)
1757
- VeryLargeBlocks.insert (&MBB);
1758
-
1759
1739
for (const auto &I : DbgValues) {
1760
1740
InlinedEntity IV = I.first ;
1761
1741
if (Processed.count (IV))
@@ -1792,8 +1772,7 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
1792
1772
if (HistSize == 1 || SingleValueWithClobber) {
1793
1773
const auto *End =
1794
1774
SingleValueWithClobber ? HistoryMapEntries[1 ].getInstr () : nullptr ;
1795
- if (VeryLargeBlocks.count (MInsn->getParent ()) == 0 &&
1796
- validThroughout (LScopes, MInsn, End, getInstOrdering ())) {
1775
+ if (validThroughout (LScopes, MInsn, End, getInstOrdering ())) {
1797
1776
RegVar->initializeDbgValue (MInsn);
1798
1777
continue ;
1799
1778
}
@@ -1808,8 +1787,7 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
1808
1787
1809
1788
// Build the location list for this variable.
1810
1789
SmallVector<DebugLocEntry, 8 > Entries;
1811
- bool isValidSingleLocation =
1812
- buildLocationList (Entries, HistoryMapEntries, VeryLargeBlocks);
1790
+ bool isValidSingleLocation = buildLocationList (Entries, HistoryMapEntries);
1813
1791
1814
1792
// Check whether buildLocationList managed to merge all locations to one
1815
1793
// that is valid throughout the variable's scope. If so, produce single
0 commit comments