13 Commits

Author SHA1 Message Date
Lee Wei
cefc1b0c21
[llvm] Remove br i1 undef from some regression tests [NFC] (#117292)
This PR removes tests with `br i1 undef` under
`llvm/tests/Transforms/MemCpyOpt, MergedLoadStoreMotion, NewGVN`.
2024-11-26 20:50:54 +00:00
Florian Hahn
3734e4c0c4
[MergedLoadStore] Preserve common metadata when sinking stores. (#116382)
When sinking a store, preserve common metadata present on stores on both
sides of the diamond.

PR: https://github.com/llvm/llvm-project/pull/116382
2024-11-15 20:52:02 +00:00
Florian Hahn
a41ae90c0c
[MergeLodstore] Add tests for preserving metadata when sinking stores. 2024-11-15 13:11:12 +00:00
Jeremy Morse
d2d9dc8eb4
[DebugInfo][RemoveDIs] Make debugify pass convert to/from RemoveDIs mode (#73251)
Debugify is extremely useful as a testing and debugging tool, and a good
number of LLVM-IR transform tests use it. We need it to support "new"
non-instruction debug-info to get test coverage, but it's not important
enough to completely convert right now (and it'd be a large
undertaking). Thus: convert to/from dbg.value/DPValue mode on entry and
exit of the pass, which gives us the functionality without any further
work. The cost is compile-time, but again this is only happening during
tests.

Tested by: the large set of debugify tests enabled here. Note the
InstCombine test (cast-mul-select.ll) that hasn't been fully enabled:
this is because there's a debug-info sinking piece of code there that
hasn't been instrumented.
2023-11-29 13:19:50 +00:00
Nikita Popov
3984a3ddbb [MergedLoadStoreMotion] Regenerate test checks (NFC) 2023-07-28 14:45:30 +02:00
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