[PATCH] D114647: [TrivialDeadness] Introduce API separating two different usages

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 26 09:36:54 PST 2021


anna created this revision.
anna added reviewers: reames, mkazantsev, nikic, apilipenko, fhahn.
Herald added subscribers: ormris, okura, jdoerfert, kuter, hiraditya.
anna requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.

The earlier usage of `wouldInstructionBeTriviallyDead` is based on the
assumption that the use_count of that instruction being checked will be
zero. This patch separates the API into two different ones:

1. The strictly conservative one where the instruction is trivially dead iff the uses are dead.
2. The slightly relaxed form, where an instruction is dead along paths where it is not used.

The second form can be used in identifying instructions that are valid
to sink down to uses (patch to be updated in D109917 <https://reviews.llvm.org/D109917>).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114647

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/lib/Transforms/Scalar/BDCE.cpp
  llvm/lib/Transforms/Scalar/NewGVN.cpp
  llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp
  llvm/lib/Transforms/Utils/Local.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114647.390087.patch
Type: text/x-patch
Size: 8201 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211126/eea4e71e/attachment.bin>


More information about the llvm-commits mailing list