Commit 910a857
committed
[SimplifyCFG] Preserve common TBAA metadata when hoisting instructions.
Update FoldTwoEntryPHINode to collect common TBAA metadata for instructions
that match in all if-blocks and have the same TBAA metadata. If that is
the case, they access the same type on all paths and the TBAA info can
be preserved after hoisting.
I think we should be able to preserve most metadata, if it is available
on matching instructions in all blocks, i.e. preserve the intersection
of metadata on all matching instructions. I couldn't find any utility
that already computes that intersection. At the moment, the order of of
matching instructions must be the same.1 parent 001da22 commit 910a857
File tree
2 files changed
+29
-4
lines changed- llvm
- lib/Transforms/Utils
- test/Transforms/SimplifyCFG
2 files changed
+29
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3624 | 3624 | | |
3625 | 3625 | | |
3626 | 3626 | | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
3627 | 3650 | | |
3628 | 3651 | | |
3629 | 3652 | | |
| |||
3632 | 3655 | | |
3633 | 3656 | | |
3634 | 3657 | | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
3635 | 3662 | | |
3636 | 3663 | | |
3637 | 3664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 11 | + | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
0 commit comments