diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-07-29 02:18:14 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-07-29 02:18:14 +0000 |
commit | 5657c01949dca6c012ac60d242d1a8d2ffdf5603 (patch) | |
tree | ecb9f93864eac57af9d445e4e0cb683472c5ab7f /test/CodeGen/Thumb2/thumb2-tbb.ll | |
parent | 794bfed25dd6a4282af204c8b4bfa76d7d4221d8 (diff) | |
download | llvm-5657c01949dca6c012ac60d242d1a8d2ffdf5603.tar.gz llvm-5657c01949dca6c012ac60d242d1a8d2ffdf5603.tar.bz2 llvm-5657c01949dca6c012ac60d242d1a8d2ffdf5603.tar.xz |
Optimize Thumb2 jumptable to use tbb / tbh when all the offsets fit in byte / halfword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-tbb.ll')
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-tbb.ll | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-tbb.ll b/test/CodeGen/Thumb2/thumb2-tbb.ll new file mode 100644 index 0000000000..c0347c7847 --- /dev/null +++ b/test/CodeGen/Thumb2/thumb2-tbb.ll @@ -0,0 +1,56 @@ +; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin | FileCheck %s +; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin -relocation-model=pic | FileCheck %s + +define void @bar(i32 %n.u) { +entry: +; CHECK: bar: +; CHECK: tbb + + switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ] +bb: + tail call void(...)* @foo1() + ret void +bb1: + tail call void(...)* @foo2() + ret void +bb2: + tail call void(...)* @foo6() + ret void +bb3: + tail call void(...)* @foo3() + ret void +bb4: + tail call void(...)* @foo4() + ret void +bb5: + tail call void(...)* @foo5() + ret void +bb6: + tail call void(...)* @foo1() + ret void +bb7: + tail call void(...)* @foo2() + ret void +bb8: + tail call void(...)* @foo6() + ret void +bb9: + tail call void(...)* @foo3() + ret void +bb10: + tail call void(...)* @foo4() + ret void +bb11: + tail call void(...)* @foo5() + ret void +bb12: + tail call void(...)* @foo6() + ret void +} + +declare void @foo1(...) +declare void @foo2(...) +declare void @foo6(...) +declare void @foo3(...) +declare void @foo4(...) +declare void @foo5(...) |