[llvm] [NVPTX] Fix segfault with i128 types in arrays (PR #120562)
Justin Fargnoli via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 12:11:32 PST 2024
================
@@ -0,0 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc < %s -O0 -march=nvptx64 -mcpu=sm_20 | FileCheck %s
+
+define [2 x i128] @foo(i64 %a, i32 %b) {
+; CHECK-LABEL: foo(
+; CHECK: {
+; CHECK-NEXT: .reg .b32 %r<2>;
+; CHECK-NEXT: .reg .b64 %rd<5>;
+; CHECK-EMPTY:
+; CHECK-NEXT: // %bb.0:
+; CHECK-NEXT: ld.param.u32 %r1, [foo_param_1];
+; CHECK-NEXT: ld.param.u64 %rd1, [foo_param_0];
+; CHECK-NEXT: shr.s64 %rd2, %rd1, 63;
+; CHECK-NEXT: cvt.s64.s32 %rd3, %r1;
+; CHECK-NEXT: shr.s64 %rd4, %rd3, 63;
+; CHECK-NEXT: st.param.v2.b64 [func_retval0], {%rd1, %rd2};
+; CHECK-NEXT: st.param.v2.b64 [func_retval0+16], {%rd3, %rd4};
+; CHECK-NEXT: ret;
+ %1 = sext i64 %a to i128
+ %2 = sext i32 %b to i128
----------------
justinfargnoli wrote:
Out of curiosity, is there a particular reason `%a` and `%b` are different types?
https://github.com/llvm/llvm-project/pull/120562
More information about the llvm-commits
mailing list