Mark values as trivially dead when their only use is a start or end lifetime intrinsic.
authorzoecarver <z.zoelec2@gmail.com>
Wed, 6 May 2020 17:52:03 +0000 (10:52 -0700)
committerzoecarver <z.zoelec2@gmail.com>
Wed, 6 May 2020 17:58:08 +0000 (10:58 -0700)
commit95aa28cc8fcbcb43a047779814a5be0abe54863b
treecdd69a8a9c01071b766bece29ee0fae7694fd1d7
parenta7e11496996269fc589322da7bedbe4b1adcb13f
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/Transforms/Attributor/memory_locations.ll
llvm/test/Transforms/DCE/basic.ll
llvm/test/Transforms/DeadStoreElimination/lifetime.ll
llvm/test/Transforms/InstCombine/vararg.ll