[llvm] Fix performance bug in buildLocationList (PR #109343)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 02:22:15 PDT 2024


https://github.com/jmorse commented:

Eyeballing this further, I was under the impression that this code was evaluating the validity of issuing a single-location in general, but I see now that's achieved by the earlier call to `validThroughout`. I see now that this is more about verifying the basic-block-section ranges are suitable to merge once the variable is identified as having a single-location, such as a constant value, is that correct?

I think my difficulty is in seeing any situation where the code from line 8130 onwards should return false -- if `validThroughout` has returned true, then we can use a single-location that implicitly covers every source-location that's in scope without the need for a location list surely? (I imagine it's tricky to identify the instruction-ranges that are in scope with basic block sections, but that's not a matter for buildLocationList).

Stepping back even further, I'm sort of questioning why this code is here without having a real handle on it; for this PR itself the change looks correct, with one inline question.

https://github.com/llvm/llvm-project/pull/109343


More information about the llvm-commits mailing list