summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-09-08 13:12:22 +0000
committerJames Molloy <james.molloy@arm.com>2016-09-08 13:12:22 +0000
commitc6a6144966d0502fe26b6670b2bd3d1ec2b64210 (patch)
treef976a5bdc15d9a989b9c992a9acde5543bc9858a /llvm/lib/CodeGen
parent7771462b28ca254a5091c947bf3d488bd41ce5b7 (diff)
downloadbcm5719-llvm-c6a6144966d0502fe26b6670b2bd3d1ec2b64210.tar.gz
bcm5719-llvm-c6a6144966d0502fe26b6670b2bd3d1ec2b64210.zip
[SDAGBuilder] Don't create a binary tree for switches in minsize mode
This bloats codesize - all of the non-leaf nodes are extra code. llvm-svn: 280932
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index e037108c2b4..5e9bc0da871 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9237,7 +9237,8 @@ void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) {
WorkList.pop_back();
unsigned NumClusters = W.LastCluster - W.FirstCluster + 1;
- if (NumClusters > 3 && TM.getOptLevel() != CodeGenOpt::None) {
+ if (NumClusters > 3 && TM.getOptLevel() != CodeGenOpt::None &&
+ !DefaultMBB->getParent()->getFunction()->optForMinSize()) {
// For optimized builds, lower large range as a balanced binary tree.
splitWorkItem(WorkList, W, SI.getCondition(), SwitchMBB);
continue;
OpenPOWER on IntegriCloud