[DSE] Eliminate stores at the end of the function.
authorFlorian Hahn <flo@fhahn.com>
Wed, 24 Jun 2020 08:56:35 +0000 (09:56 +0100)
committerFlorian Hahn <flo@fhahn.com>
Wed, 24 Jun 2020 11:58:20 +0000 (12:58 +0100)
commit4e62c6359c7f9c0939c2a9072f8f1c41b2628412
tree6ab65ce13beb0304451471d4f64ebe190e5d6367
parent0f426935bb5ff26c0383b76d7986ca04183ff1ab
[DSE] Eliminate stores at the end of the function.

This patch add support for eliminating MemoryDefs that do not have any
aliasing users, which indicates that there are no reads/writes to the
memory location until the end of the function.

To eliminate such defs, we have to ensure that the underlying object is
not visible in the caller and does not escape via returning. We need a
separate check for that, as InvisibleToCaller does not consider returns.

Reviewers: dmgreen, rnk, efriedma, bryant, asbirlea, Tyker, george.burgess.iv

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D72631
14 files changed:
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/Transforms/DeadStoreElimination/MSSA/2011-09-06-EndOfFunction.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/libcalls.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/mda-with-dbg-values.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/memintrinsics.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-captures.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-exceptions.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-malloc-free.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-memintrinsics.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-multipath.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-simple.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/operand-bundles.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/simple-todo.ll
llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll