From aa7ab53b99c37a809563513bb8d5ac9a9230b104 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 18 Mar 2004 05:56:32 +0000 Subject: [PATCH] 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 --- lib/Transforms/Utils/CodeExtractor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index 9a47130c7b3..f2af475c042 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(V) || isa(V))) inputs.push_back(V); + else if (Instruction *opI = dyn_cast(V)) { + if (!BlocksToExtract.count(opI->getParent())) + inputs.push_back(opI); + } else if (isa(V)) + inputs.push_back(V); } } else { // All other instructions go through the generic input finder -- 2.34.1