Since memory does not have an intrinsic type, we do not need to require value type matching on stores in order to sink them. To facilitate that, this patch finds stores which are sinkable, but have conflicting types, and bitcasts the ValueOperand so they are easily sinkable into a PHINode. Rather than doing fancy analysis to optimally insert the bitcast, we always insert right before the relevant store in the diamond branch. The assumption is that later passes (e.g. GVN, SimplifyCFG) will clean up bitcasts as needed.
Differential Revision: https://reviews.llvm.org/D147348
Reapply with a fix for a failing debuginfo assignment tracking test.
-----
Allow sinking stores where both operands are the same, don't require
them to have an identical GEP in each block.
This came up when migrating tests to opaque pointers, where
zero-index GEPs are omitted.
I missed a test failure in the DebugInfo directory.
This reverts commit 2c15b9d9e1a898cfd849db81b36d278eac3ef24e.
This reverts commit fb435e1cb5842e1437436e9e7378dfc4106fdad8.
Allow sinking stores where both operands are the same, don't require
them to have an identical GEP in each block.
This came up when migrating tests to opaque pointers, where
zero-index GEPs are omitted.
MergedLoadStoreMotion currently only handles the case where each
store has it's own GEP. It fails to handle the case where the
store argument is exactly the same.