Re-commit: Mark values as trivially dead when their only use is a start or end lifeti...
authorzoecarver <z.zoelec2@gmail.com>
Fri, 8 May 2020 19:22:39 +0000 (12:22 -0700)
committerzoecarver <z.zoelec2@gmail.com>
Fri, 8 May 2020 19:24:10 +0000 (12:24 -0700)
commitf65f566aeb799f35f48c5c9bbc54b05bafec4f08
tree373275d4088744ebcc85b021418719941630e48e
parent1aa8cef97a7b00845d50aa148dbf4847ee4886fd
Re-commit: Mark values as trivially dead when their only use is a start or end lifetime intrinsic.

Summary:
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.

Currently, this only works for allocas, globals, and arguments.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79355
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Analysis/BasicAA/modref.ll
llvm/test/Transforms/Attributor/memory_locations.ll
llvm/test/Transforms/DCE/basic.ll
llvm/test/Transforms/DeadStoreElimination/lifetime.ll
llvm/test/Transforms/InstCombine/vararg.ll