summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/switch-minsize.ll
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/test/CodeGen/ARM/switch-minsize.ll
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/test/CodeGen/ARM/switch-minsize.ll')
-rw-r--r--llvm/test/CodeGen/ARM/switch-minsize.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/switch-minsize.ll b/llvm/test/CodeGen/ARM/switch-minsize.ll
new file mode 100644
index 00000000000..92af6b35c3c
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/switch-minsize.ll
@@ -0,0 +1,34 @@
+; RUN: llc < %s | FileCheck %s
+
+target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
+target triple = "thumbv7-apple-ios8.0.0"
+
+; CHECK: beq
+; CHECK: beq
+; CHECK: beq
+; CHECK: cbnz
+declare void @g(i32)
+define void @f(i32 %val) optsize minsize {
+ switch i32 %val, label %def [
+ i32 0, label %one
+ i32 9, label %two
+ i32 994, label %three
+ i32 1154, label %four
+ ]
+
+one:
+ call void @g(i32 1)
+ ret void
+two:
+ call void @g(i32 001)
+ ret void
+three:
+ call void @g(i32 78)
+ ret void
+four:
+ call void @g(i32 87)
+ ret void
+def:
+ call void @g(i32 11)
+ ret void
+}
OpenPOWER on IntegriCloud