summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 59b109ead63..6ff05fe3e59 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -279,7 +279,6 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
II != IE; ++II) {
Instruction *NewInst = II->clone();
- VMap[&*II] = NewInst; // Add instruction map to value.
// Eagerly remap operands to the newly cloned instruction, except for PHI
// nodes for which we defer processing until we update the CFG.
@@ -298,15 +297,14 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
V = MappedV;
VMap[&*II] = V;
- if (!NewInst->mayHaveSideEffects()) {
- delete NewInst;
- continue;
- }
+ delete NewInst;
+ continue;
}
}
if (II->hasName())
NewInst->setName(II->getName()+NameSuffix);
+ VMap[&*II] = NewInst; // Add instruction map to value.
NewBB->getInstList().push_back(NewInst);
hasCalls |= (isa<CallInst>(II) && !isa<DbgInfoIntrinsic>(II));
OpenPOWER on IntegriCloud