forked from OSchip/llvm-project
170 lines
5.4 KiB
YAML
170 lines
5.4 KiB
YAML
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
|
# RUN: llc -march=amdgcn -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
|
|
|
|
---
|
|
name: fshl_i32
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
|
|
; CHECK-LABEL: name: fshl_i32
|
|
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %a:_(s32) = COPY $vgpr0
|
|
; CHECK-NEXT: %b:_(s32) = COPY $vgpr1
|
|
; CHECK-NEXT: %amt:_(s32) = COPY $vgpr2
|
|
; CHECK-NEXT: %or:_(s32) = G_FSHL %a, %b, %amt(s32)
|
|
; CHECK-NEXT: $vgpr3 = COPY %or(s32)
|
|
%a:_(s32) = COPY $vgpr0
|
|
%b:_(s32) = COPY $vgpr1
|
|
%amt:_(s32) = COPY $vgpr2
|
|
%bw:_(s32) = G_CONSTANT i32 32
|
|
%shl:_(s32) = G_SHL %a:_, %amt:_(s32)
|
|
%sub:_(s32) = G_SUB %bw:_, %amt:_
|
|
%lshr:_(s32) = G_LSHR %b:_, %sub:_(s32)
|
|
%or:_(s32) = G_OR %shl:_, %lshr:_
|
|
$vgpr3 = COPY %or
|
|
...
|
|
|
|
---
|
|
name: fshl_v2i32
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5, $vgpr6_vgpr7
|
|
|
|
; CHECK-LABEL: name: fshl_v2i32
|
|
; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5, $vgpr6_vgpr7
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %a:_(<2 x s32>) = COPY $vgpr0_vgpr1
|
|
; CHECK-NEXT: %b:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
|
; CHECK-NEXT: %amt:_(<2 x s32>) = COPY $vgpr4_vgpr5
|
|
; CHECK-NEXT: %or:_(<2 x s32>) = G_FSHL %a, %b, %amt(<2 x s32>)
|
|
; CHECK-NEXT: $vgpr6_vgpr7 = COPY %or(<2 x s32>)
|
|
%a:_(<2 x s32>) = COPY $vgpr0_vgpr1
|
|
%b:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
|
%amt:_(<2 x s32>) = COPY $vgpr4_vgpr5
|
|
%scalar_bw:_(s32) = G_CONSTANT i32 32
|
|
%bw:_(<2 x s32>) = G_BUILD_VECTOR %scalar_bw(s32), %scalar_bw(s32)
|
|
%shl:_(<2 x s32>) = G_SHL %a:_, %amt:_(<2 x s32>)
|
|
%sub:_(<2 x s32>) = G_SUB %bw:_, %amt:_
|
|
%lshr:_(<2 x s32>) = G_LSHR %b:_, %sub:_(<2 x s32>)
|
|
%or:_(<2 x s32>) = G_OR %shl:_, %lshr:_
|
|
$vgpr6_vgpr7 = COPY %or
|
|
...
|
|
|
|
---
|
|
name: fshl_commute_i32
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
|
|
; CHECK-LABEL: name: fshl_commute_i32
|
|
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %a:_(s32) = COPY $vgpr0
|
|
; CHECK-NEXT: %b:_(s32) = COPY $vgpr1
|
|
; CHECK-NEXT: %amt:_(s32) = COPY $vgpr2
|
|
; CHECK-NEXT: %or:_(s32) = G_FSHL %a, %b, %amt(s32)
|
|
; CHECK-NEXT: $vgpr3 = COPY %or(s32)
|
|
%a:_(s32) = COPY $vgpr0
|
|
%b:_(s32) = COPY $vgpr1
|
|
%amt:_(s32) = COPY $vgpr2
|
|
%bw:_(s32) = G_CONSTANT i32 32
|
|
%shl:_(s32) = G_SHL %a:_, %amt:_(s32)
|
|
%sub:_(s32) = G_SUB %bw:_, %amt:_
|
|
%lshr:_(s32) = G_LSHR %b:_, %sub:_(s32)
|
|
%or:_(s32) = G_OR %lshr:_, %shl:_
|
|
$vgpr3 = COPY %or
|
|
...
|
|
|
|
---
|
|
name: fshr_i32
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
|
|
; CHECK-LABEL: name: fshr_i32
|
|
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %a:_(s32) = COPY $vgpr0
|
|
; CHECK-NEXT: %b:_(s32) = COPY $vgpr1
|
|
; CHECK-NEXT: %amt:_(s32) = COPY $vgpr2
|
|
; CHECK-NEXT: %or:_(s32) = G_FSHR %a, %b, %amt(s32)
|
|
; CHECK-NEXT: $vgpr3 = COPY %or(s32)
|
|
%a:_(s32) = COPY $vgpr0
|
|
%b:_(s32) = COPY $vgpr1
|
|
%amt:_(s32) = COPY $vgpr2
|
|
%bw:_(s32) = G_CONSTANT i32 32
|
|
%lshr:_(s32) = G_LSHR %b:_, %amt:_(s32)
|
|
%sub:_(s32) = G_SUB %bw:_, %amt:_
|
|
%shl:_(s32) = G_SHL %a:_, %sub:_(s32)
|
|
%or:_(s32) = G_OR %shl:_, %lshr:_
|
|
$vgpr3 = COPY %or
|
|
...
|
|
|
|
---
|
|
name: fshl_i32_bad_const
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
|
|
; CHECK-LABEL: name: fshl_i32_bad_const
|
|
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %a:_(s32) = COPY $vgpr0
|
|
; CHECK-NEXT: %b:_(s32) = COPY $vgpr1
|
|
; CHECK-NEXT: %amt:_(s32) = COPY $vgpr2
|
|
; CHECK-NEXT: %bw:_(s32) = G_CONSTANT i32 31
|
|
; CHECK-NEXT: %shl:_(s32) = G_SHL %a, %amt(s32)
|
|
; CHECK-NEXT: %sub:_(s32) = G_SUB %bw, %amt
|
|
; CHECK-NEXT: %lshr:_(s32) = G_LSHR %b, %sub(s32)
|
|
; CHECK-NEXT: %or:_(s32) = G_OR %shl, %lshr
|
|
; CHECK-NEXT: $vgpr3 = COPY %or(s32)
|
|
%a:_(s32) = COPY $vgpr0
|
|
%b:_(s32) = COPY $vgpr1
|
|
%amt:_(s32) = COPY $vgpr2
|
|
%bw:_(s32) = G_CONSTANT i32 31
|
|
%shl:_(s32) = G_SHL %a:_, %amt:_(s32)
|
|
%sub:_(s32) = G_SUB %bw:_, %amt:_
|
|
%lshr:_(s32) = G_LSHR %b:_, %sub:_(s32)
|
|
%or:_(s32) = G_OR %shl:_, %lshr:_
|
|
$vgpr3 = COPY %or
|
|
...
|
|
|
|
---
|
|
name: fshl_i32_bad_amt_reg
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4
|
|
|
|
; CHECK-LABEL: name: fshl_i32_bad_amt_reg
|
|
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4
|
|
; CHECK-NEXT: {{ $}}
|
|
; CHECK-NEXT: %a:_(s32) = COPY $vgpr0
|
|
; CHECK-NEXT: %b:_(s32) = COPY $vgpr1
|
|
; CHECK-NEXT: %amt:_(s32) = COPY $vgpr2
|
|
; CHECK-NEXT: %amt1:_(s32) = COPY $vgpr3
|
|
; CHECK-NEXT: %bw:_(s32) = G_CONSTANT i32 32
|
|
; CHECK-NEXT: %shl:_(s32) = G_SHL %a, %amt(s32)
|
|
; CHECK-NEXT: %sub:_(s32) = G_SUB %bw, %amt1
|
|
; CHECK-NEXT: %lshr:_(s32) = G_LSHR %b, %sub(s32)
|
|
; CHECK-NEXT: %or:_(s32) = G_OR %shl, %lshr
|
|
; CHECK-NEXT: $vgpr4 = COPY %or(s32)
|
|
%a:_(s32) = COPY $vgpr0
|
|
%b:_(s32) = COPY $vgpr1
|
|
%amt:_(s32) = COPY $vgpr2
|
|
%amt1:_(s32) = COPY $vgpr3
|
|
%bw:_(s32) = G_CONSTANT i32 32
|
|
%shl:_(s32) = G_SHL %a:_, %amt:_(s32)
|
|
%sub:_(s32) = G_SUB %bw:_, %amt1:_
|
|
%lshr:_(s32) = G_LSHR %b:_, %sub:_(s32)
|
|
%or:_(s32) = G_OR %shl:_, %lshr:_
|
|
$vgpr4 = COPY %or
|
|
...
|