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
```
50 lines
1.7 KiB
LLVM
50 lines
1.7 KiB
LLVM
; RUN: llc -mtriple=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
|
|
|
|
; Make sure that m0 is not reinitialized in the loop.
|
|
|
|
; GCN-LABEL: {{^}}copy_local_to_global_loop_m0_init:
|
|
; GCN: s_cbranch_scc1 .LBB0_3
|
|
|
|
; Initialize in preheader
|
|
; GCN: s_mov_b32 m0, -1
|
|
|
|
; GCN: .LBB0_2:
|
|
; GCN-NOT: m0
|
|
; GCN: ds_read_b32
|
|
; GCN-NOT: m0
|
|
; GCN: buffer_store_dword
|
|
|
|
; GCN: s_cbranch_scc0 .LBB0_2
|
|
|
|
; GCN: .LBB0_3:
|
|
; GCN-NEXT: s_endpgm
|
|
define amdgpu_kernel void @copy_local_to_global_loop_m0_init(ptr addrspace(1) noalias nocapture %out, ptr addrspace(3) noalias nocapture readonly %in, i32 %n) #0 {
|
|
bb:
|
|
%tmp = icmp sgt i32 %n, 0
|
|
br i1 %tmp, label %.lr.ph.preheader, label %._crit_edge
|
|
|
|
.lr.ph.preheader: ; preds = %bb
|
|
br label %.lr.ph
|
|
|
|
._crit_edge.loopexit: ; preds = %.lr.ph
|
|
br label %._crit_edge
|
|
|
|
._crit_edge: ; preds = %._crit_edge.loopexit, %bb
|
|
ret void
|
|
|
|
.lr.ph: ; preds = %.lr.ph, %.lr.ph.preheader
|
|
%indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph.preheader ]
|
|
%i.01 = phi i32 [ %tmp4, %.lr.ph ], [ 0, %.lr.ph.preheader ]
|
|
%tmp1 = getelementptr inbounds i32, ptr addrspace(3) %in, i32 %i.01
|
|
%tmp2 = load i32, ptr addrspace(3) %tmp1, align 4
|
|
%tmp3 = getelementptr inbounds i32, ptr addrspace(1) %out, i64 %indvars.iv
|
|
store i32 %tmp2, ptr addrspace(1) %tmp3, align 4
|
|
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
|
|
%tmp4 = add nuw nsw i32 %i.01, 1
|
|
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
|
|
%exitcond = icmp eq i32 %lftr.wideiv, %n
|
|
br i1 %exitcond, label %._crit_edge.loopexit, label %.lr.ph
|
|
}
|
|
|
|
attributes #0 = { nounwind }
|