reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    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
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
; RUN: llc -march=mipsel -mattr=+xgot \
; RUN:     -relocation-model=pic < %s | FileCheck %s -check-prefix=O32
; RUN: llc -march=mips64el -mcpu=mips64r2 -mattr=+xgot \
; RUN:     -relocation-model=pic < %s | FileCheck %s -check-prefix=N64
; RUN: llc -march=mipsel -mattr=+xgot -fast-isel \
; RUN:     -relocation-model=pic < %s | FileCheck %s -check-prefix=O32
; RUN: llc -march=mips64el -mcpu=mips64r2 -mattr=+xgot -fast-isel \
; RUN:     -relocation-model=pic < %s | FileCheck %s -check-prefix=N64

@v0 = external global i32

define void @foo1() nounwind {
entry:
; O32-LABEL: foo1:
; O32: lui $[[R0:[0-9]+]], %got_hi(v0)
; O32: addu  $[[R1:[0-9]+]], $[[R0]], ${{[a-z0-9]+}}
; O32: lw  ${{[0-9]+}}, %got_lo(v0)($[[R1]])
; O32: lui $[[R2:[0-9]+]], %call_hi(foo0)
; O32: addu  $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}
; O32: lw  ${{[0-9]+}}, %call_lo(foo0)($[[R3]])

; N64-LABEL: foo1:
; N64-DAG: lui $[[R0:[0-9]+]], %got_hi(v0)
; N64-DAG: daddu  $[[R1:[0-9]+]], $[[R0]], ${{[a-z0-9]+}}
; N64-DAG: lui $[[R2:[0-9]+]], %call_hi(foo0)
; N64-DAG: daddu  $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}
; N64-DAG: ld  ${{[0-9]+}}, %got_lo(v0)($[[R1]])
; N64-DAG: ld  ${{[0-9]+}}, %call_lo(foo0)($[[R3]])

  %0 = load i32, i32* @v0, align 4
  tail call void @foo0(i32 %0) nounwind
  ret void
}

declare void @foo0(i32)

; call to external function.

define void @foo2(i32* nocapture %d, i32* nocapture %s, i32 %n) nounwind {
entry:
; O32-LABEL: foo2:
; O32: lui $[[R2:[0-9]+]], %call_hi(memcpy)
; O32: addu  $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}
; O32: lw  ${{[0-9]+}}, %call_lo(memcpy)($[[R3]])

; N64-LABEL: foo2:
; N64: lui $[[R2:[0-9]+]], %call_hi(memcpy)
; N64: daddu  $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}
; N64: ld  ${{[0-9]+}}, %call_lo(memcpy)($[[R3]])

  %0 = bitcast i32* %d to i8*
  %1 = bitcast i32* %s to i8*
  tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %0, i8* align 4 %1, i32 %n, i1 false)
  ret void
}

declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind