summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-10-22 19:10:07 +0000
committerSanjay Patel <spatel@rotateright.com>2017-10-22 19:10:07 +0000
commitb80daf0b48c6be27812c95904298fac0c9bdc4e2 (patch)
tree26cfe1572d9998ca15e55056cc18a3a3cf4dfb98 /llvm/lib/Transforms/Utils
parentdc168722daa842e93c3651057b3dde507a5c1e2d (diff)
downloadbcm5719-llvm-b80daf0b48c6be27812c95904298fac0c9bdc4e2.tar.gz
bcm5719-llvm-b80daf0b48c6be27812c95904298fac0c9bdc4e2.zip
[SimplifyCFG] delay switch condition forwarding to -latesimplifycfg
As discussed in D39011: https://reviews.llvm.org/D39011 ...replacing constants with a variable is inverting the transform done by other IR passes, so we definitely don't want to do this early. In fact, it's questionable whether this transform belongs in SimplifyCFG at all. I'll look at moving this to codegen as a follow-up step. llvm-svn: 316298
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 42f2bf267f5..954d6339dc0 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -5563,7 +5563,7 @@ bool SimplifyCFGOpt::SimplifySwitch(SwitchInst *SI, IRBuilder<> &Builder) {
if (switchToSelect(SI, Builder, DL, TTI))
return simplifyCFG(BB, TTI, Options) | true;
- if (ForwardSwitchConditionToPHI(SI))
+ if (Options.ForwardSwitchCondToPhi && ForwardSwitchConditionToPHI(SI))
return simplifyCFG(BB, TTI, Options) | true;
// The conversion from switch to lookup tables results in difficult-to-analyze
OpenPOWER on IntegriCloud