Files
clang-p2996/llvm/test/CodeGen/AMDGPU/vectorize-global-local.ll
Fangrui Song 9e9907f1cf [AMDGPU,test] Change llc -march= to -mtriple= (#75982)
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
```
2024-01-16 21:54:58 -08:00

81 lines
4.3 KiB
LLVM

; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck %s
; CHECK-DAG: flat_load_dwordx4
; CHECK-DAG: flat_load_dwordx4
; CHECK-DAG: flat_load_dwordx4
; CHECK-DAG: flat_load_dwordx4
; CHECK-DAG: ds_write2_b32
; CHECK-DAG: ds_write2_b32
; CHECK-DAG: ds_write2_b32
; CHECK-DAG: ds_write2_b32
; CHECK-DAG: ds_write2_b32
; CHECK-DAG: ds_write2_b32
; CHECK-DAG: ds_write2_b32
; CHECK-DAG: ds_write2_b32
define amdgpu_kernel void @vectorize_global_local(ptr addrspace(1) nocapture readonly %arg, ptr addrspace(3) nocapture %arg1) {
bb:
%tmp = load i32, ptr addrspace(1) %arg, align 4
store i32 %tmp, ptr addrspace(3) %arg1, align 4
%tmp2 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 1
%tmp3 = load i32, ptr addrspace(1) %tmp2, align 4
%tmp4 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 1
store i32 %tmp3, ptr addrspace(3) %tmp4, align 4
%tmp5 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 2
%tmp6 = load i32, ptr addrspace(1) %tmp5, align 4
%tmp7 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 2
store i32 %tmp6, ptr addrspace(3) %tmp7, align 4
%tmp8 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 3
%tmp9 = load i32, ptr addrspace(1) %tmp8, align 4
%tmp10 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 3
store i32 %tmp9, ptr addrspace(3) %tmp10, align 4
%tmp11 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 4
%tmp12 = load i32, ptr addrspace(1) %tmp11, align 4
%tmp13 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 4
store i32 %tmp12, ptr addrspace(3) %tmp13, align 4
%tmp14 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 5
%tmp15 = load i32, ptr addrspace(1) %tmp14, align 4
%tmp16 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 5
store i32 %tmp15, ptr addrspace(3) %tmp16, align 4
%tmp17 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 6
%tmp18 = load i32, ptr addrspace(1) %tmp17, align 4
%tmp19 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 6
store i32 %tmp18, ptr addrspace(3) %tmp19, align 4
%tmp20 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 7
%tmp21 = load i32, ptr addrspace(1) %tmp20, align 4
%tmp22 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 7
store i32 %tmp21, ptr addrspace(3) %tmp22, align 4
%tmp23 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 8
%tmp24 = load i32, ptr addrspace(1) %tmp23, align 4
%tmp25 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 8
store i32 %tmp24, ptr addrspace(3) %tmp25, align 4
%tmp26 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 9
%tmp27 = load i32, ptr addrspace(1) %tmp26, align 4
%tmp28 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 9
store i32 %tmp27, ptr addrspace(3) %tmp28, align 4
%tmp29 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 10
%tmp30 = load i32, ptr addrspace(1) %tmp29, align 4
%tmp31 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 10
store i32 %tmp30, ptr addrspace(3) %tmp31, align 4
%tmp32 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 11
%tmp33 = load i32, ptr addrspace(1) %tmp32, align 4
%tmp34 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 11
store i32 %tmp33, ptr addrspace(3) %tmp34, align 4
%tmp35 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 12
%tmp36 = load i32, ptr addrspace(1) %tmp35, align 4
%tmp37 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 12
store i32 %tmp36, ptr addrspace(3) %tmp37, align 4
%tmp38 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 13
%tmp39 = load i32, ptr addrspace(1) %tmp38, align 4
%tmp40 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 13
store i32 %tmp39, ptr addrspace(3) %tmp40, align 4
%tmp41 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 14
%tmp42 = load i32, ptr addrspace(1) %tmp41, align 4
%tmp43 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 14
store i32 %tmp42, ptr addrspace(3) %tmp43, align 4
%tmp44 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 15
%tmp45 = load i32, ptr addrspace(1) %tmp44, align 4
%tmp46 = getelementptr inbounds i32, ptr addrspace(3) %arg1, i32 15
store i32 %tmp45, ptr addrspace(3) %tmp46, align 4
ret void
}