From e8594d5184f397e9cad4e7803f47894107bdd3f4 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Tue, 10 Apr 2018 13:23:10 -0700 Subject: [MemorySSA] Be less aggressive with @llvm.lifetime.start This is a workaround to keep LLVM from incorrectly removing stores in rare cases. It has not yet been committed, and -- due to the direction we seem to want to take MSSA in -- probably never will be. It should be sufficient to work around the problem until we agree on a good way forward. Additional context: https://reviews.llvm.org/D43269 This is rebased to r327695 by gbiv@chromium.org. Change-Id: Ib78a9e12845a28a48bbc4154e89775b1ef4b5319 --- lib/Analysis/MemorySSA.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/MemorySSA.cpp b/lib/Analysis/MemorySSA.cpp index c8fef6a1f16..0c5bff09ba8 100644 --- a/lib/Analysis/MemorySSA.cpp +++ b/lib/Analysis/MemorySSA.cpp @@ -257,13 +257,13 @@ static ClobberAlias instructionClobbersQuery(MemoryDef *MD, if (const IntrinsicInst *II = dyn_cast(DefInst)) { // These intrinsics will show up as affecting memory, but they are just - // markers. + // markers, mostly. switch (II->getIntrinsicID()) { case Intrinsic::lifetime_start: if (UseCS) return {false, NoAlias}; AR = AA.alias(MemoryLocation(II->getArgOperand(1)), UseLoc); - return {AR == MustAlias, AR}; + return {AR != NoAlias, AR}; case Intrinsic::lifetime_end: case Intrinsic::invariant_start: case Intrinsic::invariant_end: -- cgit v1.2.3