Avoid spilling stack slots... to stack slots.
authorChris Lattner <sabre@nondot.org>
Tue, 27 Sep 2005 21:33:12 +0000 (21:33 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 27 Sep 2005 21:33:12 +0000 (21:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23478 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LowerInvoke.cpp

index 54724b5f1ac39c109f632224bc8e796ab5833c06..0f664e151f934ddcd353117757282110bf93cbf2 100644 (file)
@@ -334,6 +334,12 @@ splitLiveRangesLiveAcrossInvokes(std::vector<InvokeInst*> &Invokes) {
           cast<Instruction>(Inst->use_back())->getParent() == BB &&
           !isa<PHINode>(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<AllocaInst>(Inst))
+        if (isa<ConstantInt>(AI->getArraySize()) && BB == F->begin())
+          continue;
+      
       // Avoid iterator invalidation by copying users to a temporary vector.
       std::vector<Instruction*> Users;
       for (Value::use_iterator UI = Inst->use_begin(), E = Inst->use_end();