[llvm] [DWARFVerifier] Allow overlapping ranges for ICF-merged functions (PR #117952)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 11:44:25 PST 2024
================
@@ -622,7 +627,8 @@ unsigned DWARFVerifier::verifyDieRanges(const DWARFDie &Die,
}
// Verify that children don't intersect.
- const auto IntersectingChild = ParentRI.insert(RI);
+ bool AllowDuplicates = Die.getTag() == DW_TAG_subprogram;
----------------
dwblaikie wrote:
I guess a few questions:
Is this only allowing duplicates on DW_AT_ranges of DW_AT_subprograms? Or only allowing overlap /of/ subprograms /on/ CUs? I guess the latter - so that, sufficiently generalizes, handles the case of subprograms with ranges (basic block sections) that overlap with /other/ subprograms
But presumably that /doesn't/ cover the case where a subprogram's sections might overlap with itself, due to BB sections? (or perhaps it does, if there's no "self" special case - if you're allowing a subprogram to overlap with other subprograms, including itself)
But shouldn't this apply to CUs too? a CU ranges could overlap with another CU due to a subprogram in one CU overlapping with a subprogram in a different CU? (is that tested? does that somehow come out of the subprogram-only-allowed case here?)
But, equally, this should apply to lexical scopes too - should be able to make a scope in a function compiled with basic-block sections have self-duplicate ranges, or collide/duplicate with athore lexical scope's ranges in the same subprogram (by putting the same code in different places in a function, and wrapping it in lexical scopes)
https://github.com/llvm/llvm-project/pull/117952
More information about the llvm-commits
mailing list