Similar to 806761a762.
For IR files without a target triple, -mtriple= specifies the full
target triple while -march= merely sets the architecture part of the
default target triple, leaving a target triple which may not make sense,
e.g. amdgpu-apple-darwin.
Therefore, -march= is error-prone and not recommended for tests without
a target triple. The issue has been benign as we recognize
$unknown-apple-darwin as ELF instead of rejecting it outrightly.
This patch changes AMDGPU tests to not rely on the default
OS/environment components. Tests that need fixes are not changed:
```
LLVM :: CodeGen/AMDGPU/fabs.f64.ll
LLVM :: CodeGen/AMDGPU/fabs.ll
LLVM :: CodeGen/AMDGPU/floor.ll
LLVM :: CodeGen/AMDGPU/fneg-fabs.f64.ll
LLVM :: CodeGen/AMDGPU/fneg-fabs.ll
LLVM :: CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll
LLVM :: CodeGen/AMDGPU/schedule-if-2.ll
```
58 lines
2.3 KiB
LLVM
58 lines
2.3 KiB
LLVM
; RUN: llc -mtriple=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC %s
|
|
; RUN: llc -mtriple=amdgcn-amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC %s
|
|
; RUN: llc -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC %s
|
|
; RUN: llc -mtriple=r600 -mcpu=redwood < %s | FileCheck --check-prefixes=EG,FUNC %s
|
|
|
|
; FIXME: This seems to not ever actually become an extload
|
|
; FUNC-LABEL: {{^}}global_anyext_load_i8:
|
|
; GCN: buffer_load_dword v{{[0-9]+}}
|
|
; GCN: buffer_store_dword v{{[0-9]+}}
|
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+.[XYZW]]],
|
|
; EG: VTX_READ_32 [[VAL]]
|
|
define amdgpu_kernel void @global_anyext_load_i8(ptr addrspace(1) nocapture noalias %out, ptr addrspace(1) nocapture noalias %src) nounwind {
|
|
%load = load i32, ptr addrspace(1) %src
|
|
%x = bitcast i32 %load to <4 x i8>
|
|
store <4 x i8> %x, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}global_anyext_load_i16:
|
|
; GCN: buffer_load_dword v{{[0-9]+}}
|
|
; GCN: buffer_store_dword v{{[0-9]+}}
|
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+.[XYZW]]],
|
|
; EG: VTX_READ_32 [[VAL]]
|
|
define amdgpu_kernel void @global_anyext_load_i16(ptr addrspace(1) nocapture noalias %out, ptr addrspace(1) nocapture noalias %src) nounwind {
|
|
%load = load i32, ptr addrspace(1) %src
|
|
%x = bitcast i32 %load to <2 x i16>
|
|
store <2 x i16> %x, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}local_anyext_load_i8:
|
|
; GCN: ds_read_b32 v{{[0-9]+}}
|
|
; GCN: ds_write_b32 v{{[0-9]+}}
|
|
|
|
; EG: LDS_READ_RET {{.*}}, [[VAL:T[0-9]+.[XYZW]]]
|
|
; EG: LDS_WRITE * [[VAL]]
|
|
define amdgpu_kernel void @local_anyext_load_i8(ptr addrspace(3) nocapture noalias %out, ptr addrspace(3) nocapture noalias %src) nounwind {
|
|
%load = load i32, ptr addrspace(3) %src
|
|
%x = bitcast i32 %load to <4 x i8>
|
|
store <4 x i8> %x, ptr addrspace(3) %out
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}local_anyext_load_i16:
|
|
; GCN: ds_read_b32 v{{[0-9]+}}
|
|
; GCN: ds_write_b32 v{{[0-9]+}}
|
|
|
|
; EG: LDS_READ_RET {{.*}}, [[VAL:T[0-9]+.[XYZW]]]
|
|
; EG: LDS_WRITE * [[VAL]]
|
|
define amdgpu_kernel void @local_anyext_load_i16(ptr addrspace(3) nocapture noalias %out, ptr addrspace(3) nocapture noalias %src) nounwind {
|
|
%load = load i32, ptr addrspace(3) %src
|
|
%x = bitcast i32 %load to <2 x i16>
|
|
store <2 x i16> %x, ptr addrspace(3) %out
|
|
ret void
|
|
}
|