[PATCH] D98659: [MachineCopyPropagation] Do more backward copy propagations

yshui via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 13:25:38 PDT 2021


yshui created this revision.
Herald added a subscriber: hiraditya.
yshui requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Previously we only do backward copy propagations if there is no read or write to both the Def and Src of the copy between the definition site and the copy site.

However, this restriction can be relaxed. Reads of the Src can be allowed as long as those Reads are rewritten to use Def instead during the propagation.

This commit implements that, potentially improve the generated code. In particular, this resolve an inconsistency between optimized build and optimized build with debuginfo, where DBG_VALUE instructions could prevent backward copy propagation from happening (See: https://bugs.llvm.org/show_bug.cgi?id=49446)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98659

Files:
  llvm/lib/CodeGen/MachineCopyPropagation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98659.330784.patch
Type: text/x-patch
Size: 17586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210315/7a5da0a7/attachment.bin>


More information about the llvm-commits mailing list