Debian Codegraph @

llvm/test/CodeGen/PowerPC/jump-table.ll

raw
1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -stop-after=finalize-isel \
2 ; RUN: | FileCheck %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-ibm-aix -stop-after=finalize-isel \
4 ; RUN: | FileCheck %s
5 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-ibm-aix -stop-after=finalize-isel \
6 ; RUN: | FileCheck %s
7 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -stop-after=finalize-isel \
8 ; RUN: -min-jump-table-entries=4 | FileCheck %s
9 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -stop-after=finalize-isel \
10 ; RUN: -ppc-min-jump-table-entries=4 | FileCheck %s -check-prefix=JT
11
12 ; JT: jumpTable:
13 ; JT-NEXT: kind: label-difference32
14 ; JT-NEXT: entries:
15 ; JT-NEXT: - id: 0
16
17 ; CHECK-NOT: jumpTable:
18
19 define signext i32 @jt(i32 signext %a, i32 signext %b) {
20 entry:
21 switch i32 %a, label %sw.epilog [
22 i32 15, label %return
23 i32 12, label %sw.bb1
24 i32 19, label %sw.bb2
25 i32 27, label %sw.bb3
26 i32 31, label %sw.bb4
27 ]
28
29 sw.bb1: ; preds = %entry
30 br label %return
31
32 sw.bb2: ; preds = %entry
33 br label %return
34
35 sw.bb3: ; preds = %entry
36 br label %return
37
38 sw.bb4: ; preds = %entry
39 br label %return
40
41 sw.epilog: ; preds = %entry
42 br label %return
43
44 return: ; preds = %entry, %sw.epilog, %sw.bb4, %sw.bb3, %sw.bb2, %sw.bb1
45 %retval.0 = phi i32 [ 0, %sw.epilog ], [ 51, %sw.bb4 ], [ 49, %sw.bb3 ], [ 48, %sw.bb2 ], [ 46, %sw.bb1 ], [ 45, %entry ]
46 ret i32 %retval.0
47 }