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_3
13 ; CHECK-NEXT: .LBB0_1: # %entry
14 ; CHECK-NEXT: daddiu $1, $2, %lo(%neg(%gp_rel(test)))
15 ; CHECK-NEXT: dsll $2, $4, 3
16 ; Previously this dsll was the following sequence:
20 ; CHECK-NEXT: ld $3, %got_page(.LJTI0_0)($1)
21 ; CHECK-NEXT: daddu $2, $2, $3
22 ; CHECK-NEXT: ld $2, %got_ofst(.LJTI0_0)($2)
23 ; CHECK-NEXT: daddu $1, $2, $1
26 ; CHECK-NEXT: .LBB0_2: # %sw.bb
28 ; CHECK-NEXT: daddiu $2, $zero, 1
29 ; CHECK-NEXT: .LBB0_3: # %default
31 ; CHECK-NEXT: daddiu $2, $zero, 1234
32 ; CHECK-NEXT: .LBB0_4: # %sw.bb1
34 ; CHECK-NEXT: daddiu $2, $zero, 0
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_3
58 ; CHECK-NEXT: .gpdword .LBB0_3
59 ; CHECK-NEXT: .gpdword .LBB0_2
60 ; CHECK-NEXT: .gpdword .LBB0_3
61 ; CHECK-NEXT: .gpdword .LBB0_2
62 ; CHECK-NEXT: .gpdword .LBB0_3
63 ; CHECK-NEXT: .gpdword .LBB0_3
64 ; CHECK-NEXT: .gpdword .LBB0_3
65 ; CHECK-NEXT: .gpdword .LBB0_3
66 ; CHECK-NEXT: .gpdword .LBB0_4