I would like to propose a RFC on Cross Block Dead Store Elimination.
Cross Block Dead Store elimination implemented in this patch works as follows-
- When a Store with non local memory dependency we call "handleNonLocalStoreDeletion".
- In handleNonLocalStoreDeletion we traverse the predecessor blocks of the store instruction till we encounter post domination frontier and try to find a candidate store for deletion.
- getStoreCandidates finds out if we have a candidate store for deletion which in any of the predecessor block.
- If we find a candidate store we then see that the store is not used by any instruction in any of the path from the current block till block were the overwriting store is present.
- We call DeleteDeadInstruction for the candidate store instruction if it is safe to remove the store.
No Regressions were found in make check-all and LLVM LNT test suites.
Please let me know your valuable option on the patch.
Thanks and Regards