[DSE] Relax constraint on isGuaranteedLoopInvariant
authorluxufan <luxufan@iscas.ac.cn>
Wed, 5 Oct 2022 20:38:49 +0000 (20:38 +0000)
committerluxufan <luxufan@iscas.ac.cn>
Thu, 6 Oct 2022 03:01:21 +0000 (03:01 +0000)
commiteaf6e2fc337ce428ae87d57360a2168c415acb5d
tree4145bdcae838968d0cf3946293ba50f11d94a913
parent7329dc0cc3ea2d2b24586d7bd44efd1b93312658
[DSE] Relax constraint on isGuaranteedLoopInvariant

If the location ptr to be killed is in no loop and the Function does not
have irreducible loops, then we can regard it as loop invariant.

Differential Revision: https://reviews.llvm.org/D135369
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/Transforms/DeadStoreElimination/multiblock-loops.ll
llvm/test/Transforms/DeadStoreElimination/multiblock-malloc-free.ll