The DebugValueManager constructor scans the basic block to find all DEBUG_VALUE uses of a def. This can lead to quadratic behavior as reported in #168326. Instead, use MRI.use_instructions to find only the def's uses to limit the search. We still scan the BB so that we get the uses in order, and so we can stop when a new def is found.
16 KiB
16 KiB