[llvm] [NVPTX][NFC] Update NVPTXLowerAlloca comments to use opaque pointer syntax (PR #190573)
Balaji Krishna Yugandhar Atukuri via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 5 19:22:11 PDT 2026
https://github.com/balaji-krishna-atukuri created https://github.com/llvm/llvm-project/pull/190573
Modernize the header comment IR examples in `NVPTXLowerAlloca.cpp` to use opaque pointer syntax (`ptr` instead of `i32*`, `i32 addrspace(5)*`, etc.), matching the LLVM-wide move to opaque pointers in LLVM 17+.
Also fix a grammar issue: "For all alloca instructions, **and** add a pair of cast" → "For all alloca instructions, add a pair of **casts**".
Comment-only change, no functional impact.
>From 9e51aff00d41f87a2f8a5f870e679a7872b133b7 Mon Sep 17 00:00:00 2001
From: Balaji Krishna Yugandhar Atukuri <balaji.k.atukuri at gmail.com>
Date: Sun, 5 Apr 2026 19:21:39 -0700
Subject: [PATCH] [NVPTX][NFC] Update NVPTXLowerAlloca comments to use opaque
pointer syntax
Modernize the header comment IR examples to use opaque pointer syntax
(ptr instead of i32*, i32 addrspace(5)*, etc.), matching the LLVM-wide
move to opaque pointers in LLVM 17+. Also fix a grammar issue in the
comment.
---
llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp
index 1583d45eeb3a6..2262decfc3c76 100644
--- a/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp
@@ -6,18 +6,18 @@
//
//===----------------------------------------------------------------------===//
//
-// For all alloca instructions, and add a pair of cast to local address for
+// For all alloca instructions, add a pair of casts to local address for
// each of them. For example,
//
// %A = alloca i32
-// store i32 0, i32* %A ; emits st.u32
+// store i32 0, ptr %A ; emits st.u32
//
// will be transformed to
//
// %A = alloca i32
-// %Local = addrspacecast i32* %A to i32 addrspace(5)*
-// %Generic = addrspacecast i32 addrspace(5)* %A to i32*
-// store i32 0, i32 addrspace(5)* %Generic ; emits st.local.u32
+// %Local = addrspacecast ptr %A to ptr addrspace(5)
+// %Generic = addrspacecast ptr addrspace(5) %Local to ptr
+// store i32 0, ptr %Generic ; emits st.local.u32
//
// And we will rely on NVPTXInferAddressSpaces to combine the last two
// instructions.
More information about the llvm-commits
mailing list