aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-18 05:56:32 +0000
committerChris Lattner <sabre@nondot.org>2004-03-18 05:56:32 +0000
commitaa7ab53b99c37a809563513bb8d5ac9a9230b104 (patch)
treeb17d1c76922598fc5f592aa85308b0d428803863
parenta930de523ffc61818aa444fc54715f00c2fb13f4 (diff)
downloadexternal_llvm-aa7ab53b99c37a809563513bb8d5ac9a9230b104.zip
external_llvm-aa7ab53b99c37a809563513bb8d5ac9a9230b104.tar.gz
external_llvm-aa7ab53b99c37a809563513bb8d5ac9a9230b104.tar.bz2
Fix bug: CodeExtractor/2004-03-17-MissedLiveIns.ll
With this fix we now successfully extract all 149 loops from 256.bzip2 without crashing or miscompiling the program! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12493 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index 9a47130..f2af475 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -75,6 +75,11 @@ void CodeExtractor::findInputsOutputs(Values &inputs, Values &outputs,
if (!BlocksToExtract.count(PN->getIncomingBlock(i)) &&
(isa<Instruction>(V) || isa<Argument>(V)))
inputs.push_back(V);
+ else if (Instruction *opI = dyn_cast<Instruction>(V)) {
+ if (!BlocksToExtract.count(opI->getParent()))
+ inputs.push_back(opI);
+ } else if (isa<Argument>(V))
+ inputs.push_back(V);
}
} else {
// All other instructions go through the generic input finder