Commit Graph

2 Commits

Author SHA1 Message Date
Marianne Mailhot-Sarrasin 90d1786ba0 [DSE] Fix invalid removal of store instruction
Fix handling of alloc-like instructions in isGuaranteedLoopInvariant(). It was not valid when the 'KillingDef' was outside of the loop, while the 'CurrentDef' was inside the loop. In that case, the 'KillingDef' only overwrites the definition from the last iteration of the loop, and not the ones of all iterations. Therefor it does not make the 'CurrentDef' to be dead, and must not remove it.

Fixing issue : https://github.com/llvm/llvm-project/issues/52774

Reviewed by: Florian Hahn

Differential revision: https://reviews.llvm.org/D115965
2021-12-22 16:11:23 -05:00
Marianne Mailhot-Sarrasin df590567aa [DSE] Add test case showing bug PR52774.
Pre-commiting the test case before the bug fix.

Reviewed by: Florian Hahn

Differential revision: https://reviews.llvm.org/D115965
2021-12-22 14:57:28 -05:00