Imported Upstream version 5.18.0.205

Former-commit-id: 7f59f7e792705db773f1caecdaa823092f4e2927
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-11-16 08:20:38 +00:00
parent 5cd5df71cc
commit 8e12397d70
28486 changed files with 3867013 additions and 66 deletions

View File

@ -0,0 +1,33 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
--- |
define void @atomic_memoperands() {
ret void
}
...
---
name: atomic_memoperands
body: |
bb.0:
; CHECK-LABEL: name: atomic_memoperands
; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY %x0
; CHECK: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[COPY]](p0) :: (load unordered 8)
; CHECK: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load monotonic 4)
; CHECK: [[LOAD2:%[0-9]+]]:_(s16) = G_LOAD [[COPY]](p0) :: (load acquire 2)
; CHECK: G_STORE [[LOAD2]](s16), [[COPY]](p0) :: (store release 2)
; CHECK: G_STORE [[LOAD1]](s32), [[COPY]](p0) :: (store acq_rel 4)
; CHECK: G_STORE [[LOAD]](s64), [[COPY]](p0) :: (store syncscope("singlethread") seq_cst 8)
; CHECK: RET_ReallyLR
%0:_(p0) = COPY %x0
%1:_(s64) = G_LOAD %0(p0) :: (load unordered 8)
%2:_(s32) = G_LOAD %0(p0) :: (load monotonic 4)
%3:_(s16) = G_LOAD %0(p0) :: (load acquire 2)
G_STORE %3(s16), %0(p0) :: (store release 2)
G_STORE %2(s32), %0(p0) :: (store acq_rel 4)
G_STORE %1(s64), %0(p0) :: (store syncscope("singlethread") seq_cst 8)
RET_ReallyLR
...

View File

@ -0,0 +1,48 @@
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser parses the cfi directives correctly.
--- |
declare void @foo()
define void @trivial_fp_func() {
entry:
call void @foo()
ret void
}
...
---
name: trivial_fp_func
# CHECK-LABEL: name: trivial_fp_func
body: |
bb.0.entry:
; CHECK: CFI_INSTRUCTION def_cfa %w29, 16
frame-setup CFI_INSTRUCTION def_cfa %w29, 16
; CHECK: CFI_INSTRUCTION def_cfa_register %w29
frame-setup CFI_INSTRUCTION def_cfa_register %w29
; CHECK: CFI_INSTRUCTION def_cfa_offset -8
frame-setup CFI_INSTRUCTION def_cfa_offset -8
; CHECK: CFI_INSTRUCTION offset %w30, -8
frame-setup CFI_INSTRUCTION offset %w30, -8
; CHECK: CFI_INSTRUCTION rel_offset %w30, -8
frame-setup CFI_INSTRUCTION rel_offset %w30, -8
; CHECK: CFI_INSTRUCTION adjust_cfa_offset -8
frame-setup CFI_INSTRUCTION adjust_cfa_offset -8
CFI_INSTRUCTION restore %w30
; CHECK: CFI_INSTRUCTION restore %w30
CFI_INSTRUCTION undefined %w30
; CHECK: CFI_INSTRUCTION undefined %w30
CFI_INSTRUCTION same_value %w29
; CHECK: CFI_INSTRUCTION same_value %w29
CFI_INSTRUCTION register %w20, %w30
; CHECK: CFI_INSTRUCTION register %w20, %w30
CFI_INSTRUCTION remember_state
; CHECK: CFI_INSTRUCTION remember_state
CFI_INSTRUCTION restore_state
; CHECK: CFI_INSTRUCTION restore_state
CFI_INSTRUCTION escape 0x61, 0x62, 0x63
; CHECK: CFI_INSTRUCTION escape 0x61, 0x62, 0x63
CFI_INSTRUCTION window_save
; CHECK: CFI_INSTRUCTION window_save
RET_ReallyLR

View File

@ -0,0 +1,23 @@
# RUN: not llc -mtriple=aarch64-none-linux-gnu -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
@var_i32 = global i32 42
@var_i64 = global i64 0
define i32 @sub_small() {
entry:
%val32 = load i32, i32* @var_i32
ret i32 %val32
}
...
---
name: sub_small
body: |
bb.0.entry:
%x8 = ADRP target-flags(aarch64-page) @var_i32
; CHECK: [[@LINE+1]]:60: expected the name of the target flag
%w0 = LDRWui killed %x8, target-flags(aarch64-pageoff, ) @var_i32
RET_ReallyLR implicit %w0
...

View File

@ -0,0 +1,21 @@
# RUN: not llc -mtriple=aarch64-apple-ios -run-pass none -o - %s 2>&1 \
# RUN: | FileCheck %s --check-prefix=ERR
# REQUIRES: global-isel
# This test ensures that the MIR parser errors out when
# generic virtual register definitions are not correct.
--- |
define void @baz() { ret void }
...
---
name: baz
registers:
- { id: 0, class: _ }
body: |
bb.0:
liveins: %w0
; ERR: generic virtual registers must have a type
; ERR-NEXT: %0
%0 = G_ADD i32 %w0, %w0
...

View File

@ -0,0 +1,22 @@
# RUN: not llc -mtriple=aarch64-apple-ios -run-pass none -o - %s 2>&1 \
# RUN: | FileCheck %s --check-prefix=ERR
# REQUIRES: global-isel
# This test ensures that the MIR parser errors out when
# generic virtual register definitions are not correct.
# In that case, it is defined by a register bank.
--- |
define void @bar() { ret void }
...
---
name: bar
registers:
- { id: 0, class: gpr }
body: |
bb.0:
liveins: %w0
; ERR: generic virtual registers must have a type
; ERR-NEXT: %0
%0 = G_ADD i32 %w0, %w0
...

View File

@ -0,0 +1,18 @@
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
--- |
define void @use_intrin() {
ret void
}
...
---
# Completely invalid code, but it checks that intrinsics round-trip properly.
# CHECK: %x0 = COPY intrinsic(@llvm.returnaddress)
name: use_intrin
body: |
bb.0:
%x0 = COPY intrinsic(@llvm.returnaddress)
RET_ReallyLR
...

View File

@ -0,0 +1,23 @@
# RUN: not llc -mtriple=aarch64-none-linux-gnu -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
@var_i32 = global i32 42
@var_i64 = global i64 0
define i32 @sub_small() {
entry:
%val32 = load i32, i32* @var_i32
ret i32 %val32
}
...
---
name: sub_small
body: |
bb.0.entry:
%x8 = ADRP target-flags(aarch64-page) @var_i32
; CHECK: [[@LINE+1]]:60: use of undefined target flag 'ncc'
%w0 = LDRWui killed %x8, target-flags(aarch64-pageoff, ncc) @var_i32
RET_ReallyLR implicit %w0
...

View File

@ -0,0 +1,19 @@
# RUN: not llc -mtriple=aarch64-none-linux-gnu -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
define void @target_memoperands_error() {
ret void
}
...
---
name: target_memoperands_error
body: |
bb.0:
%0:_(p0) = COPY %x0
; CHECK: [[@LINE+1]]:35: use of undefined target MMO flag 'aarch64-invalid'
%1:_(s64) = G_LOAD %0(p0) :: ("aarch64-invalid" load 8)
RET_ReallyLR
...

View File

@ -0,0 +1,8 @@
import re
if not 'AArch64' in config.root.targets:
config.unsupported = True
# For now we don't test arm64-win32.
if re.search(r'cygwin|mingw32|win32|windows-gnu|windows-msvc', config.target_triple):
config.unsupported = True

View File

@ -0,0 +1,28 @@
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser can parse multiple register machine
# operands before '='.
--- |
declare void @foo()
define void @trivial_fp_func() {
entry:
call void @foo()
ret void
}
...
---
name: trivial_fp_func
body: |
bb.0.entry:
liveins: %lr, %fp, %lr, %fp
%sp = frame-setup STPXpre killed %fp, killed %lr, %sp, -2
%fp = frame-setup ADDXri %sp, 0, 0
BL @foo, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit-def %sp
; CHECK: %sp, %fp, %lr = LDPXpost %sp, 2
%sp, %fp, %lr = LDPXpost %sp, 2
RET_ReallyLR
...

View File

@ -0,0 +1,20 @@
# RUN: llc -o - %s -mtriple=aarch64-- -run-pass=none | FileCheck %s
# REQUIRES: global-isel
# Test various aspects of register bank specification on machine operands.
--- |
define void @func() { ret void }
...
---
# CHECK-LABEL: name: func
# CHECK: registers:
# CHECK: - { id: 0, class: gpr, preferred-register: '' }
# CHECK: - { id: 1, class: fpr, preferred-register: '' }
name: func
body: |
bb.0:
%0 : gpr(s64) = COPY %x9
%x9 = COPY %0
%3 : fpr(s64) = COPY %d0
%d1 = COPY %3 : fpr
...

View File

@ -0,0 +1,82 @@
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass greedy -verify-machineinstrs -o - %s | FileCheck %s
--- |
define i64 @test_subreg_spill_fold() { ret i64 0 }
define i64 @test_subreg_spill_fold2() { ret i64 0 }
define i64 @test_subreg_spill_fold3() { ret i64 0 }
define i64 @test_subreg_fill_fold() { ret i64 0 }
define double @test_subreg_fill_fold2() { ret double 0.0 }
...
---
# CHECK-LABEL: name: test_subreg_spill_fold
# Ensure that the spilled subreg COPY is eliminated and folded into the spill store.
name: test_subreg_spill_fold
registers:
- { id: 0, class: gpr64 }
body: |
bb.0:
; CHECK: STRXui %xzr, %stack.0, 0 :: (store 8 into %stack.0)
undef %0.sub_32 = COPY %wzr
INLINEASM $nop, 1, 12, implicit-def dead %x0, 12, implicit-def dead %x1, 12, implicit-def dead %x2, 12, implicit-def dead %x3, 12, implicit-def dead %x4, 12, implicit-def dead %x5, 12, implicit-def dead %x6, 12, implicit-def dead %x7, 12, implicit-def dead %x8, 12, implicit-def dead %x9, 12, implicit-def dead %x10, 12, implicit-def dead %x11, 12, implicit-def dead %x12, 12, implicit-def dead %x13, 12, implicit-def dead %x14, 12, implicit-def dead %x15, 12, implicit-def dead %x16, 12, implicit-def dead %x17, 12, implicit-def dead %x18, 12, implicit-def dead %x19, 12, implicit-def dead %x20, 12, implicit-def dead %x21, 12, implicit-def dead %x22, 12, implicit-def dead %x23, 12, implicit-def dead %x24, 12, implicit-def dead %x25, 12, implicit-def dead %x26, 12, implicit-def dead %x27, 12, implicit-def dead %x28, 12, implicit-def dead %fp, 12, implicit-def dead %lr, 12, implicit-def %sp
%x0 = COPY %0
RET_ReallyLR implicit %x0
...
---
# CHECK-LABEL: name: test_subreg_spill_fold2
# Similar to test_subreg_spill_fold, but with a %0 register class not containing %WZR.
name: test_subreg_spill_fold2
registers:
- { id: 0, class: gpr64sp }
body: |
bb.0:
; CHECK: STRXui %xzr, %stack.0, 0 :: (store 8 into %stack.0)
undef %0.sub_32 = COPY %wzr
INLINEASM $nop, 1, 12, implicit-def dead %x0, 12, implicit-def dead %x1, 12, implicit-def dead %x2, 12, implicit-def dead %x3, 12, implicit-def dead %x4, 12, implicit-def dead %x5, 12, implicit-def dead %x6, 12, implicit-def dead %x7, 12, implicit-def dead %x8, 12, implicit-def dead %x9, 12, implicit-def dead %x10, 12, implicit-def dead %x11, 12, implicit-def dead %x12, 12, implicit-def dead %x13, 12, implicit-def dead %x14, 12, implicit-def dead %x15, 12, implicit-def dead %x16, 12, implicit-def dead %x17, 12, implicit-def dead %x18, 12, implicit-def dead %x19, 12, implicit-def dead %x20, 12, implicit-def dead %x21, 12, implicit-def dead %x22, 12, implicit-def dead %x23, 12, implicit-def dead %x24, 12, implicit-def dead %x25, 12, implicit-def dead %x26, 12, implicit-def dead %x27, 12, implicit-def dead %x28, 12, implicit-def dead %fp, 12, implicit-def dead %lr, 12, implicit-def %sp
%x0 = ADDXri %0, 1, 0
RET_ReallyLR implicit %x0
...
---
# CHECK-LABEL: name: test_subreg_spill_fold3
# Similar to test_subreg_spill_fold, but with a cross register class copy.
name: test_subreg_spill_fold3
registers:
- { id: 0, class: fpr64 }
body: |
bb.0:
; CHECK: STRXui %xzr, %stack.0, 0 :: (store 8 into %stack.0)
undef %0.ssub = COPY %wzr
INLINEASM $nop, 1, 12, implicit-def dead %d0, 12, implicit-def dead %d1, 12, implicit-def dead %d2, 12, implicit-def dead %d3, 12, implicit-def dead %d4, 12, implicit-def dead %d5, 12, implicit-def dead %d6, 12, implicit-def dead %d7, 12, implicit-def dead %d8, 12, implicit-def dead %d9, 12, implicit-def dead %d10, 12, implicit-def dead %d11, 12, implicit-def dead %d12, 12, implicit-def dead %d13, 12, implicit-def dead %d14, 12, implicit-def dead %d15, 12, implicit-def dead %d16, 12, implicit-def dead %d17, 12, implicit-def dead %d18, 12, implicit-def dead %d19, 12, implicit-def dead %d20, 12, implicit-def dead %d21, 12, implicit-def dead %d22, 12, implicit-def dead %d23, 12, implicit-def dead %d24, 12, implicit-def dead %d25, 12, implicit-def dead %d26, 12, implicit-def dead %d27, 12, implicit-def dead %d28, 12, implicit-def dead %d29, 12, implicit-def dead %d30, 12, implicit-def %d31
%x0 = COPY %0
RET_ReallyLR implicit %x0
...
---
# CHECK-LABEL: name: test_subreg_fill_fold
# Ensure that the filled COPY is eliminated and folded into the fill load.
name: test_subreg_fill_fold
registers:
- { id: 0, class: gpr32 }
- { id: 1, class: gpr64 }
body: |
bb.0:
%0 = COPY %wzr
INLINEASM $nop, 1, 12, implicit-def dead %x0, 12, implicit-def dead %x1, 12, implicit-def dead %x2, 12, implicit-def dead %x3, 12, implicit-def dead %x4, 12, implicit-def dead %x5, 12, implicit-def dead %x6, 12, implicit-def dead %x7, 12, implicit-def dead %x8, 12, implicit-def dead %x9, 12, implicit-def dead %x10, 12, implicit-def dead %x11, 12, implicit-def dead %x12, 12, implicit-def dead %x13, 12, implicit-def dead %x14, 12, implicit-def dead %x15, 12, implicit-def dead %x16, 12, implicit-def dead %x17, 12, implicit-def dead %x18, 12, implicit-def dead %x19, 12, implicit-def dead %x20, 12, implicit-def dead %x21, 12, implicit-def dead %x22, 12, implicit-def dead %x23, 12, implicit-def dead %x24, 12, implicit-def dead %x25, 12, implicit-def dead %x26, 12, implicit-def dead %x27, 12, implicit-def dead %x28, 12, implicit-def dead %fp, 12, implicit-def dead %lr, 12, implicit-def %sp
; CHECK: undef %1.sub_32:gpr64 = LDRWui %stack.0, 0 :: (load 4 from %stack.0)
undef %1.sub_32 = COPY %0
%x0 = COPY %1
RET_ReallyLR implicit %x0
...
---
# CHECK-LABEL: name: test_subreg_fill_fold2
# Similar to test_subreg_fill_fold, but with a cross-class copy.
name: test_subreg_fill_fold2
registers:
- { id: 0, class: gpr32 }
- { id: 1, class: fpr64 }
body: |
bb.0:
%0 = COPY %wzr
INLINEASM $nop, 1, 12, implicit-def dead %x0, 12, implicit-def dead %x1, 12, implicit-def dead %x2, 12, implicit-def dead %x3, 12, implicit-def dead %x4, 12, implicit-def dead %x5, 12, implicit-def dead %x6, 12, implicit-def dead %x7, 12, implicit-def dead %x8, 12, implicit-def dead %x9, 12, implicit-def dead %x10, 12, implicit-def dead %x11, 12, implicit-def dead %x12, 12, implicit-def dead %x13, 12, implicit-def dead %x14, 12, implicit-def dead %x15, 12, implicit-def dead %x16, 12, implicit-def dead %x17, 12, implicit-def dead %x18, 12, implicit-def dead %x19, 12, implicit-def dead %x20, 12, implicit-def dead %x21, 12, implicit-def dead %x22, 12, implicit-def dead %x23, 12, implicit-def dead %x24, 12, implicit-def dead %x25, 12, implicit-def dead %x26, 12, implicit-def dead %x27, 12, implicit-def dead %x28, 12, implicit-def dead %fp, 12, implicit-def dead %lr, 12, implicit-def %sp
; CHECK: undef %1.ssub:fpr64 = LDRSui %stack.0, 0 :: (load 4 from %stack.0)
undef %1.ssub = COPY %0
%d0 = COPY %1
RET_ReallyLR implicit %d0
...

View File

@ -0,0 +1,42 @@
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
--- |
@var = global i64 0
@local_addr = global i64* null
define void @stack_local() {
entry:
%local_var = alloca i64
%val = load i64, i64* @var
store i64 %val, i64* %local_var
store i64* %local_var, i64** @local_addr
ret void
}
...
---
name: stack_local
tracksRegLiveness: true
registers:
- { id: 0, class: gpr64common }
- { id: 1, class: gpr64 }
- { id: 2, class: gpr64common }
- { id: 3, class: gpr64common }
frameInfo:
maxAlignment: 8
# CHECK-LABEL: stack_local
# CHECK: stack:
# CHECK: - { id: 0, name: local_var, type: default, offset: 0, size: 8, alignment: 8,
# CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
# CHECK-NEXT: local-offset: -8, di-variable: '', di-expression: '', di-location: '' }
stack:
- { id: 0,name: local_var,offset: 0,size: 8,alignment: 8, local-offset: -8 }
body: |
bb.0.entry:
%0 = ADRP @var
%1 = LDRXui killed %0, @var :: (load 8 from @var)
STRXui killed %1, %stack.0.local_var, 0 :: (store 8 into %ir.local_var)
%2 = ADRP @local_addr
%3 = ADDXri %stack.0.local_var, 0, 0
STRXui killed %3, killed %2, @local_addr :: (store 8 into @local_addr)
RET_ReallyLR
...

View File

@ -0,0 +1,33 @@
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
--- |
define i32 @swp(i32* %addr) #0 {
entry:
%0 = atomicrmw xchg i32* %addr, i32 1 monotonic
ret i32 %0
}
attributes #0 = { "target-features"="+lse" }
...
---
name: swp
alignment: 2
tracksRegLiveness: true
registers:
- { id: 0, class: gpr64common }
- { id: 1, class: gpr32 }
- { id: 2, class: gpr32 }
liveins:
- { reg: '%x0', virtual-reg: '%0' }
body: |
bb.0.entry:
liveins: %x0
; CHECK-LABEL: swp
; CHECK: {{[0-9]+}}:gpr32 = SWPW killed %1, %0 :: (volatile load store monotonic 4 on %ir.addr)
%0:gpr64common = COPY %x0
%1:gpr32 = MOVi32imm 1
%2:gpr32 = SWPW killed %1, %0 :: (volatile load store monotonic 4 on %ir.addr)
%w0 = COPY %2
RET_ReallyLR implicit %w0
...

View File

@ -0,0 +1,39 @@
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
--- |
@var_i32 = global i32 42
@var_i64 = global i64 0
define void @sub_small() {
entry:
%val32 = load i32, i32* @var_i32
%newval32 = sub i32 %val32, 4095
store i32 %newval32, i32* @var_i32
%val64 = load i64, i64* @var_i64
%newval64 = sub i64 %val64, 52
store i64 %newval64, i64* @var_i64
ret void
}
...
---
name: sub_small
body: |
bb.0.entry:
; CHECK: %x8 = ADRP target-flags(aarch64-page) @var_i32
; CHECK-NEXT: %x9 = ADRP target-flags(aarch64-page) @var_i64
; CHECK-NEXT: %w10 = LDRWui %x8, target-flags(aarch64-pageoff, aarch64-nc) @var_i32
; CHECK-NEXT: %x11 = LDRXui %x9, target-flags(aarch64-pageoff, aarch64-got, aarch64-nc) @var_i64
; CHECK: STRWui killed %w10, killed %x8, target-flags(aarch64-nc) @var_i32
; CHECK: STRXui killed %x11, killed %x9, target-flags(aarch64-pageoff, aarch64-nc) @var_i64
%x8 = ADRP target-flags(aarch64-page) @var_i32
%x9 = ADRP target-flags(aarch64-page) @var_i64
%w10 = LDRWui %x8, target-flags(aarch64-pageoff, aarch64-nc) @var_i32
%x11 = LDRXui %x9, target-flags(aarch64-pageoff, aarch64-got, aarch64-nc) @var_i64
%w10 = SUBWri killed %w10, 4095, 0
%x11 = SUBXri killed %x11, 52, 0
STRWui killed %w10, killed %x8, target-flags(aarch64-nc) @var_i32
STRXui killed %x11, killed %x9, target-flags(aarch64-pageoff, aarch64-nc) @var_i64
RET_ReallyLR
...

View File

@ -0,0 +1,29 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s
--- |
define void @target_memoperands() {
ret void
}
...
---
name: target_memoperands
body: |
bb.0:
; CHECK-LABEL: name: target_memoperands
; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY %x0
; CHECK: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[COPY]](p0) :: ("aarch64-suppress-pair" load 8)
; CHECK: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: ("aarch64-strided-access" load 4)
; CHECK: G_STORE [[LOAD]](s64), [[COPY]](p0) :: ("aarch64-suppress-pair" store 8)
; CHECK: G_STORE [[LOAD1]](s32), [[COPY]](p0) :: ("aarch64-strided-access" store 4)
; CHECK: RET_ReallyLR
%0:_(p0) = COPY %x0
%1:_(s64) = G_LOAD %0(p0) :: ("aarch64-suppress-pair" load 8)
%2:_(s32) = G_LOAD %0(p0) :: ("aarch64-strided-access" load 4)
G_STORE %1(s64), %0(p0) :: ("aarch64-suppress-pair" store 8)
G_STORE %2(s32), %0(p0) :: ("aarch64-strided-access" store 4)
RET_ReallyLR
...

View File

@ -0,0 +1,49 @@
# RUN: not llc -march=amdgcn -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
%struct.foo = type { float, [5 x i32] }
@float_gv = internal unnamed_addr addrspace(2) constant [5 x float] [float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00], align 4
define amdgpu_kernel void @float(float addrspace(1)* %out, i32 %index) #0 {
entry:
%0 = getelementptr inbounds [5 x float], [5 x float] addrspace(2)* @float_gv, i32 0, i32 %index
%1 = load float, float addrspace(2)* %0
store float %1, float addrspace(1)* %out
ret void
}
attributes #0 = { nounwind }
...
---
name: float
liveins:
- { reg: '%sgpr0_sgpr1' }
frameInfo:
maxAlignment: 8
body: |
bb.0.entry:
liveins: %sgpr0_sgpr1
%sgpr2_sgpr3 = S_GETPC_B64
; CHECK: [[@LINE+1]]:45: expected the name of the target index
%sgpr2 = S_ADD_U32 %sgpr2, target-index(0), implicit-def %scc, implicit-def %scc
%sgpr3 = S_ADDC_U32 %sgpr3, 0, implicit-def %scc, implicit %scc, implicit-def %scc, implicit %scc
%sgpr4_sgpr5 = S_LSHR_B64 %sgpr2_sgpr3, 32, implicit-def dead %scc
%sgpr6 = S_LOAD_DWORD_IMM %sgpr0_sgpr1, 11
%sgpr7 = S_ASHR_I32 %sgpr6, 31, implicit-def dead %scc
%sgpr6_sgpr7 = S_LSHL_B64 %sgpr6_sgpr7, 2, implicit-def dead %scc
%sgpr2 = S_ADD_U32 %sgpr2, @float_gv, implicit-def %scc
%sgpr3 = S_ADDC_U32 %sgpr4, 0, implicit-def dead %scc, implicit %scc
%sgpr4 = S_ADD_U32 %sgpr2, %sgpr6, implicit-def %scc
%sgpr5 = S_ADDC_U32 %sgpr3, %sgpr7, implicit-def dead %scc, implicit %scc
%sgpr2 = S_LOAD_DWORD_IMM %sgpr4_sgpr5, 0
%sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM killed %sgpr0_sgpr1, 9
%sgpr7 = S_MOV_B32 61440
%sgpr6 = S_MOV_B32 -1
%vgpr0 = V_MOV_B32_e32 killed %sgpr2, implicit %exec
BUFFER_STORE_DWORD_OFFSET killed %vgpr0, %sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit %exec
S_ENDPGM
...

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
# RUN: llc --mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs -run-pass si-fold-operands,si-shrink-instructions %s -o - | FileCheck %s
--- |
define amdgpu_kernel void @test() #0 {
ret void
}
attributes #0 = { nounwind }
...
---
# This used to crash / trigger an assertion, because re-scanning the use list
# after constant-folding the definition of %3 lead to the definition of %2
# being processed twice.
# CHECK-LABEL: name: test
# CHECK: %2:vgpr_32 = V_LSHLREV_B32_e32 2, killed %0, implicit %exec
# CHECK: %4:vgpr_32 = V_AND_B32_e32 8, killed %2, implicit %exec
name: test
tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: sreg_32 }
- { id: 2, class: vgpr_32 }
- { id: 3, class: sreg_32 }
- { id: 4, class: vgpr_32 }
- { id: 5, class: sreg_128 }
body: |
bb.0 (%ir-block.0):
%0 = IMPLICIT_DEF
%1 = S_MOV_B32 2
%2 = V_LSHLREV_B32_e64 %1, killed %0, implicit %exec
%3 = S_LSHL_B32 %1, killed %1, implicit-def dead %scc
%4 = V_AND_B32_e64 killed %2, killed %3, implicit %exec
%5 = IMPLICIT_DEF
BUFFER_STORE_DWORD_OFFSET killed %4, killed %5, 0, 0, 0, 0, 0, implicit %exec
S_ENDPGM
...

View File

@ -0,0 +1,21 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn -run-pass none -o - %s | FileCheck %s
--- |
define amdgpu_kernel void @use_intrin() {
ret void
}
...
---
# Completely invalid code, but it checks that intrinsics round-trip properly.
name: use_intrin
registers:
- { id: 0, class: _ }
body: |
bb.0:
; CHECK-LABEL: name: use_intrin
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY intrinsic(@llvm.amdgcn.sbfe)
%0(s64) = COPY intrinsic(@llvm.amdgcn.sbfe.i32)
...

Some files were not shown because too many files have changed in this diff Show More