llvm.org GIT mirror llvm / 736ceff
Add a note. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33743 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 13 years ago
1 changed file(s) with 61 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
6262 ldr r0, LCPI1_0
6363 =>
6464 ldr r0, pc, #((LCPI1_0-(LPCRELL0+4))&0xfffffffc)
65
66
67 //===---------------------------------------------------------------------===//
68
69 We compiles the following using a jump table.
70
71 define i16 @func_entry_2E_ce(i32 %i) {
72 newFuncRoot:
73 br label %entry.ce
74
75 bb12.exitStub: ; preds = %entry.ce
76 ret i16 0
77
78 bb4.exitStub: ; preds = %entry.ce, %entry.ce, %entry.ce
79 ret i16 1
80
81 bb9.exitStub: ; preds = %entry.ce, %entry.ce, %entry.ce
82 ret i16 2
83
84 bb.exitStub: ; preds = %entry.ce
85 ret i16 3
86
87 entry.ce: ; preds = %newFuncRoot
88 switch i32 %i, label %bb12.exitStub [
89 i32 0, label %bb4.exitStub
90 i32 1, label %bb9.exitStub
91 i32 2, label %bb4.exitStub
92 i32 3, label %bb4.exitStub
93 i32 7, label %bb9.exitStub
94 i32 8, label %bb.exitStub
95 i32 9, label %bb9.exitStub
96 ]
97 }
98
99 gcc compiles to:
100
101 cmp r0, #9
102 @ lr needed for prologue
103 bhi L2
104 ldr r3, L11
105 mov r2, #1
106 mov r1, r2, asl r0
107 ands r0, r3, r2, asl r0
108 movne r0, #2
109 bxne lr
110 tst r1, #13
111 beq L9
112 L3:
113 mov r0, r2
114 bx lr
115 L9:
116 tst r1, #256
117 movne r0, #3
118 bxne lr
119 L2:
120 mov r0, #0
121 bx lr
122 L12:
123 .align 2
124 L11:
125 .long 642