[llvm] [DebugInfo][LoopIdiomRecognize] Fix #82582: Wrong debug location update in processLoopStoreOfLoopLoad (PR #82608)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 23 03:16:13 PST 2024
jmorse wrote:
This is good defect to be found; unfortunately as Stephen says there's a conflict between stepping and attribution interests here. It's annoying for the weird stepping described in the issue/report to exist. However, if a developer passes an invalid pointer into the relevant function and there's a crash, with this patch they won't get a source location for where that crash came from which is catastrophic for their ability to debug what went wrong. They might not have expected their loop to become a memcpy and we shouldn't force developers to guess what the compiler did to their code.
I think we should collect these defects together to motivate future stepping improvements, but I don't think LLVMs debug-info is expressive enough to fix this problem right now :/. Dropping the location of an instruction that accesses memory is something to seriously avoid if we can. (It happens elsewhere, but typically where the penalty is worse than suboptimal stepping).
We've got some plans to consider stepping/attribution in the future, but we're not there yet.
https://github.com/llvm/llvm-project/pull/82608
More information about the llvm-commits
mailing list