[DSE] Lift post-dominance for objs not accessible in caller.
authorFlorian Hahn <flo@fhahn.com>
Wed, 15 Apr 2020 09:42:58 +0000 (10:42 +0100)
committerFlorian Hahn <flo@fhahn.com>
Wed, 15 Apr 2020 10:37:14 +0000 (11:37 +0100)
commitcf9ee49b4d7f2e1341b84f941ad55cce1b16722d
tree4316857f46c96f007c32c629c94a110af24b0163
parentdd8153b757595f067b800db50a14ae0c599c54bc
[DSE] Lift post-dominance for objs not accessible in caller.

We can eliminate MemoryDefs of objects not accessible after the function
returns (e.g. alloca), if there are no reads between the MemoryDef and
any function exits. We can stop traversing paths that completely
overwrite the memory location of the MemoryDef.

This patch was split off D73763.

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

Reviewed By: asbirlea, george.burgess.iv

Differential Revision: https://reviews.llvm.org/D77736
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/Transforms/DeadStoreElimination/MSSA/memset-unknown-sizes.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