# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv64 -run-pass=regbankselect \
# RUN: -disable-gisel-legality-check -simplify-mir -verify-machineinstrs %s \
# RUN: -o - | FileCheck -check-prefix=RV64I %s
---
name: load_i8
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: load_i8
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[LOAD]](s32)
; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%3:_(s32) = G_LOAD %0(p0) :: (load (s8))
%2:_(s64) = G_ANYEXT %3(s32)
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: load_i16
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: load_i16
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s32) = G_LOAD [[COPY]](p0) :: (load (s16))
; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[LOAD]](s32)
; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%3:_(s32) = G_LOAD %0(p0) :: (load (s16))
%2:_(s64) = G_ANYEXT %3(s32)
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: load_i32
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: load_i32
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[LOAD]](s32)
; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%1:_(s32) = G_LOAD %0(p0) :: (load (s32))
%2:_(s64) = G_ANYEXT %1(s32)
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: load_i64
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: load_i64
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s64) = G_LOAD [[COPY]](p0) :: (load (s64))
; RV64I-NEXT: $x10 = COPY [[LOAD]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%1:_(s64) = G_LOAD %0(p0) :: (load (s64))
$x10 = COPY %1(s64)
PseudoRET implicit $x10
...
---
name: load_ptr
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: load_ptr
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(p0) = G_LOAD [[COPY]](p0) :: (load (p0))
; RV64I-NEXT: $x10 = COPY [[LOAD]](p0)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%1:_(p0) = G_LOAD %0(p0) :: (load (p0))
$x10 = COPY %1(p0)
PseudoRET implicit $x10
...
---
name: zextload_i8
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
%0:_(p0) = COPY $x10
%3:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s8))
%2:_(s64) = G_ANYEXT %3(s32)
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: zextload_i16
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: zextload_i16
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[ZEXTLOAD:%[0-9]+]]:gprb(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s16))
; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[ZEXTLOAD]](s32)
; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%3:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s16))
%2:_(s64) = G_ANYEXT %3(s32)
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: zextload_i32
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: zextload_i32
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[ZEXTLOAD:%[0-9]+]]:gprb(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s32))
; RV64I-NEXT: $x10 = COPY [[ZEXTLOAD]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%1:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s32))
$x10 = COPY %1(s64)
PseudoRET implicit $x10
...
---
name: sextload_i8
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
%0:_(p0) = COPY $x10
%3:_(s32) = G_SEXTLOAD %0(p0) :: (load (s8))
%2:_(s64) = G_ANYEXT %3(s32)
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: sextload_i16
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: sextload_i16
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[SEXTLOAD:%[0-9]+]]:gprb(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[SEXTLOAD]](s32)
; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%3:_(s32) = G_SEXTLOAD %0(p0) :: (load (s16))
%2:_(s64) = G_ANYEXT %3(s32)
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: sextload_i32
legalized: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; RV64I-LABEL: name: sextload_i32
; RV64I: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
; RV64I-NEXT: [[SEXTLOAD:%[0-9]+]]:gprb(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s32))
; RV64I-NEXT: $x10 = COPY [[SEXTLOAD]](s64)
; RV64I-NEXT: PseudoRET implicit $x10
%0:_(p0) = COPY $x10
%1:_(s64) = G_SEXTLOAD %0(p0) :: (load (s32))
$x10 = COPY %1(s64)
PseudoRET implicit $x10
...