[llvm] [NVPTX] Split out NVPTXSetByValParamAlign of NVPTXLowerArgs (NFC) (PR #187965)
Drew Kersnar via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 23 14:02:11 PDT 2026
================
@@ -0,0 +1,160 @@
+//===-- NVPTXSetByValParamAlign.cpp - Set byval param alignment -----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Set explicit alignment on byval parameter attributes in the NVPTX backend.
+// Without this, the alignment is left unspecified and IR-level analyses (e.g.,
+// computeKnownBits via Value::getPointerAlignment) conservatively assume
+// Align(1), since the actual alignment is a target-specific codegen detail not
+// visible at the IR level.
+//
+// The alignment is chosen as follows:
+// - Externally-visible functions: ABI type alignment (capped at 128).
+// - Internal/private functions: max(16, ABI align) to enable 128-bit
+// vectorized param loads.
----------------
dakersnar wrote:
... and if 1) is correct, I think the use of "chosen" here is a little too vague. I would use words like "derived" or "known" and maybe elaborate on what the source of truth is that lets us assert these alignment guarantees on byval params.
https://github.com/llvm/llvm-project/pull/187965
More information about the llvm-commits
mailing list