[PATCH] D56247: [BDCE] Remove dead uses of arguments

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 3 00:11:54 PST 2019


nikic created this revision.
nikic added reviewers: hfinkel, spatel.
Herald added a subscriber: llvm-commits.

Another followup to D55563 <https://reviews.llvm.org/D55563>.

In addition to finding dead uses of instructions, also find dead uses of function arguments, and replace them with zero as well.

I'm changing the way the known bits are computed here to remove the coupling between the transfer function and the algorithm. It previously relied on the first op being visited first and computing known bits -- unless the first op is not an instruction, in which case they're computed on the second op. I could have adjusted this to check for "instruction or argument", but I think it's better to avoid the repeated calculation with an explicit flag.


Repository:
  rL LLVM

https://reviews.llvm.org/D56247

Files:
  include/llvm/Analysis/DemandedBits.h
  lib/Analysis/DemandedBits.cpp
  lib/Transforms/Scalar/BDCE.cpp
  test/Transforms/BDCE/dead-uses.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56247.180001.patch
Type: text/x-patch
Size: 8513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190103/5332e4b1/attachment.bin>


More information about the llvm-commits mailing list