diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2019-02-12 07:48:07 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2019-02-12 07:48:07 +0000 |
commit | 6bf861597c87d708336c6ed36678d91b75d1043c (patch) | |
tree | f09289902767e5888de59b39314d56f1ce83c55e /llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp | |
parent | 4390c721cba09597037578100948bbc83cc41b16 (diff) | |
download | bcm5719-llvm-6bf861597c87d708336c6ed36678d91b75d1043c.tar.gz bcm5719-llvm-6bf861597c87d708336c6ed36678d91b75d1043c.zip |
[LoopSimplifyCFG] Pay respect to LCSSA when removing dead blocks
Utility function that we use for blocks deletion always unconditionally removes
one-input Phis. In LoopSimplifyCFG, it can lead to breach of LCSSA form.
This patch alters this function to keep them if needed.
Differential Revision: https://reviews.llvm.org/D57231
Reviewed By: fedor.sergeev
llvm-svn: 353803
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp index 01d770ca515..896f9dd001e 100644 --- a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp +++ b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp @@ -418,7 +418,7 @@ private: LI.removeBlock(BB); } - DetatchDeadBlocks(DeadLoopBlocks, &DTUpdates); + DetatchDeadBlocks(DeadLoopBlocks, &DTUpdates, /*KeepOneInputPHIs*/true); DTU.applyUpdates(DTUpdates); DTUpdates.clear(); for (auto *BB : DeadLoopBlocks) |