[clang] [OpenCL] Remove image dimensionality comments; NFC (PR #147312)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 7 07:46:24 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Sven van Haastregt (svenvh)
<details>
<summary>Changes</summary>
The code is correct as it aligns with the SPIR-V Specification, but the comment was incorrect.
---
Full diff: https://github.com/llvm/llvm-project/pull/147312.diff
1 Files Affected:
- (modified) clang/lib/CodeGen/Targets/SPIR.cpp (+2-2)
``````````diff
diff --git a/clang/lib/CodeGen/Targets/SPIR.cpp b/clang/lib/CodeGen/Targets/SPIR.cpp
index 92ae46234e6b1..382f512b4410a 100644
--- a/clang/lib/CodeGen/Targets/SPIR.cpp
+++ b/clang/lib/CodeGen/Targets/SPIR.cpp
@@ -318,9 +318,9 @@ static llvm::Type *getSPIRVImageType(llvm::LLVMContext &Ctx, StringRef BaseType,
// Choose the dimension of the image--this corresponds to the Dim enum in
// SPIR-V (first integer parameter of OpTypeImage).
if (OpenCLName.starts_with("image2d"))
- IntParams[0] = 1; // 1D
+ IntParams[0] = 1;
else if (OpenCLName.starts_with("image3d"))
- IntParams[0] = 2; // 2D
+ IntParams[0] = 2;
else if (OpenCLName == "image1d_buffer")
IntParams[0] = 5; // Buffer
else
``````````
</details>
https://github.com/llvm/llvm-project/pull/147312
More information about the cfe-commits
mailing list