summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorAlina Sbirlea <asbirlea@google.com>2019-01-24 19:48:35 +0000
committerAlina Sbirlea <asbirlea@google.com>2019-01-24 19:48:35 +0000
commit52f6e2a173c80d31ff94b208dda72c247a02f56b (patch)
treefc1be2e29e1e25c46b6540b9aa86753e8a5a5f6a /llvm/lib/Transforms
parent4775721dda2329bf29bea3f42ec384fd72a33008 (diff)
downloadbcm5719-llvm-52f6e2a173c80d31ff94b208dda72c247a02f56b.tar.gz
bcm5719-llvm-52f6e2a173c80d31ff94b208dda72c247a02f56b.zip
[MemorySSA +LICM CFHoist] Solve PR40317.
Summary: MemorySSA needs updating each time an instruction is moved. LICM and control flow hoisting re-hoists instructions, thus needing another update when re-moving those instructions. Pending cleanup: the MSSA update is duplicated, should be moved inside moveInstructionBefore. Reviewers: jnspaulsson Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits Differential Revision: https://reviews.llvm.org/D57176 llvm-svn: 352092
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 391a2bd1de5..09e36261287 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -867,6 +867,11 @@ bool llvm::hoistRegion(DomTreeNode *N, AliasAnalysis *AA, LoopInfo *LI,
<< HoistPoint->getParent()->getName()
<< ": " << *I << "\n");
moveInstructionBefore(*I, *HoistPoint, *SafetyInfo);
+ if (MSSAU)
+ if (MemoryUseOrDef *OldMemAcc = cast_or_null<MemoryUseOrDef>(
+ MSSAU->getMemorySSA()->getMemoryAccess(I)))
+ MSSAU->moveToPlace(OldMemAcc, HoistPoint->getParent(),
+ MemorySSA::End);
HoistPoint = I;
Changed = true;
}
OpenPOWER on IntegriCloud