From 4531371960f3a36790c34c4fd85838907ff65a9c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Sep 2005 21:33:12 +0000 Subject: [PATCH] Avoid spilling stack slots... to stack slots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23478 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LowerInvoke.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index 54724b5f1ac..0f664e151f9 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -334,6 +334,12 @@ splitLiveRangesLiveAcrossInvokes(std::vector &Invokes) { cast(Inst->use_back())->getParent() == BB && !isa(Inst->use_back())) continue; + // If this is an alloca in the entry block, it's not a real register + // value. + if (AllocaInst *AI = dyn_cast(Inst)) + if (isa(AI->getArraySize()) && BB == F->begin()) + continue; + // Avoid iterator invalidation by copying users to a temporary vector. std::vector Users; for (Value::use_iterator UI = Inst->use_begin(), E = Inst->use_end();