Files
clang-p2996/llvm/test/CodeGen/NVPTX/tid-range.ll
Fangrui Song b279f6b098 [NVPTX,test] Change llc -march= to -mtriple=
Similar to 806761a762

-mtriple= specifies the full target triple while -march= merely sets the
architecture part of the default target triple (e.g. Windows, macOS),
leaving a target triple which may not make sense.

Therefore, -march= is error-prone and not recommended for tests without
a target triple. The issue has been benign as we recognize
nvptx{,64}-apple-darwin as ELF instead of rejecting it outrightly.
2024-12-15 10:45:11 -08:00

21 lines
498 B
LLVM

; RUN: llc < %s -mtriple=nvptx64 | FileCheck %s
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 | %ptxas-verify %}
declare i32 @get_register()
define i1 @test1() {
entry:
%call = call i32 @llvm.nvvm.read.ptx.sreg.tid.x(), !range !0
%cmp = icmp eq i32 %call, 1
ret i1 %cmp
}
; CHECK-LABEL: test1(
; CHECK: setp.eq.s32 %p1, %r1, 1;
; CHECK: selp.u32 %[[R:.+]], 1, 0, %p1;
; CHECK: st.param.b32 [func_retval0], %[[R]];
declare i32 @llvm.nvvm.read.ptx.sreg.tid.x()
!0 = !{ i32 0, i32 3 }