summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-01-19 12:09:11 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-01-19 12:09:11 +0000
commit37df2cfbf804698b378c685a937d20bc4f809155 (patch)
tree1bb6e7a590564754bee1ee742d0fed9548a2d117 /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
parent611b992add8e4439678f73d36afb2dd9f196ca63 (diff)
downloadbcm5719-llvm-37df2cfbf804698b378c685a937d20bc4f809155.tar.gz
bcm5719-llvm-37df2cfbf804698b378c685a937d20bc4f809155.zip
[PM] Remove the Pass argument from all of the critical edge splitting
APIs and replace it and numerous booleans with an option struct. The critical edge splitting API has a really large surface of flags and so it seems worth burning a small option struct / builder. This struct can be constructed with the various preserved analyses and then flags can be flipped in a builder style. The various users are now responsible for directly passing along their analysis information. This should be enough for the critical edge splitting to work cleanly with the new pass manager as well. This API is still pretty crufty and could be cleaned up a lot, but I've focused on this change just threading an option struct rather than a pass through the API. llvm-svn: 226456
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index 30d6d510ace..e809a5ccc84 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -706,8 +706,11 @@ void LoopUnswitch::EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val,
// If either edge is critical, split it. This helps preserve LoopSimplify
// form for enclosing loops.
- SplitCriticalEdge(BI, 0, this, false, false, true);
- SplitCriticalEdge(BI, 1, this, false, false, true);
+ auto Options = CriticalEdgeSplittingOptions(DT, LI)
+ .setPreserveLCSSA()
+ .setSplitLandingPads();
+ SplitCriticalEdge(BI, 0, Options);
+ SplitCriticalEdge(BI, 1, Options);
}
/// UnswitchTrivialCondition - Given a loop that has a trivial unswitchable
OpenPOWER on IntegriCloud