mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
Sink: Don't sink static allocas from the entry block
CodeGen treats allocas outside the entry block as dynamically sized stack objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -216,6 +216,13 @@ bool Sinking::IsAcceptableTarget(Instruction *Inst,
|
||||
/// instruction out of its current block into a successor.
|
||||
bool Sinking::SinkInstruction(Instruction *Inst,
|
||||
SmallPtrSet<Instruction *, 8> &Stores) {
|
||||
|
||||
// Don't sink static alloca instructions. CodeGen assumes allocas outside the
|
||||
// entry block are dynamically sized stack objects.
|
||||
if (AllocaInst *AI = dyn_cast<AllocaInst>(Inst))
|
||||
if (AI->isStaticAlloca())
|
||||
return false;
|
||||
|
||||
// Check if it's safe to move the instruction.
|
||||
if (!isSafeToMove(Inst, AA, Stores))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user