[PATCH] D79355: Mark values as trivially dead when their only use is a start or end lifetime intrinsic.

Zoe Carver via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 12:54:18 PDT 2020


zoecarver created this revision.
zoecarver added a project: LLVM.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
zoecarver retitled this revision from "[NFC] Traverse function using dominator tree." to "Mark values as trivially dead when their only use is a start or end lifetime intrinsic. ".
zoecarver edited the summary of this revision.
zoecarver removed reviewers: jdoerfert, sstefan1.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
zoecarver added a comment.

Phab used the description and title from my last patch. Sorry about that.


If the only use of a value is a start or end lifetime intrinsic then mark the intrinsic as trivially dead. This should allow for that value to then be removed as well.

The only case where we may run into problems is the following:

  %a = alloca
  %e = get_element_ptr %a
  call void @llvm.lifetime.start.p0i8(%e)

The element will no longer be marked as live. But, in all cases (I think) we should be able to remove both the intrinsics and the GEP. So, I don't think this will be an issue.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79355

Files:
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/Transforms/Attributor/memory_locations.ll
  llvm/test/Transforms/Coroutines/coro-split-02.ll
  llvm/test/Transforms/DCE/basic.ll
  llvm/test/Transforms/DeadStoreElimination/lifetime.ll
  llvm/test/Transforms/Inline/byval-tail-call.ll
  llvm/test/Transforms/InstCombine/lower-dbg-declare.ll
  llvm/test/Transforms/InstCombine/vararg.ll
  llvm/test/Transforms/OpenMP/parallel_deletion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79355.261903.patch
Type: text/x-patch
Size: 7616 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200504/ff3216c7/attachment.bin>


More information about the llvm-commits mailing list