]> granicus.if.org Git - llvm/commit
[BasicAA] Fix AA bug on dynamic allocas and stackrestore
authorReid Kleckner <rnk@google.com>
Fri, 21 Dec 2018 19:59:03 +0000 (19:59 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 21 Dec 2018 19:59:03 +0000 (19:59 +0000)
commitbf6ada6e17e88c9ba1b7e81d28cc50c9919472cf
treed3108940b40feae9690ec45f03bc77f68d44a50d
parent77cc239860855cc0317c47330429fe151a4aae97
[BasicAA] Fix AA bug on dynamic allocas and stackrestore

Summary:
BasicAA has special logic for unescaped allocas, which normally applies
equally well to dynamic and static allocas. However, llvm.stackrestore
has the power to end the lifetime of dynamic allocas, without referring
to them directly.

stackrestore is already marked with the most conservative memory
modification attributes, but because the alloca is not escaped, the
normal logic produces incorrect results. I think BasicAA needs a special
case here to teach it about the relationship between dynamic allocas and
stackrestore.

Fixes PR40118

Reviewers: gbiv, efriedma, george.burgess.iv

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D55969

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349945 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BasicAliasAnalysis.cpp
test/Transforms/MemCpyOpt/stackrestore.ll [new file with mode: 0644]