diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-22 20:13:43 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-22 20:13:43 +0000 |
| commit | 6f6198e75d9ca534ebca61176d05173f71a628da (patch) | |
| tree | a59e3df473431ec5a2cb2b6160807b947c89c407 /contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | |
| parent | 8dabf201f0a3b5bc559ca280412e351c492684b7 (diff) | |
| parent | 3edec5c15a78e4abba7eb9102fef3891c84ebdfb (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
| -rw-r--r-- | contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index be7d43bbcf2c..f530ee1246e8 100644 --- a/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -3065,9 +3065,11 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) { I->isTerminator()) return false; - // Do not sink alloca instructions out of the entry block. - if (isa<AllocaInst>(I) && I->getParent() == - &DestBlock->getParent()->getEntryBlock()) + // Do not sink static or dynamic alloca instructions. Static allocas must + // remain in the entry block, and dynamic allocas must not be sunk in between + // a stacksave / stackrestore pair, which would incorrectly shorten its + // lifetime. + if (isa<AllocaInst>(I)) return false; // Do not sink into catchswitch blocks. |
