diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-08-13 23:06:54 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-08-13 23:06:54 +0000 |
commit | 8d804520766b6772277fcc1d9b31da02f320bc12 (patch) | |
tree | be4177477844c06c7e2416f4f320af2afbba02b0 /llvm/lib/Transforms/Utils/SSAUpdater.cpp | |
parent | 5d4e20587494c6e90e1f606ce8859a1c793ad37c (diff) | |
download | bcm5719-llvm-8d804520766b6772277fcc1d9b31da02f320bc12.tar.gz bcm5719-llvm-8d804520766b6772277fcc1d9b31da02f320bc12.zip |
LICM uses AliasSet information to hoist and sink instructions. However, other passes, such as LoopRotate
may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly.
This patch teaches SSAUpdater to notify AliasSet that it made changes.
The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size.
rdar://11872059 PR12901
llvm-svn: 161803
Diffstat (limited to 'llvm/lib/Transforms/Utils/SSAUpdater.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SSAUpdater.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp index b3f5289fcda..e568a616b6f 100644 --- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp +++ b/llvm/lib/Transforms/Utils/SSAUpdater.cpp @@ -214,6 +214,11 @@ void SSAUpdater::RewriteUse(Use &U) { else V = GetValueInMiddleOfBlock(User->getParent()); + // Notify that users of the existing value that it is being replaced. + Value *OldVal = U.get(); + if (OldVal != V && OldVal->hasValueHandle()) + ValueHandleBase::ValueIsRAUWd(OldVal, V); + U.set(V); } |