diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-12 15:24:17 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-12 15:24:17 +0000 |
commit | ca2a8cea2f6fc437a2a6ca7b8c6539087519fd83 (patch) | |
tree | fde7a928728b1f224bf9975bce0b5092df4c4801 /llvm/lib | |
parent | 8bba6bfeef6853194f47f85c7391bc3b52e867f0 (diff) | |
download | bcm5719-llvm-ca2a8cea2f6fc437a2a6ca7b8c6539087519fd83.tar.gz bcm5719-llvm-ca2a8cea2f6fc437a2a6ca7b8c6539087519fd83.zip |
Revert "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast."
This reverts commit r320483 because of the failed Windows buildbots.
llvm-svn: 320485
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 9f00e6f8358..01fc1528681 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -1354,24 +1354,9 @@ bool removeBitcastsFromLoadStoreOnMinMax(InstCombiner &IC, StoreInst &SI) { if (!isMinMaxWithLoads(LoadAddr)) return false; - if (!all_of(LI->users(), [LI](User *U) { - auto *SI = dyn_cast<StoreInst>(U); - return SI && SI->getPointerOperand() != LI && - !SI->getPointerOperand()->isSwiftError(); - })) - return false; - - IC.Builder.SetInsertPoint(LI); LoadInst *NewLI = combineLoadToNewType( IC, *LI, LoadAddr->getType()->getPointerElementType()); - // Replace all the stores with stores of the newly loaded value. - for (auto *UI : LI->users()) { - auto *SI = cast<StoreInst>(UI); - IC.Builder.SetInsertPoint(SI); - combineStoreToNewValue(IC, *SI, NewLI); - IC.eraseInstFromFunction(*SI); - } - IC.Worklist.Add(LI); + combineStoreToNewValue(IC, SI, NewLI); return true; } @@ -1400,7 +1385,7 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { return eraseInstFromFunction(SI); if (removeBitcastsFromLoadStoreOnMinMax(*this, SI)) - return nullptr; + return eraseInstFromFunction(SI); // Replace GEP indices if possible. if (Instruction *NewGEPI = replaceGEPIdxWithZero(*this, Ptr, SI)) { |