[PATCH] D151419: [DebugInfo][RemoveDIs] Eliminate some debug-intrinsics-affect-codegen errors

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 03:59:13 PDT 2023


jmorse created this revision.
jmorse added reviewers: Orlando, StephenTozer, CarlosAlbertoEnciso.
Herald added subscribers: hoy, javed.absar, hiraditya.
Herald added a project: All.
jmorse requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

This is a patch to reduce the effect that debug intrinsics have on codegen -- there are a few flavours of defect delt with here:

- Setting the DebugLoc of an instruction to one derived from a debug instruction,
- Counting the size of a block to include debug intrinsics,
- Examining debug intrinsics in SLPVectoriser (they should all be ignored)
- Picking an insertion point at a debug intrinsic in SCEVExpander

Not included in this patch are a few scenarios where we insert an existing instruction at a debug intrinsic position: these can have meaningful effects on the stepping behaviour, so we don't want to address them now. The two SCEVExpander scenarios are where the pass is generating new code and doesn't have an opinion on the line numbers.

I haven't written tests for these changes: IMO these changes are obviously correct, and I'd prefer to not test for behaviours that we're actively trying to design away.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151419

Files:
  llvm/lib/IR/BasicBlock.cpp
  llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151419.525529.patch
Type: text/x-patch
Size: 13452 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230525/20cf2e48/attachment-0001.bin>


More information about the llvm-commits mailing list