1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; We used to generate a mul+mflo sequence instead of shifting by 2/3 to get the jump table address
3 ; RUN: llc %s -O2 -mtriple=mips64-unknown-freebsd -target-abi n64 -relocation-model=pic -o - | FileCheck %s
5 define i64 @test(i64 %arg) {
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: lui $1, %hi(%neg(%gp_rel(test)))
9 ; CHECK-NEXT: daddu $2, $1, $25
10 ; CHECK-NEXT: sltiu $1, $4, 11
11 ; CHECK-NEXT: beqz $1, .LBB0_4
13 ; CHECK-NEXT: # %bb.1: # %entry
14 ; CHECK-NEXT: daddiu $1, $2, %lo(%neg(%gp_rel(test)))
15 ; CHECK-NEXT: dsll $2, $4, 3
16 ; CHECK-NEXT: ld $3, %got_page(.LJTI0_0)($1)
17 ; CHECK-NEXT: daddu $2, $2, $3
18 ; CHECK-NEXT: ld $2, %got_ofst(.LJTI0_0)($2)
19 ; CHECK-NEXT: daddu $1, $2, $1
22 ; CHECK-NEXT: .LBB0_2: # %sw.bb
24 ; CHECK-NEXT: daddiu $2, $zero, 1
25 ; CHECK-NEXT: .LBB0_3: # %sw.bb1
27 ; CHECK-NEXT: daddiu $2, $zero, 0
28 ; CHECK-NEXT: .LBB0_4: # %default
30 ; CHECK-NEXT: daddiu $2, $zero, 1234
31 ; Previously this dsll was the following sequence:
36 switch i64 %arg, label %default [
53 ; CHECK-LABEL: .section .rodata,"a",@progbits
54 ; CHECK-NEXT: .p2align 3
55 ; CHECK-LABEL: .LJTI0_0:
56 ; CHECK-NEXT: .gpdword .LBB0_2
57 ; CHECK-NEXT: .gpdword .LBB0_4
58 ; CHECK-NEXT: .gpdword .LBB0_4
59 ; CHECK-NEXT: .gpdword .LBB0_2
60 ; CHECK-NEXT: .gpdword .LBB0_4
61 ; CHECK-NEXT: .gpdword .LBB0_2
62 ; CHECK-NEXT: .gpdword .LBB0_4
63 ; CHECK-NEXT: .gpdword .LBB0_4
64 ; CHECK-NEXT: .gpdword .LBB0_4
65 ; CHECK-NEXT: .gpdword .LBB0_4
66 ; CHECK-NEXT: .gpdword .LBB0_3