Home | History | Annotate | Download | only in Mips
      1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
      2 
      3 ; RUN: llc -mtriple=mips-unknown-linux-gnu -enable-shrink-wrap=true \
      4 ; RUN:   -relocation-model=static < %s | \
      5 ; RUN:   FileCheck %s -check-prefix=SHRINK-WRAP-STATIC
      6 
      7 ; RUN: llc -mtriple=mips-unknown-linux-gnu -enable-shrink-wrap=false \
      8 ; RUN:   -relocation-model=static < %s | \
      9 ; RUN:   FileCheck %s -check-prefix=NO-SHRINK-WRAP-STATIC
     10 
     11 ; RUN: llc -mtriple=mips-unknown-linux-gnu -enable-shrink-wrap=true \
     12 ; RUN:   -relocation-model=pic < %s | \
     13 ; RUN:   FileCheck %s -check-prefix=SHRINK-WRAP-PIC
     14 
     15 ; RUN: llc -mtriple=mips-unknown-linux-gnu -enable-shrink-wrap=false \
     16 ; RUN:   -relocation-model=pic < %s | \
     17 ; RUN:   FileCheck %s -check-prefix=NO-SHRINK-WRAP-PIC
     18 
     19 ; RUN: llc -mtriple=mips64-unknown-linux-gnu -enable-shrink-wrap=true \
     20 ; RUN:   -relocation-model=static < %s | \
     21 ; RUN:   FileCheck %s -check-prefix=SHRINK-WRAP-64-STATIC
     22 
     23 ; RUN: llc -mtriple=mips64-unknown-linux-gnu -enable-shrink-wrap=false \
     24 ; RUN:   -relocation-model=static < %s | \
     25 ; RUN:   FileCheck %s -check-prefix=NO-SHRINK-WRAP-64-STATIC
     26 
     27 ; RUN: llc -mtriple=mips64-unknown-linux-gnu -enable-shrink-wrap=true \
     28 ; RUN:   -relocation-model=pic < %s | \
     29 ; RUN:   FileCheck %s -check-prefix=SHRINK-WRAP-64-PIC
     30 
     31 ; RUN: llc -mtriple=mips64-unknown-linux-gnu -enable-shrink-wrap=false \
     32 ; RUN:   -relocation-model=pic < %s | \
     33 ; RUN:   FileCheck %s -check-prefix=NO-SHRINK-WRAP-64-PIC
     34 
     35 declare void @f(i32 signext)
     36 
     37 define i32 @foo(i32 signext %a) {
     38 ; SHRINK-WRAP-STATIC-LABEL: foo:
     39 ; SHRINK-WRAP-STATIC:       # %bb.0: # %entry
     40 ; SHRINK-WRAP-STATIC-NEXT:    beqz $4, $BB0_2
     41 ; SHRINK-WRAP-STATIC-NEXT:    nop
     42 ; SHRINK-WRAP-STATIC-NEXT:  # %bb.1: # %if.end
     43 ; SHRINK-WRAP-STATIC-NEXT:    addiu $sp, $sp, -24
     44 ; SHRINK-WRAP-STATIC-NEXT:    .cfi_def_cfa_offset 24
     45 ; SHRINK-WRAP-STATIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
     46 ; SHRINK-WRAP-STATIC-NEXT:    .cfi_offset 31, -4
     47 ; SHRINK-WRAP-STATIC-NEXT:    jal f
     48 ; SHRINK-WRAP-STATIC-NEXT:    addiu $4, $4, 1
     49 ; SHRINK-WRAP-STATIC-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
     50 ; SHRINK-WRAP-STATIC-NEXT:    addiu $sp, $sp, 24
     51 ; SHRINK-WRAP-STATIC-NEXT:  $BB0_2: # %return
     52 ; SHRINK-WRAP-STATIC-NEXT:    jr $ra
     53 ; SHRINK-WRAP-STATIC-NEXT:    addiu $2, $zero, 0
     54 ;
     55 ; NO-SHRINK-WRAP-STATIC-LABEL: foo:
     56 ; NO-SHRINK-WRAP-STATIC:       # %bb.0: # %entry
     57 ; NO-SHRINK-WRAP-STATIC-NEXT:    addiu $sp, $sp, -24
     58 ; NO-SHRINK-WRAP-STATIC-NEXT:    .cfi_def_cfa_offset 24
     59 ; NO-SHRINK-WRAP-STATIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
     60 ; NO-SHRINK-WRAP-STATIC-NEXT:    .cfi_offset 31, -4
     61 ; NO-SHRINK-WRAP-STATIC-NEXT:    beqz $4, $BB0_2
     62 ; NO-SHRINK-WRAP-STATIC-NEXT:    nop
     63 ; NO-SHRINK-WRAP-STATIC-NEXT:  # %bb.1: # %if.end
     64 ; NO-SHRINK-WRAP-STATIC-NEXT:    jal f
     65 ; NO-SHRINK-WRAP-STATIC-NEXT:    addiu $4, $4, 1
     66 ; NO-SHRINK-WRAP-STATIC-NEXT:  $BB0_2: # %return
     67 ; NO-SHRINK-WRAP-STATIC-NEXT:    addiu $2, $zero, 0
     68 ; NO-SHRINK-WRAP-STATIC-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
     69 ; NO-SHRINK-WRAP-STATIC-NEXT:    jr $ra
     70 ; NO-SHRINK-WRAP-STATIC-NEXT:    addiu $sp, $sp, 24
     71 ;
     72 ; SHRINK-WRAP-PIC-LABEL: foo:
     73 ; SHRINK-WRAP-PIC:       # %bb.0: # %entry
     74 ; SHRINK-WRAP-PIC-NEXT:    lui $2, %hi(_gp_disp)
     75 ; SHRINK-WRAP-PIC-NEXT:    addiu $2, $2, %lo(_gp_disp)
     76 ; SHRINK-WRAP-PIC-NEXT:    beqz $4, $BB0_2
     77 ; SHRINK-WRAP-PIC-NEXT:    addu $gp, $2, $25
     78 ; SHRINK-WRAP-PIC-NEXT:  # %bb.1: # %if.end
     79 ; SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, -24
     80 ; SHRINK-WRAP-PIC-NEXT:    .cfi_def_cfa_offset 24
     81 ; SHRINK-WRAP-PIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
     82 ; SHRINK-WRAP-PIC-NEXT:    .cfi_offset 31, -4
     83 ; SHRINK-WRAP-PIC-NEXT:    lw $25, %call16(f)($gp)
     84 ; SHRINK-WRAP-PIC-NEXT:    jalr $25
     85 ; SHRINK-WRAP-PIC-NEXT:    addiu $4, $4, 1
     86 ; SHRINK-WRAP-PIC-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
     87 ; SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, 24
     88 ; SHRINK-WRAP-PIC-NEXT:  $BB0_2: # %return
     89 ; SHRINK-WRAP-PIC-NEXT:    jr $ra
     90 ; SHRINK-WRAP-PIC-NEXT:    addiu $2, $zero, 0
     91 ;
     92 ; NO-SHRINK-WRAP-PIC-LABEL: foo:
     93 ; NO-SHRINK-WRAP-PIC:       # %bb.0: # %entry
     94 ; NO-SHRINK-WRAP-PIC-NEXT:    lui $2, %hi(_gp_disp)
     95 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $2, $2, %lo(_gp_disp)
     96 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, -24
     97 ; NO-SHRINK-WRAP-PIC-NEXT:    .cfi_def_cfa_offset 24
     98 ; NO-SHRINK-WRAP-PIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
     99 ; NO-SHRINK-WRAP-PIC-NEXT:    .cfi_offset 31, -4
    100 ; NO-SHRINK-WRAP-PIC-NEXT:    beqz $4, $BB0_2
    101 ; NO-SHRINK-WRAP-PIC-NEXT:    addu $gp, $2, $25
    102 ; NO-SHRINK-WRAP-PIC-NEXT:  # %bb.1: # %if.end
    103 ; NO-SHRINK-WRAP-PIC-NEXT:    lw $25, %call16(f)($gp)
    104 ; NO-SHRINK-WRAP-PIC-NEXT:    jalr $25
    105 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $4, $4, 1
    106 ; NO-SHRINK-WRAP-PIC-NEXT:  $BB0_2: # %return
    107 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $2, $zero, 0
    108 ; NO-SHRINK-WRAP-PIC-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
    109 ; NO-SHRINK-WRAP-PIC-NEXT:    jr $ra
    110 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, 24
    111 ;
    112 ; SHRINK-WRAP-64-STATIC-LABEL: foo:
    113 ; SHRINK-WRAP-64-STATIC:       # %bb.0: # %entry
    114 ; SHRINK-WRAP-64-STATIC-NEXT:    beqz $4, .LBB0_2
    115 ; SHRINK-WRAP-64-STATIC-NEXT:    nop
    116 ; SHRINK-WRAP-64-STATIC-NEXT:  # %bb.1: # %if.end
    117 ; SHRINK-WRAP-64-STATIC-NEXT:    daddiu $sp, $sp, -16
    118 ; SHRINK-WRAP-64-STATIC-NEXT:    .cfi_def_cfa_offset 16
    119 ; SHRINK-WRAP-64-STATIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    120 ; SHRINK-WRAP-64-STATIC-NEXT:    .cfi_offset 31, -8
    121 ; SHRINK-WRAP-64-STATIC-NEXT:    jal f
    122 ; SHRINK-WRAP-64-STATIC-NEXT:    addiu $4, $4, 1
    123 ; SHRINK-WRAP-64-STATIC-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
    124 ; SHRINK-WRAP-64-STATIC-NEXT:    daddiu $sp, $sp, 16
    125 ; SHRINK-WRAP-64-STATIC-NEXT:  .LBB0_2: # %return
    126 ; SHRINK-WRAP-64-STATIC-NEXT:    jr $ra
    127 ; SHRINK-WRAP-64-STATIC-NEXT:    addiu $2, $zero, 0
    128 ;
    129 ; NO-SHRINK-WRAP-64-STATIC-LABEL: foo:
    130 ; NO-SHRINK-WRAP-64-STATIC:       # %bb.0: # %entry
    131 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    daddiu $sp, $sp, -16
    132 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    .cfi_def_cfa_offset 16
    133 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    134 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    .cfi_offset 31, -8
    135 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    beqz $4, .LBB0_2
    136 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    nop
    137 ; NO-SHRINK-WRAP-64-STATIC-NEXT:  # %bb.1: # %if.end
    138 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    jal f
    139 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    addiu $4, $4, 1
    140 ; NO-SHRINK-WRAP-64-STATIC-NEXT:  .LBB0_2: # %return
    141 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    addiu $2, $zero, 0
    142 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
    143 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    jr $ra
    144 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    daddiu $sp, $sp, 16
    145 ;
    146 ; SHRINK-WRAP-64-PIC-LABEL: foo:
    147 ; SHRINK-WRAP-64-PIC:       # %bb.0: # %entry
    148 ; SHRINK-WRAP-64-PIC-NEXT:    lui $1, %hi(%neg(%gp_rel(foo)))
    149 ; SHRINK-WRAP-64-PIC-NEXT:    beqz $4, .LBB0_2
    150 ; SHRINK-WRAP-64-PIC-NEXT:    daddu $2, $1, $25
    151 ; SHRINK-WRAP-64-PIC-NEXT:  # %bb.1: # %if.end
    152 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, -16
    153 ; SHRINK-WRAP-64-PIC-NEXT:    .cfi_def_cfa_offset 16
    154 ; SHRINK-WRAP-64-PIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    155 ; SHRINK-WRAP-64-PIC-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
    156 ; SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 31, -8
    157 ; SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 28, -16
    158 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $gp, $2, %lo(%neg(%gp_rel(foo)))
    159 ; SHRINK-WRAP-64-PIC-NEXT:    ld $25, %call16(f)($gp)
    160 ; SHRINK-WRAP-64-PIC-NEXT:    jalr $25
    161 ; SHRINK-WRAP-64-PIC-NEXT:    addiu $4, $4, 1
    162 ; SHRINK-WRAP-64-PIC-NEXT:    ld $gp, 0($sp) # 8-byte Folded Reload
    163 ; SHRINK-WRAP-64-PIC-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
    164 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, 16
    165 ; SHRINK-WRAP-64-PIC-NEXT:  .LBB0_2: # %return
    166 ; SHRINK-WRAP-64-PIC-NEXT:    jr $ra
    167 ; SHRINK-WRAP-64-PIC-NEXT:    addiu $2, $zero, 0
    168 ;
    169 ; NO-SHRINK-WRAP-64-PIC-LABEL: foo:
    170 ; NO-SHRINK-WRAP-64-PIC:       # %bb.0: # %entry
    171 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, -16
    172 ; NO-SHRINK-WRAP-64-PIC-NEXT:    .cfi_def_cfa_offset 16
    173 ; NO-SHRINK-WRAP-64-PIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    174 ; NO-SHRINK-WRAP-64-PIC-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
    175 ; NO-SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 31, -8
    176 ; NO-SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 28, -16
    177 ; NO-SHRINK-WRAP-64-PIC-NEXT:    lui $1, %hi(%neg(%gp_rel(foo)))
    178 ; NO-SHRINK-WRAP-64-PIC-NEXT:    beqz $4, .LBB0_2
    179 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddu $2, $1, $25
    180 ; NO-SHRINK-WRAP-64-PIC-NEXT:  # %bb.1: # %if.end
    181 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $gp, $2, %lo(%neg(%gp_rel(foo)))
    182 ; NO-SHRINK-WRAP-64-PIC-NEXT:    ld $25, %call16(f)($gp)
    183 ; NO-SHRINK-WRAP-64-PIC-NEXT:    jalr $25
    184 ; NO-SHRINK-WRAP-64-PIC-NEXT:    addiu $4, $4, 1
    185 ; NO-SHRINK-WRAP-64-PIC-NEXT:  .LBB0_2: # %return
    186 ; NO-SHRINK-WRAP-64-PIC-NEXT:    addiu $2, $zero, 0
    187 ; NO-SHRINK-WRAP-64-PIC-NEXT:    ld $gp, 0($sp) # 8-byte Folded Reload
    188 ; NO-SHRINK-WRAP-64-PIC-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
    189 ; NO-SHRINK-WRAP-64-PIC-NEXT:    jr $ra
    190 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, 16
    191 entry:
    192   %cmp = icmp eq i32 %a, 0
    193   br i1 %cmp, label %return, label %if.end
    194 
    195 if.end:
    196   %add = add nsw i32 %a, 1
    197   tail call void @f(i32 signext %add)
    198   br label %return
    199 
    200 return:
    201   ret i32 0
    202 }
    203 
    204 ; Test that long branch expansion works correctly with shrink-wrapping enabled.
    205 define i32 @foo2(i32 signext %a) {
    206 ; SHRINK-WRAP-STATIC-LABEL: foo2:
    207 ; SHRINK-WRAP-STATIC:       # %bb.0:
    208 ; SHRINK-WRAP-STATIC-NEXT:    addiu $1, $zero, 4
    209 ; SHRINK-WRAP-STATIC-NEXT:    bne $4, $1, $BB1_2
    210 ; SHRINK-WRAP-STATIC-NEXT:    nop
    211 ; SHRINK-WRAP-STATIC-NEXT:  # %bb.1:
    212 ; SHRINK-WRAP-STATIC-NEXT:    j $BB1_3
    213 ; SHRINK-WRAP-STATIC-NEXT:    nop
    214 ; SHRINK-WRAP-STATIC-NEXT:  $BB1_2: # %if.then
    215 ; SHRINK-WRAP-STATIC-NEXT:    addiu $sp, $sp, -24
    216 ; SHRINK-WRAP-STATIC-NEXT:    .cfi_def_cfa_offset 24
    217 ; SHRINK-WRAP-STATIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
    218 ; SHRINK-WRAP-STATIC-NEXT:    .cfi_offset 31, -4
    219 ; SHRINK-WRAP-STATIC-NEXT:    #APP
    220 ;
    221 ; NO-SHRINK-WRAP-STATIC-LABEL: foo2:
    222 ; NO-SHRINK-WRAP-STATIC:       # %bb.0:
    223 ; NO-SHRINK-WRAP-STATIC-NEXT:    addiu $sp, $sp, -24
    224 ; NO-SHRINK-WRAP-STATIC-NEXT:    .cfi_def_cfa_offset 24
    225 ; NO-SHRINK-WRAP-STATIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
    226 ; NO-SHRINK-WRAP-STATIC-NEXT:    .cfi_offset 31, -4
    227 ; NO-SHRINK-WRAP-STATIC-NEXT:    addiu $1, $zero, 4
    228 ; NO-SHRINK-WRAP-STATIC-NEXT:    bne $4, $1, $BB1_2
    229 ; NO-SHRINK-WRAP-STATIC-NEXT:    nop
    230 ; NO-SHRINK-WRAP-STATIC-NEXT:  # %bb.1:
    231 ; NO-SHRINK-WRAP-STATIC-NEXT:    j $BB1_3
    232 ; NO-SHRINK-WRAP-STATIC-NEXT:    nop
    233 ; NO-SHRINK-WRAP-STATIC-NEXT:  $BB1_2: # %if.then
    234 ; NO-SHRINK-WRAP-STATIC-NEXT:    #APP
    235 ;
    236 ; SHRINK-WRAP-PIC-LABEL: foo2:
    237 ; SHRINK-WRAP-PIC:       # %bb.0:
    238 ; SHRINK-WRAP-PIC-NEXT:    lui $2, %hi(_gp_disp)
    239 ; SHRINK-WRAP-PIC-NEXT:    addiu $2, $2, %lo(_gp_disp)
    240 ; SHRINK-WRAP-PIC-NEXT:    addiu $1, $zero, 4
    241 ; SHRINK-WRAP-PIC-NEXT:    bne $4, $1, $BB1_3
    242 ; SHRINK-WRAP-PIC-NEXT:    addu $gp, $2, $25
    243 ; SHRINK-WRAP-PIC-NEXT:  # %bb.1:
    244 ; SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, -8
    245 ; SHRINK-WRAP-PIC-NEXT:    sw $ra, 0($sp)
    246 ; SHRINK-WRAP-PIC-NEXT:    lui $1, %hi(($BB1_4)-($BB1_2))
    247 ; SHRINK-WRAP-PIC-NEXT:    bal $BB1_2
    248 ; SHRINK-WRAP-PIC-NEXT:    addiu $1, $1, %lo(($BB1_4)-($BB1_2))
    249 ; SHRINK-WRAP-PIC-NEXT:  $BB1_2:
    250 ; SHRINK-WRAP-PIC-NEXT:    addu $1, $ra, $1
    251 ; SHRINK-WRAP-PIC-NEXT:    lw $ra, 0($sp)
    252 ; SHRINK-WRAP-PIC-NEXT:    jr $1
    253 ; SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, 8
    254 ; SHRINK-WRAP-PIC-NEXT:  $BB1_3: # %if.then
    255 ; SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, -24
    256 ; SHRINK-WRAP-PIC-NEXT:    .cfi_def_cfa_offset 24
    257 ; SHRINK-WRAP-PIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
    258 ; SHRINK-WRAP-PIC-NEXT:    .cfi_offset 31, -4
    259 ; SHRINK-WRAP-PIC-NEXT:    #APP
    260 ;
    261 ; NO-SHRINK-WRAP-PIC-LABEL: foo2:
    262 ; NO-SHRINK-WRAP-PIC:       # %bb.0:
    263 ; NO-SHRINK-WRAP-PIC-NEXT:    lui $2, %hi(_gp_disp)
    264 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $2, $2, %lo(_gp_disp)
    265 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, -24
    266 ; NO-SHRINK-WRAP-PIC-NEXT:    .cfi_def_cfa_offset 24
    267 ; NO-SHRINK-WRAP-PIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
    268 ; NO-SHRINK-WRAP-PIC-NEXT:    .cfi_offset 31, -4
    269 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $1, $zero, 4
    270 ; NO-SHRINK-WRAP-PIC-NEXT:    bne $4, $1, $BB1_3
    271 ; NO-SHRINK-WRAP-PIC-NEXT:    addu $gp, $2, $25
    272 ; NO-SHRINK-WRAP-PIC-NEXT:  # %bb.1:
    273 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, -8
    274 ; NO-SHRINK-WRAP-PIC-NEXT:    sw $ra, 0($sp)
    275 ; NO-SHRINK-WRAP-PIC-NEXT:    lui $1, %hi(($BB1_4)-($BB1_2))
    276 ; NO-SHRINK-WRAP-PIC-NEXT:    bal $BB1_2
    277 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $1, $1, %lo(($BB1_4)-($BB1_2))
    278 ; NO-SHRINK-WRAP-PIC-NEXT:  $BB1_2:
    279 ; NO-SHRINK-WRAP-PIC-NEXT:    addu $1, $ra, $1
    280 ; NO-SHRINK-WRAP-PIC-NEXT:    lw $ra, 0($sp)
    281 ; NO-SHRINK-WRAP-PIC-NEXT:    jr $1
    282 ; NO-SHRINK-WRAP-PIC-NEXT:    addiu $sp, $sp, 8
    283 ; NO-SHRINK-WRAP-PIC-NEXT:  $BB1_3: # %if.then
    284 ; NO-SHRINK-WRAP-PIC-NEXT:    #APP
    285 ;
    286 ; SHRINK-WRAP-64-STATIC-LABEL: foo2:
    287 ; SHRINK-WRAP-64-STATIC:       # %bb.0:
    288 ; SHRINK-WRAP-64-STATIC-NEXT:    addiu $1, $zero, 4
    289 ; SHRINK-WRAP-64-STATIC-NEXT:    bne $4, $1, .LBB1_2
    290 ; SHRINK-WRAP-64-STATIC-NEXT:    nop
    291 ; SHRINK-WRAP-64-STATIC-NEXT:  # %bb.1:
    292 ; SHRINK-WRAP-64-STATIC-NEXT:    j .LBB1_3
    293 ; SHRINK-WRAP-64-STATIC-NEXT:    nop
    294 ; SHRINK-WRAP-64-STATIC-NEXT:  .LBB1_2: # %if.then
    295 ; SHRINK-WRAP-64-STATIC-NEXT:    daddiu $sp, $sp, -16
    296 ; SHRINK-WRAP-64-STATIC-NEXT:    .cfi_def_cfa_offset 16
    297 ; SHRINK-WRAP-64-STATIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    298 ; SHRINK-WRAP-64-STATIC-NEXT:    .cfi_offset 31, -8
    299 ; SHRINK-WRAP-64-STATIC-NEXT:    sll $4, $4, 0
    300 ; SHRINK-WRAP-64-STATIC-NEXT:    #APP
    301 ;
    302 ; NO-SHRINK-WRAP-64-STATIC-LABEL: foo2:
    303 ; NO-SHRINK-WRAP-64-STATIC:       # %bb.0:
    304 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    daddiu $sp, $sp, -16
    305 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    .cfi_def_cfa_offset 16
    306 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    307 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    .cfi_offset 31, -8
    308 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    addiu $1, $zero, 4
    309 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    bne $4, $1, .LBB1_2
    310 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    nop
    311 ; NO-SHRINK-WRAP-64-STATIC-NEXT:  # %bb.1:
    312 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    j .LBB1_3
    313 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    nop
    314 ; NO-SHRINK-WRAP-64-STATIC-NEXT:  .LBB1_2: # %if.then
    315 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    sll $4, $4, 0
    316 ; NO-SHRINK-WRAP-64-STATIC-NEXT:    #APP
    317 ;
    318 ; SHRINK-WRAP-64-PIC-LABEL: foo2:
    319 ; SHRINK-WRAP-64-PIC:       # %bb.0:
    320 ; SHRINK-WRAP-64-PIC-NEXT:    lui $1, %hi(%neg(%gp_rel(foo2)))
    321 ; SHRINK-WRAP-64-PIC-NEXT:    daddu $2, $1, $25
    322 ; SHRINK-WRAP-64-PIC-NEXT:    addiu $1, $zero, 4
    323 ; SHRINK-WRAP-64-PIC-NEXT:    bne $4, $1, .LBB1_3
    324 ; SHRINK-WRAP-64-PIC-NEXT:    nop
    325 ; SHRINK-WRAP-64-PIC-NEXT:  # %bb.1:
    326 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, -16
    327 ; SHRINK-WRAP-64-PIC-NEXT:    sd $ra, 0($sp)
    328 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $1, $zero, %hi(.LBB1_4-.LBB1_2)
    329 ; SHRINK-WRAP-64-PIC-NEXT:    dsll $1, $1, 16
    330 ; SHRINK-WRAP-64-PIC-NEXT:    bal .LBB1_2
    331 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $1, $1, %lo(.LBB1_4-.LBB1_2)
    332 ; SHRINK-WRAP-64-PIC-NEXT:  .LBB1_2:
    333 ; SHRINK-WRAP-64-PIC-NEXT:    daddu $1, $ra, $1
    334 ; SHRINK-WRAP-64-PIC-NEXT:    ld $ra, 0($sp)
    335 ; SHRINK-WRAP-64-PIC-NEXT:    jr $1
    336 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, 16
    337 ; SHRINK-WRAP-64-PIC-NEXT:  .LBB1_3: # %if.then
    338 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, -16
    339 ; SHRINK-WRAP-64-PIC-NEXT:    .cfi_def_cfa_offset 16
    340 ; SHRINK-WRAP-64-PIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    341 ; SHRINK-WRAP-64-PIC-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
    342 ; SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 31, -8
    343 ; SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 28, -16
    344 ; SHRINK-WRAP-64-PIC-NEXT:    daddiu $gp, $2, %lo(%neg(%gp_rel(foo2)))
    345 ; SHRINK-WRAP-64-PIC-NEXT:    sll $4, $4, 0
    346 ; SHRINK-WRAP-64-PIC-NEXT:    #APP
    347 ;
    348 ; NO-SHRINK-WRAP-64-PIC-LABEL: foo2:
    349 ; NO-SHRINK-WRAP-64-PIC:       # %bb.0:
    350 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, -16
    351 ; NO-SHRINK-WRAP-64-PIC-NEXT:    .cfi_def_cfa_offset 16
    352 ; NO-SHRINK-WRAP-64-PIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
    353 ; NO-SHRINK-WRAP-64-PIC-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
    354 ; NO-SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 31, -8
    355 ; NO-SHRINK-WRAP-64-PIC-NEXT:    .cfi_offset 28, -16
    356 ; NO-SHRINK-WRAP-64-PIC-NEXT:    lui $1, %hi(%neg(%gp_rel(foo2)))
    357 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddu $2, $1, $25
    358 ; NO-SHRINK-WRAP-64-PIC-NEXT:    addiu $1, $zero, 4
    359 ; NO-SHRINK-WRAP-64-PIC-NEXT:    bne $4, $1, .LBB1_3
    360 ; NO-SHRINK-WRAP-64-PIC-NEXT:    nop
    361 ; NO-SHRINK-WRAP-64-PIC-NEXT:  # %bb.1:
    362 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, -16
    363 ; NO-SHRINK-WRAP-64-PIC-NEXT:    sd $ra, 0($sp)
    364 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $1, $zero, %hi(.LBB1_4-.LBB1_2)
    365 ; NO-SHRINK-WRAP-64-PIC-NEXT:    dsll $1, $1, 16
    366 ; NO-SHRINK-WRAP-64-PIC-NEXT:    bal .LBB1_2
    367 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $1, $1, %lo(.LBB1_4-.LBB1_2)
    368 ; NO-SHRINK-WRAP-64-PIC-NEXT:  .LBB1_2:
    369 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddu $1, $ra, $1
    370 ; NO-SHRINK-WRAP-64-PIC-NEXT:    ld $ra, 0($sp)
    371 ; NO-SHRINK-WRAP-64-PIC-NEXT:    jr $1
    372 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $sp, $sp, 16
    373 ; NO-SHRINK-WRAP-64-PIC-NEXT:  .LBB1_3: # %if.then
    374 ; NO-SHRINK-WRAP-64-PIC-NEXT:    daddiu $gp, $2, %lo(%neg(%gp_rel(foo2)))
    375 ; NO-SHRINK-WRAP-64-PIC-NEXT:    sll $4, $4, 0
    376 ; NO-SHRINK-WRAP-64-PIC-NEXT:    #APP
    377   %1 = icmp ne i32 %a, 4
    378   br i1 %1, label %if.then, label %if.end
    379 
    380 if.then:
    381   call void asm sideeffect ".space 1048576", "~{$1}"()
    382   call void @f(i32 signext %a)
    383   br label %if.end
    384 
    385 if.end:
    386   ret i32 0
    387 }
    388