[llvm] [NVPTX] Cleanup and refactor param align computation, addressing a few minor bugs and discrepancies (PR #188588)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 22:15:16 PDT 2026


================
@@ -0,0 +1,38 @@
+; RUN: llc < %s -mtriple=nvptx64 | FileCheck %s
+
+; Verify that return value alignment is consistent between the callee
+; (LowerReturn), the declaration (printReturnValStr), and the caller
+; (LowerCall). All three should honor alignstack on the return index.
+
+target triple = "nvptx64-nvidia-cuda"
+
+%struct.big = type { i32, i32, i32, i32, i32 }
+
+; alignstack(4) on the return forces align 4 everywhere: the declaration,
+; the callee stores, and the caller loads all use scalar b32 ops.
+; CHECK-LABEL: .func (.param .align 4 .b8 func_retval0[20]) internal_ret()
+; CHECK-NOT:     st.param.v4
----------------
AlexMaclean wrote:

Sounds good. Added these cases below. 

https://github.com/llvm/llvm-project/pull/188588


More information about the llvm-commits mailing list