mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
It is not safe to sink an alloca into a stacksave/stackrestore pair, so don't do that. <rdar://problem/10352360>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1680,11 +1680,12 @@ void IndVarSimplify::SinkUnusedInvariants(Loop *L) {
|
||||
if (isa<LandingPadInst>(I))
|
||||
continue;
|
||||
|
||||
// Don't sink static AllocaInsts out of the entry block, which would
|
||||
// turn them into dynamic allocas!
|
||||
if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
|
||||
if (AI->isStaticAlloca())
|
||||
continue;
|
||||
// Don't sink alloca: we never want to sink static alloca's out of the
|
||||
// entry block, and correctly sinking dynamic alloca's requires
|
||||
// checks for stacksave/stackrestore intrinsics.
|
||||
// FIXME: Refactor this check somehow?
|
||||
if (isa<AllocaInst>(I))
|
||||
continue;
|
||||
|
||||
// Determine if there is a use in or before the loop (direct or
|
||||
// otherwise).
|
||||
|
||||
Reference in New Issue
Block a user