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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
# RUN: | FileCheck --check-prefix=RV32 %s
---
name: merge_i32
body: |
bb.0.entry:
liveins: $x10
; RV32-LABEL: name: merge_i32
; RV32: liveins: $x10
; RV32-NEXT: {{ $}}
; RV32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
; RV32-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY]], 16
; RV32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
; RV32-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[ASSERT_ZEXT]], [[C]](s32)
; RV32-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[ASSERT_ZEXT]], [[SHL]]
; RV32-NEXT: $x10 = COPY [[OR]](s32)
; RV32-NEXT: PseudoRET implicit $x10
%0:_(s32) = COPY $x10
%1:_(s32) = G_ASSERT_ZEXT %0, 16
%2:_(s16) = G_TRUNC %1(s32)
%3:_(s32) = G_MERGE_VALUES %2(s16), %2(s16)
$x10 = COPY %3(s32)
PseudoRET implicit $x10
...
---
name: merge_i64
body: |
bb.0.entry:
liveins: $x10
; RV32-LABEL: name: merge_i64
; RV32: liveins: $x10
; RV32-NEXT: {{ $}}
; RV32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
; RV32-NEXT: $x10 = COPY [[COPY]](s32)
; RV32-NEXT: PseudoRET implicit $x10
%0:_(s32) = COPY $x10
%1:_(s64) = G_MERGE_VALUES %0(s32), %0(s32)
%2:_(s32) = G_TRUNC %1(s64)
$x10 = COPY %2(s32)
PseudoRET implicit $x10
...
---
name: merge_i128
body: |
bb.0.entry:
liveins: $x10
; RV32-LABEL: name: merge_i128
; RV32: liveins: $x10
; RV32-NEXT: {{ $}}
; RV32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
; RV32-NEXT: $x10 = COPY [[COPY]](s32)
; RV32-NEXT: PseudoRET implicit $x10
%1:_(s32) = COPY $x10
%2:_(s64) = G_ZEXT %1(s32)
%0:_(s128) = G_MERGE_VALUES %2(s64), %2(s64)
%3:_(s32) = G_TRUNC %0(s128)
$x10 = COPY %3(s32)
PseudoRET implicit $x10
...
---
name: unmerge_i32
body: |
bb.0.entry:
liveins: $x10
; RV32-LABEL: name: unmerge_i32
; RV32: liveins: $x10
; RV32-NEXT: {{ $}}
; RV32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
; RV32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
; RV32-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
; RV32-NEXT: $x10 = COPY [[AND]](s32)
; RV32-NEXT: PseudoRET implicit $x10
%0:_(s32) = COPY $x10
%2:_(s16), %3:_(s16) = G_UNMERGE_VALUES %0(s32)
%4:_(s32) = G_ZEXT %2(s16)
$x10 = COPY %4(s32)
PseudoRET implicit $x10
...
---
name: unmerge_i64
body: |
bb.0.entry:
liveins: $x10
; RV32-LABEL: name: unmerge_i64
; RV32: liveins: $x10
; RV32-NEXT: {{ $}}
; RV32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
; RV32-NEXT: $x10 = COPY [[COPY]](s32)
; RV32-NEXT: PseudoRET implicit $x10
%0:_(s32) = COPY $x10
%1:_(s64) = G_ZEXT %0(s32)
%2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %1(s64)
$x10 = COPY %2(s32)
PseudoRET implicit $x10
...
---
name: unmerge_i128
body: |
bb.0.entry:
liveins: $x10
; RV32-LABEL: name: unmerge_i128
; RV32: liveins: $x10
; RV32-NEXT: {{ $}}
; RV32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
; RV32-NEXT: $x10 = COPY [[C]](s32)
; RV32-NEXT: PseudoRET implicit $x10
%0:_(s32) = COPY $x10
%1:_(s128) = G_ZEXT %0(s32)
%2:_(s64), %3:_(s64) = G_UNMERGE_VALUES %1(s128)
%4:_(s32) = G_TRUNC %3(s64)
$x10 = COPY %4(s32)
PseudoRET implicit $x10
...
---
name: unmerge_i256
body: |
bb.0.entry:
liveins: $x10
; RV32-LABEL: name: unmerge_i256
; RV32: liveins: $x10
; RV32-NEXT: {{ $}}
; RV32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
; RV32-NEXT: $x10 = COPY [[COPY]](s32)
; RV32-NEXT: PseudoRET implicit $x10
%0:_(s32) = COPY $x10
%1:_(s256) = G_ZEXT %0(s32)
%2:_(s128), %3:_(s128) = G_UNMERGE_VALUES %1(s256)
%4:_(s32) = G_TRUNC %2(s128)
$x10 = COPY %4(s32)
PseudoRET implicit $x10
...
|