llvm-project/llvm/test/CodeGen/NVPTX/anonymous-fn-param.ll
Alex MacLean 369891b674
[NVPTX] use untyped loads and stores where ever possible (#137698)
In most cases, the type information attached to load and store
instructions is meaningless and inconsistently applied. We can usually
use ".b" loads and avoid the complexity of trying to assign the correct
type. The one expectation is sign-extending load, which will continue to
use ".s" to ensure the sign extension into a larger register is done
correctly.
2025-05-10 08:26:26 -07:00

26 lines
785 B
LLVM

; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 | FileCheck %s
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
; Check that parameter names we generate in the function signature and the name
; we use when we refer to the parameter in the function body do match.
; CHECK: .func (.param .b32 func_retval0) __unnamed_1(
; CHECK-NEXT: .param .b32 __unnamed_1_param_0
; CHECK: ld.param.b32 {{%r[0-9]+}}, [__unnamed_1_param_0];
define internal i32 @0(i32 %a) {
entry:
%r = add i32 %a, 1
ret i32 %r
}
; CHECK: .func (.param .b32 func_retval0) __unnamed_2(
; CHECK-NEXT: .param .b32 __unnamed_2_param_0
; CHECK: ld.param.b32 {{%r[0-9]+}}, [__unnamed_2_param_0];
define internal i32 @1(i32 %a) {
entry:
%r = add i32 %a, 1
ret i32 %r
}