gloal_address.mir 1.71 KB
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
--- |

  @.str = private unnamed_addr constant [11 x i8] c"hello %d \0A\00"

  define void @main() {entry: ret void}
  declare i32 @printf(i8*, ...)

...
---
name:            main
alignment:       4
legalized:       true
regBankSelected: true
tracksRegLiveness: true
body:             |
  bb.1.entry:
    ; MIPS32-LABEL: name: main
    ; MIPS32: [[LUi:%[0-9]+]]:gpr32 = LUi target-flags(mips-abs-hi) @.str
    ; MIPS32: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu [[LUi]], target-flags(mips-abs-lo) @.str
    ; MIPS32: [[LUi1:%[0-9]+]]:gpr32 = LUi 18838
    ; MIPS32: [[ORi:%[0-9]+]]:gpr32 = ORi [[LUi1]], 722
    ; MIPS32: [[ORi1:%[0-9]+]]:gpr32 = ORi $zero, 0
    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
    ; MIPS32: $a0 = COPY [[ADDiu]]
    ; MIPS32: $a1 = COPY [[ORi]]
    ; MIPS32: JAL @printf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $v0
    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
    ; MIPS32: $v0 = COPY [[ORi1]]
    ; MIPS32: RetRA implicit $v0
    %2:gprb(p0) = G_GLOBAL_VALUE @.str
    %1:gprb(p0) = COPY %2(p0)
    %3:gprb(s32) = G_CONSTANT i32 1234567890
    %4:gprb(s32) = G_CONSTANT i32 0
    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
    $a0 = COPY %1(p0)
    $a1 = COPY %3(s32)
    JAL @printf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit-def $v0
    %0:gprb(s32) = COPY $v0
    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
    $v0 = COPY %4(s32)
    RetRA implicit $v0

...