diff options
| author | Alina Sbirlea <asbirlea@google.com> | 2019-08-19 18:57:40 +0000 |
|---|---|---|
| committer | Alina Sbirlea <asbirlea@google.com> | 2019-08-19 18:57:40 +0000 |
| commit | 1a3fdaf6a6ee0d4ff0bb5daf80c54a9fa5594467 (patch) | |
| tree | 74fa75b317dd89ff6a439f14dd8846677a41563e /llvm/include | |
| parent | 4340c2cf8fa79731d19a8a94cee87bb280c5b8aa (diff) | |
| download | bcm5719-llvm-1a3fdaf6a6ee0d4ff0bb5daf80c54a9fa5594467.tar.gz bcm5719-llvm-1a3fdaf6a6ee0d4ff0bb5daf80c54a9fa5594467.zip | |
[MemorySSA] Rename uses when inserting memory uses.
Summary:
When inserting uses from outside the MemorySSA creation, we don't
normally need to rename uses, based on the assumption that there will be
no inserted Phis (if Def existed that required a Phi, that Phi already
exists). However, when dealing with unreachable blocks, MemorySSA will
optimize away Phis whose incoming blocks are unreachable, and these Phis end
up being re-added when inserting a Use.
There are two potential solutions here:
1. Analyze the inserted Phis and clean them up if they are unneeded
(current method for cleaning up trivial phis does not cover this)
2. Leave the Phi in place and rename uses, the same way as whe inserting
defs.
This patch use approach 2.
Resolves first test in PR42940.
Reviewers: george.burgess.iv
Subscribers: Prazek, sanjoy.google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66033
llvm-svn: 369291
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/MemorySSAUpdater.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/Analysis/MemorySSAUpdater.h b/llvm/include/llvm/Analysis/MemorySSAUpdater.h index d4d8040c1ff..872f574733c 100644 --- a/llvm/include/llvm/Analysis/MemorySSAUpdater.h +++ b/llvm/include/llvm/Analysis/MemorySSAUpdater.h @@ -99,7 +99,7 @@ public: /// load a /// Where a mayalias b, *does* require RenameUses be set to true. void insertDef(MemoryDef *Def, bool RenameUses = false); - void insertUse(MemoryUse *Use); + void insertUse(MemoryUse *Use, bool RenameUses = false); /// Update the MemoryPhi in `To` following an edge deletion between `From` and /// `To`. If `To` becomes unreachable, a call to removeBlocks should be made. void removeEdge(BasicBlock *From, BasicBlock *To); |

