File: large-pic-jump-table.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (39 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
; RUN: llc -code-model=large -relocation-model=pic %s -o - | FileCheck %s

target triple = "x86_64-linux-gnu"

define i32 @f(i32 %i) {
bb:
  switch i32 %i, label %bb4 [
    i32 0, label %bb0
    i32 1, label %bb1
    i32 2, label %bb2
    i32 3, label %bb3
  ]

bb0:
  ret i32 1

bb1:
  ret i32 100

bb2:
  ret i32 200

bb3:
  ret i32 400

bb4:
  ret i32 300
}

; CHECK:      movabsq $.LJTI0_0@GOTOFF, [[R1:%r[a-z]{2}]]
; CHECK-NEXT: addq    [[R1]], [[R2:%r[a-z]{2}]]
; CHECK-NEXT: addq    ([[R2]],[[R3:%r[a-z]{2}]],8), [[R2]]
; CHECK-NEXT: jmpq    *[[R2]]

; CHECK: .LJTI0_0:
; CHECK-NEXT: .quad   .LBB0_2-.LJTI0_0
; CHECK-NEXT: .quad   .LBB0_3-.LJTI0_0
; CHECK-NEXT: .quad   .LBB0_4-.LJTI0_0
; CHECK-NEXT: .quad   .LBB0_5-.LJTI0_0