[llvm] [DebugInfo][LoopVectorizer][NFC] Use unknown annotations for more instructions (PR #170522)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 3 10:15:12 PST 2025


SLTozer wrote:

> Out of curiosity, when are we supposed to use DebugLoc::getCompilerGenerated()?

Thanks for the quick review!

We use compiler generated annotations for instructions that are generated by the compiler but don't correspond to user code; there are some examples in global variable opt, loop unswitching, and tail recursion elimination right now, and also Clang applies it to any instructions it generates that weren't assigned a source location. It could also be appropriate here, the reason I've gone with "unknowns" is that I don't understand VPlan well enough to confidently select a different annotation.

Further down the line I intend to work through the "unknown" annotations in the vectorizers to either rewrite them to more accurate annotations or to see if there's a way the instructions could receive valid source locations instead.

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


More information about the llvm-commits mailing list