Commit 60dd1ee
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 c85611e commit 60dd1ee
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 | |
|---|---|---|---|
| |||
3845 | 3845 | | |
3846 | 3846 | | |
3847 | 3847 | | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
3848 | 3871 | | |
3849 | 3872 | | |
3850 | 3873 | | |
| |||
3853 | 3876 | | |
3854 | 3877 | | |
3855 | 3878 | | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
3856 | 3883 | | |
3857 | 3884 | | |
3858 | 3885 | | |
| |||
| 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