264 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=i386-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL3 4--- |5 define i8 @test_load_i8(ptr %p1) {6 %r = load i8, ptr %p17 ret i8 %r8 }9 10 define i16 @test_load_i16(ptr %p1) {11 %r = load i16, ptr %p112 ret i16 %r13 }14 15 define i32 @test_load_i32(ptr %p1) {16 %r = load i32, ptr %p117 ret i32 %r18 }19 20 define ptr @test_store_i8(i8 %val, ptr %p1) {21 store i8 %val, ptr %p122 ret ptr %p123 }24 25 define ptr @test_store_i16(i16 %val, ptr %p1) {26 store i16 %val, ptr %p127 ret ptr %p128 }29 30 define ptr @test_store_i32(i32 %val, ptr %p1) {31 store i32 %val, ptr %p132 ret ptr %p133 }34 35 define ptr @test_load_ptr(ptr %ptr1) {36 %p = load ptr, ptr %ptr137 ret ptr %p38 }39 40 define void @test_store_ptr(ptr %ptr1, ptr %a) {41 store ptr %a, ptr %ptr142 ret void43 }44 45...46---47name: test_load_i848alignment: 1649legalized: true50regBankSelected: true51registers:52 - { id: 0, class: gpr }53 - { id: 1, class: gpr }54 - { id: 2, class: gpr }55fixedStack:56 - { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }57body: |58 bb.1 (%ir-block.0):59 ; ALL-LABEL: name: test_load_i860 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.0, align 16)61 ; ALL: [[MOV8rm:%[0-9]+]]:gr8 = MOV8rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load (s8) from %ir.p1)62 ; ALL: $al = COPY [[MOV8rm]]63 ; ALL: RET 0, implicit $al64 %1(p0) = G_FRAME_INDEX %fixed-stack.065 %0(p0) = G_LOAD %1(p0) :: (invariant load (p0) from %fixed-stack.0, align 16)66 %2(s8) = G_LOAD %0(p0) :: (load (s8) from %ir.p1)67 $al = COPY %2(s8)68 RET 0, implicit $al69 70...71---72name: test_load_i1673alignment: 1674legalized: true75regBankSelected: true76registers:77 - { id: 0, class: gpr }78 - { id: 1, class: gpr }79 - { id: 2, class: gpr }80fixedStack:81 - { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }82body: |83 bb.1 (%ir-block.0):84 ; ALL-LABEL: name: test_load_i1685 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.0, align 16)86 ; ALL: [[MOV16rm:%[0-9]+]]:gr16 = MOV16rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load (s16) from %ir.p1)87 ; ALL: $ax = COPY [[MOV16rm]]88 ; ALL: RET 0, implicit $ax89 %1(p0) = G_FRAME_INDEX %fixed-stack.090 %0(p0) = G_LOAD %1(p0) :: (invariant load (p0) from %fixed-stack.0, align 16)91 %2(s16) = G_LOAD %0(p0) :: (load (s16) from %ir.p1)92 $ax = COPY %2(s16)93 RET 0, implicit $ax94 95...96---97name: test_load_i3298alignment: 1699legalized: true100regBankSelected: true101registers:102 - { id: 0, class: gpr }103 - { id: 1, class: gpr }104 - { id: 2, class: gpr }105fixedStack:106 - { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }107body: |108 bb.1 (%ir-block.0):109 ; ALL-LABEL: name: test_load_i32110 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.0, align 16)111 ; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load (s32) from %ir.p1)112 ; ALL: $eax = COPY [[MOV32rm1]]113 ; ALL: RET 0, implicit $eax114 %1(p0) = G_FRAME_INDEX %fixed-stack.0115 %0(p0) = G_LOAD %1(p0) :: (invariant load (p0) from %fixed-stack.0, align 16)116 %2(s32) = G_LOAD %0(p0) :: (load (s32) from %ir.p1)117 $eax = COPY %2(s32)118 RET 0, implicit $eax119 120...121---122name: test_store_i8123alignment: 16124legalized: true125regBankSelected: true126registers:127 - { id: 0, class: gpr }128 - { id: 1, class: gpr }129 - { id: 2, class: gpr }130 - { id: 3, class: gpr }131fixedStack:132 - { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }133 - { id: 1, offset: 0, size: 1, alignment: 16, isImmutable: true, isAliased: false }134body: |135 bb.1 (%ir-block.0):136 ; ALL-LABEL: name: test_store_i8137 ; ALL: [[MOV8rm:%[0-9]+]]:gr8 = MOV8rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (s8) from %fixed-stack.0, align 16)138 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.1)139 ; ALL: MOV8mr [[MOV32rm]], 1, $noreg, 0, $noreg, [[MOV8rm]] :: (store (s8) into %ir.p1)140 ; ALL: $eax = COPY [[MOV32rm]]141 ; ALL: RET 0, implicit $eax142 %2(p0) = G_FRAME_INDEX %fixed-stack.1143 %0(s8) = G_LOAD %2(p0) :: (invariant load (s8) from %fixed-stack.1, align 16)144 %3(p0) = G_FRAME_INDEX %fixed-stack.0145 %1(p0) = G_LOAD %3(p0) :: (invariant load (p0) from %fixed-stack.0, align 4)146 G_STORE %0(s8), %1(p0) :: (store (s8) into %ir.p1)147 $eax = COPY %1(p0)148 RET 0, implicit $eax149 150...151---152name: test_store_i16153alignment: 16154legalized: true155regBankSelected: true156registers:157 - { id: 0, class: gpr }158 - { id: 1, class: gpr }159 - { id: 2, class: gpr }160 - { id: 3, class: gpr }161fixedStack:162 - { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }163 - { id: 1, offset: 0, size: 2, alignment: 16, isImmutable: true, isAliased: false }164body: |165 bb.1 (%ir-block.0):166 ; ALL-LABEL: name: test_store_i16167 ; ALL: [[MOV16rm:%[0-9]+]]:gr16 = MOV16rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (s16) from %fixed-stack.0, align 16)168 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.1)169 ; ALL: MOV16mr [[MOV32rm]], 1, $noreg, 0, $noreg, [[MOV16rm]] :: (store (s16) into %ir.p1)170 ; ALL: $eax = COPY [[MOV32rm]]171 ; ALL: RET 0, implicit $eax172 %2(p0) = G_FRAME_INDEX %fixed-stack.1173 %0(s16) = G_LOAD %2(p0) :: (invariant load (s16) from %fixed-stack.1, align 16)174 %3(p0) = G_FRAME_INDEX %fixed-stack.0175 %1(p0) = G_LOAD %3(p0) :: (invariant load (p0) from %fixed-stack.0, align 4)176 G_STORE %0(s16), %1(p0) :: (store (s16) into %ir.p1)177 $eax = COPY %1(p0)178 RET 0, implicit $eax179 180...181---182name: test_store_i32183alignment: 16184legalized: true185regBankSelected: true186registers:187 - { id: 0, class: gpr }188 - { id: 1, class: gpr }189 - { id: 2, class: gpr }190 - { id: 3, class: gpr }191fixedStack:192 - { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }193 - { id: 1, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }194body: |195 bb.1 (%ir-block.0):196 ; ALL-LABEL: name: test_store_i32197 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (s32) from %fixed-stack.0, align 16)198 ; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.1)199 ; ALL: MOV32mr [[MOV32rm1]], 1, $noreg, 0, $noreg, [[MOV32rm]] :: (store (s32) into %ir.p1)200 ; ALL: $eax = COPY [[MOV32rm1]]201 ; ALL: RET 0, implicit $eax202 %2(p0) = G_FRAME_INDEX %fixed-stack.1203 %0(s32) = G_LOAD %2(p0) :: (invariant load (s32) from %fixed-stack.1, align 16)204 %3(p0) = G_FRAME_INDEX %fixed-stack.0205 %1(p0) = G_LOAD %3(p0) :: (invariant load (p0) from %fixed-stack.0, align 4)206 G_STORE %0(s32), %1(p0) :: (store (s32) into %ir.p1)207 $eax = COPY %1(p0)208 RET 0, implicit $eax209 210...211---212name: test_load_ptr213alignment: 16214legalized: true215regBankSelected: true216registers:217 - { id: 0, class: gpr }218 - { id: 1, class: gpr }219 - { id: 2, class: gpr }220fixedStack:221 - { id: 0, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }222body: |223 bb.1 (%ir-block.0):224 ; ALL-LABEL: name: test_load_ptr225 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.0, align 16)226 ; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm [[MOV32rm]], 1, $noreg, 0, $noreg :: (load (p0) from %ir.ptr1)227 ; ALL: $eax = COPY [[MOV32rm1]]228 ; ALL: RET 0, implicit $eax229 %1(p0) = G_FRAME_INDEX %fixed-stack.0230 %0(p0) = G_LOAD %1(p0) :: (invariant load (p0) from %fixed-stack.0, align 16)231 %2(p0) = G_LOAD %0(p0) :: (load (p0) from %ir.ptr1)232 $eax = COPY %2(p0)233 RET 0, implicit $eax234 235...236---237name: test_store_ptr238alignment: 16239legalized: true240regBankSelected: true241registers:242 - { id: 0, class: gpr }243 - { id: 1, class: gpr }244 - { id: 2, class: gpr }245 - { id: 3, class: gpr }246fixedStack:247 - { id: 0, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }248 - { id: 1, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }249body: |250 bb.1 (%ir-block.0):251 ; ALL-LABEL: name: test_store_ptr252 ; ALL: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.0, align 16)253 ; ALL: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load (p0) from %fixed-stack.1)254 ; ALL: MOV32mr [[MOV32rm]], 1, $noreg, 0, $noreg, [[MOV32rm1]] :: (store (p0) into %ir.ptr1)255 ; ALL: RET 0256 %2(p0) = G_FRAME_INDEX %fixed-stack.1257 %0(p0) = G_LOAD %2(p0) :: (invariant load (p0) from %fixed-stack.1, align 16)258 %3(p0) = G_FRAME_INDEX %fixed-stack.0259 %1(p0) = G_LOAD %3(p0) :: (invariant load (p0) from %fixed-stack.0, align 4)260 G_STORE %1(p0), %0(p0) :: (store (p0) into %ir.ptr1)261 RET 0262 263...264