diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-06-24 22:52:39 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-06-24 22:52:39 +0000 |
commit | ae2ef4ccd4b904461009c4444e1ae9006a666c0e (patch) | |
tree | 5e15cef9fa969476d81a31a2f81bd5f1c3371177 /llvm/lib/Transforms/Scalar/EarlyCSE.cpp | |
parent | babc13a3e25636bd6b9ee64baf42bca1a8e497cf (diff) | |
download | bcm5719-llvm-ae2ef4ccd4b904461009c4444e1ae9006a666c0e.tar.gz bcm5719-llvm-ae2ef4ccd4b904461009c4444e1ae9006a666c0e.zip |
Revert r273711, it caused PR28298.
llvm-svn: 273743
Diffstat (limited to 'llvm/lib/Transforms/Scalar/EarlyCSE.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp index 9d0ef42e039..0e93b0a37b0 100644 --- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp +++ b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp @@ -582,18 +582,11 @@ bool EarlyCSE::processNode(DomTreeNode *Node) { // its simpler value. if (Value *V = SimplifyInstruction(Inst, DL, &TLI, &DT, &AC)) { DEBUG(dbgs() << "EarlyCSE Simplify: " << *Inst << " to: " << *V << '\n'); - if (!Inst->use_empty()) { - Inst->replaceAllUsesWith(V); - Changed = true; - } - if (isInstructionTriviallyDead(Inst, &TLI)) { - Inst->eraseFromParent(); - Changed = true; - } - if (Changed) { - ++NumSimplify; - continue; - } + Inst->replaceAllUsesWith(V); + Inst->eraseFromParent(); + Changed = true; + ++NumSimplify; + continue; } // If this is a simple instruction that we can value number, process it. |