From b9aa1f4a03a3e1d8e062ceff6eb8ed71b4dd93eb Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 26 May 2016 04:58:46 +0000 Subject: MemorySSA: Revert r269678 and r268068; replace with special casing in MemorySSA. It turns out that too many passes are relying on alias analysis results for control dependencies. Until we fix that by introducing a more accurate modelling of control dependencies, special case assume in MemorySSA instead. Also introduce tests to ensure we don't regress the FunctionAttrs or LICM passes. Differential Revision: http://reviews.llvm.org/D20658 llvm-svn: 270823 --- llvm/lib/Transforms/Utils/MemorySSA.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/lib/Transforms/Utils/MemorySSA.cpp') diff --git a/llvm/lib/Transforms/Utils/MemorySSA.cpp b/llvm/lib/Transforms/Utils/MemorySSA.cpp index b87a6d611b1..9d8c0884fdb 100644 --- a/llvm/lib/Transforms/Utils/MemorySSA.cpp +++ b/llvm/lib/Transforms/Utils/MemorySSA.cpp @@ -354,6 +354,14 @@ MemorySSAWalker *MemorySSA::buildMemorySSA(AliasAnalysis *AA, /// \brief Helper function to create new memory accesses MemoryUseOrDef *MemorySSA::createNewAccess(Instruction *I) { + // The assume intrinsic has a control dependency which we model by claiming + // that it writes arbitrarily. Ignore that fake memory dependency here. + // FIXME: Replace this special casing with a more accurate modelling of + // assume's control dependency. + if (IntrinsicInst *II = dyn_cast(I)) + if (II->getIntrinsicID() == Intrinsic::assume) + return nullptr; + // Find out what affect this instruction has on memory. ModRefInfo ModRef = AA->getModRefInfo(I); bool Def = bool(ModRef & MRI_Mod); -- cgit v1.2.3