[PATCH] D145051: [ADCE] Only remove debug intrinsics if non debug instructions are removed

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 02:31:32 PST 2023


uabelho created this revision.
uabelho added reviewers: dblaikie, probinson, aprantl, aeubanks, JDevlieghere.
Herald added a subscriber: hiraditya.
Herald added a project: All.
uabelho requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We now limit ADCE to only remove debug intrinsics if it does something else
that would invalidate cached analyses anyway.
As we've seen in
 https://github.com/llvm/llvm-project/issues/58285
throwing away cached analysis info when only debug instructions are removed
can lead to different code when debug info is present or not present.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145051

Files:
  llvm/lib/Transforms/Scalar/ADCE.cpp
  llvm/test/Transforms/ADCE/debug-info-intrinsic-2.ll
  llvm/test/Transforms/ADCE/debug-info-intrinsic.ll
  llvm/test/Transforms/MergeFunc/mergefunc-preserve-debug-info.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145051.501434.patch
Type: text/x-patch
Size: 7457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230301/e8e52b9e/attachment.bin>


More information about the llvm-commits mailing list