| # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py |
| # RUN: llc -O0 -mtriple=aarch64-apple-ios -run-pass=legalizer -global-isel %s -o - | FileCheck %s |
| |
| --- |
| name: test_scalar_or_small |
| registers: |
| - { id: 0, class: _ } |
| - { id: 1, class: _ } |
| - { id: 2, class: _ } |
| - { id: 3, class: _ } |
| - { id: 4, class: _ } |
| - { id: 5, class: _ } |
| body: | |
| bb.0: |
| liveins: %x0, %x1, %x2, %x3 |
| |
| ; CHECK-LABEL: name: test_scalar_or_small |
| ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY %x0 |
| ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY %x1 |
| ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) |
| ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64) |
| ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[TRUNC]], [[TRUNC1]] |
| ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[OR]](s32) |
| ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[TRUNC2]](s8) |
| ; CHECK: %x0 = COPY [[ANYEXT]](s64) |
| %0(s64) = COPY %x0 |
| %1(s64) = COPY %x1 |
| %2(s8) = G_TRUNC %0 |
| %3(s8) = G_TRUNC %1 |
| %4(s8) = G_OR %2, %3 |
| %5(s64) = G_ANYEXT %4 |
| %x0 = COPY %5 |
| ... |
| |
| --- |
| name: test_big_scalar_power_of_2 |
| registers: |
| - { id: 0, class: _ } |
| - { id: 1, class: _ } |
| - { id: 2, class: _ } |
| - { id: 3, class: _ } |
| - { id: 4, class: _ } |
| - { id: 5, class: _ } |
| - { id: 6, class: _ } |
| - { id: 7, class: _ } |
| - { id: 8, class: _ } |
| body: | |
| bb.0: |
| liveins: %x0, %x1, %x2, %x3 |
| ; We have a temporary G_MERGE_VALUES in the legalizer that gets |
| ; cleaned up with the G_UNMERGE_VALUES, so we end up directly |
| ; copying the results of the G_OR ops. |
| |
| ; CHECK-LABEL: name: test_big_scalar_power_of_2 |
| ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY %x0 |
| ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY %x1 |
| ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY %x2 |
| ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY %x3 |
| ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY2]] |
| ; CHECK: [[OR1:%[0-9]+]]:_(s64) = G_OR [[COPY1]], [[COPY3]] |
| ; CHECK: %x0 = COPY [[OR]](s64) |
| ; CHECK: %x1 = COPY [[OR1]](s64) |
| ; CHECK: RET_ReallyLR implicit %x0, implicit %x1 |
| %0(s64) = COPY %x0 |
| %1(s64) = COPY %x1 |
| %2(s64) = COPY %x2 |
| %3(s64) = COPY %x3 |
| %4(s128) = G_MERGE_VALUES %0, %1 |
| %5(s128) = G_MERGE_VALUES %2, %3 |
| %6(s128) = G_OR %4, %5 |
| %7(s64), %8(s64) = G_UNMERGE_VALUES %6 |
| %x0 = COPY %7 |
| %x1 = COPY %8 |
| RET_ReallyLR implicit %x0, implicit %x1 |
| ... |