diff options
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/CodeExtractor.cpp | 5 |
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 |