[all-commits] [llvm/llvm-project] 1ce173: [DebugInfo] Use getStableDebugLoc to pick IRBuilde...
Jeremy Morse via All-commits
all-commits at lists.llvm.org
Mon Sep 11 11:01:03 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1ce1732f82aec29ec27d6de58153d516bca1d633
https://github.com/llvm/llvm-project/commit/1ce1732f82aec29ec27d6de58153d516bca1d633
Author: Jeremy Morse <jeremy.morse at sony.com>
Date: 2023-09-11 (Mon, 11 Sep 2023)
Changed paths:
M llvm/include/llvm/IR/IRBuilder.h
M llvm/include/llvm/IR/Instruction.h
M llvm/lib/IR/Instruction.cpp
M llvm/test/CodeGen/AMDGPU/llvm.dbg.value.ll
M llvm/test/Instrumentation/HWAddressSanitizer/RISCV/alloca.ll
M llvm/test/Instrumentation/HWAddressSanitizer/alloca.ll
M llvm/test/Transforms/LoopIdiom/X86/arithmetic-right-shift-until-zero.ll
M llvm/test/Transforms/LoopIdiom/X86/logical-right-shift-until-zero-debuginfo.ll
M llvm/test/Transforms/SROA/vector-promotion.ll
Log Message:
-----------
[DebugInfo] Use getStableDebugLoc to pick IRBuilder DebugLocs
When IRBuilder is given an insertion position and there is debug-info, it
sets the DebugLoc of newly inserted instructions to the DebugLoc of the
insertion position. Unfortunately, that means if you insert in front of a
debug intrinsics, your "real" instructions get potentially-misleading
source locations from the debug intrinsics. Worse, if you compile -gmlt to
get source locations but no variable locations, you'll get different source
locations to a normal -g build, which is silly.
Rectify this with the getStableDebugLoc method, which skips over any debug
intrinsics to find the next "real" instruction. This is the source location
that you would get if you compile with -gmlt, and it remains stable in the
presence of debug intrinsics. The changed tests show a few locations where
this has been happening, for example selecting line-zero locations for
instrumentation on a perfectly valid call site.
Differential Revision: https://reviews.llvm.org/D159485
More information about the All-commits
mailing list