diff options
| author | Philip Reames <listmail@philipreames.com> | 2015-01-28 23:06:47 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2015-01-28 23:06:47 +0000 |
| commit | 9198b33b48967bd9d692cd56f831acfe08e7197f (patch) | |
| tree | 2be840d4118b911c2db777d2812d7d0c49bcb605 /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | |
| parent | a8fbcf0c1f9f3cff3a3deafe4bbb70419a822185 (diff) | |
| download | bcm5719-llvm-9198b33b48967bd9d692cd56f831acfe08e7197f.tar.gz bcm5719-llvm-9198b33b48967bd9d692cd56f831acfe08e7197f.zip | |
Teach SplitBlockPredecessors how to handle landingpad blocks.
Patch by: Igor Laevsky <igor@azulsystems.com>
"Currently SplitBlockPredecessors generates incorrect code in case if basic block we are going to split has a landingpad. Also seems like it is fairly common case among it's users to conditionally call either SplitBlockPredecessors or SplitLandingPadPredecessors. Because of this I think it is reasonable to add this condition directly into SplitBlockPredecessors."
Differential Revision: http://reviews.llvm.org/D7157
llvm-svn: 227390
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index 6bf8affcb2f..c78462f1d3f 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -769,16 +769,9 @@ void LoopUnswitch::SplitExitEdges(Loop *L, // Although SplitBlockPredecessors doesn't preserve loop-simplify in // general, if we call it on all predecessors of all exits then it does. - if (!ExitBlock->isLandingPad()) { - SplitBlockPredecessors(ExitBlock, Preds, ".us-lcssa", - /*AliasAnalysis*/ nullptr, DT, LI, - /*PreserveLCSSA*/ true); - } else { - SmallVector<BasicBlock*, 2> NewBBs; - SplitLandingPadPredecessors(ExitBlock, Preds, ".us-lcssa", ".us-lcssa", - NewBBs, /*AliasAnalysis*/ nullptr, DT, LI, - /*PreserveLCSSA*/ true); - } + SplitBlockPredecessors(ExitBlock, Preds, ".us-lcssa", + /*AliasAnalysis*/ nullptr, DT, LI, + /*PreserveLCSSA*/ true); } } |

