brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 43b2803 Raw
85 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS323--- |4 5  declare i32 @puts(ptr)6  declare void @llvm.memset.p0.i32(ptr, i8, i32, i1)7 8  define void @Print_c_N_times(i8 %c, i32 %N) {9  entry:10    %add = add i32 %N, 111    %vla = alloca i8, i32 %add, align 112    call void @llvm.memset.p0.i32(ptr align 1 %vla, i8 %c, i32 %N, i1 false)13    %arrayidx = getelementptr inbounds i8, ptr %vla, i32 %N14    store i8 0, ptr %arrayidx, align 115    %call = call i32 @puts(ptr %vla)16    ret void17  }18 19...20---21name:            Print_c_N_times22alignment:       423tracksRegLiveness: true24stack:25  - { id: 0, name: vla, type: variable-sized, alignment: 1 }26body:             |27  bb.1.entry:28    liveins: $a0, $a129 30    ; MIPS32-LABEL: name: Print_c_N_times31    ; MIPS32: liveins: $a0, $a132    ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a033    ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a134    ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 135    ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 036    ; MIPS32: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[C]]37    ; MIPS32: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[ADD]], [[C]]38    ; MIPS32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 739    ; MIPS32: [[ADD1:%[0-9]+]]:_(s32) = nuw G_ADD [[MUL]], [[C2]]40    ; MIPS32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 -841    ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD1]], [[C3]]42    ; MIPS32: [[COPY2:%[0-9]+]]:_(p0) = COPY $sp43    ; MIPS32: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY2]](p0)44    ; MIPS32: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[PTRTOINT]], [[AND]]45    ; MIPS32: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[SUB]](s32)46    ; MIPS32: $sp = COPY [[INTTOPTR]](p0)47    ; MIPS32: [[COPY3:%[0-9]+]]:_(p0) = COPY [[INTTOPTR]](p0)48    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp49    ; MIPS32: $a0 = COPY [[COPY3]](p0)50    ; MIPS32: $a1 = COPY [[COPY]](s32)51    ; MIPS32: $a2 = COPY [[COPY1]](s32)52    ; MIPS32: JAL &memset, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1, implicit $a253    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp54    ; MIPS32: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY3]], [[COPY1]](s32)55    ; MIPS32: [[COPY4:%[0-9]+]]:_(p0) = COPY [[PTR_ADD]](p0)56    ; MIPS32: G_STORE [[C1]](s32), [[COPY4]](p0) :: (store (s8) into %ir.arrayidx)57    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp58    ; MIPS32: $a0 = COPY [[COPY3]](p0)59    ; MIPS32: JAL @puts, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $v060    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp61    ; MIPS32: RetRA62    %2:_(s32) = COPY $a063    %0:_(s8) = G_TRUNC %2(s32)64    %1:_(s32) = COPY $a165    %3:_(s32) = G_CONSTANT i32 166    %13:_(s8) = G_CONSTANT i8 067    %4:_(s32) = G_ADD %1, %368    %5:_(s32) = G_MUL %4, %369    %6:_(s32) = G_CONSTANT i32 770    %7:_(s32) = nuw G_ADD %5, %671    %8:_(s32) = G_CONSTANT i32 -872    %9:_(s32) = G_AND %7, %873    %10:_(p0) = G_DYN_STACKALLOC %9(s32), 074    G_MEMSET %10(p0), %0(s8), %1(s32), 0 :: (store (s8) into %ir.vla)75    %11:_(p0) = G_PTR_ADD %10, %1(s32)76    %12:_(p0) = COPY %11(p0)77    G_STORE %13(s8), %12(p0) :: (store (s8) into %ir.arrayidx)78    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp79    $a0 = COPY %10(p0)80    JAL @puts, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $v081    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp82    RetRA83 84...85