8 Commits

Author SHA1 Message Date
Jeff Byrnes
9b79d0b610 [MergedLoadStoreMotion] Merge stores with conflicting value types
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
2023-04-04 12:01:29 -07:00
Nikita Popov
43b26b4aae Reapply [MergedLoadStoreMotion] Convert tests to opaque pointers (NFC)
Reapply after reapplying dependent revision.
2022-12-27 13:16:18 +01:00
Nikita Popov
cb03470aef Reapply [MergeLoadStoreMotion] Don't require GEP for sinking
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.
2022-12-27 12:49:30 +01:00
Nikita Popov
8bf3116387 Revert "[MergeLoadStoreMotion] Don't require GEP for sinking"
I missed a test failure in the DebugInfo directory.

This reverts commit 2c15b9d9e1a898cfd849db81b36d278eac3ef24e.
This reverts commit fb435e1cb5842e1437436e9e7378dfc4106fdad8.
2022-12-27 12:38:04 +01:00
Nikita Popov
fb435e1cb5 [MergedLoadStoreMotion] Convert tests to opaque pointers (NFC) 2022-12-27 12:20:05 +01:00
Nikita Popov
2c15b9d9e1 [MergeLoadStoreMotion] Don't require GEP for sinking
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.
2022-12-27 12:17:58 +01:00
Nikita Popov
9845969198 [MergedLoadStoreMotion] Add tests for store without GEPs (NFC)
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.
2022-12-27 12:03:59 +01:00
Nikita Popov
282c1e362b [Tests] Rename InstMerge -> MergedLoadStoreMotion (NFC)
These are tests for the MergeLoadStoreMotion pass, so name them
accordingly.
2022-12-27 11:53:33 +01:00