[clang] [AMDGPU] Add builtin to test for constant memory (PR #209679)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 12:50:38 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h,cl -- clang/test/CodeGenOpenCL/amdgpu-is-constant.cl clang/include/clang/AST/ASTContext.h clang/include/clang/Basic/TargetInfo.h clang/include/clang/Sema/SemaAMDGPU.h clang/lib/AST/ASTContext.cpp clang/lib/Basic/Targets/AMDGPU.h clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp clang/lib/CodeGen/Targets/AMDGPU.cpp clang/lib/Sema/SemaAMDGPU.cpp clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaTemplateInstantiateDecl.cpp clang/test/CodeGen/amdgpu-address-spaces.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
index d9a93d426..2bb06feac 100644
--- a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+++ b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
@@ -123,8 +123,8 @@ static Value *emitPointerInNamedSection(CodeGenFunction &CGF, Value *Ptr,
 
   std::string StartName = getSectionRangeStartSymbol(Section);
   std::string StopName = getSectionRangeStopSymbol(Section);
-  auto *Start = getSectionRangeBoundary(CGF.CGM, StartName,
-                                        SectionAddressSpace, Loc, DiagPrefix);
+  auto *Start = getSectionRangeBoundary(CGF.CGM, StartName, SectionAddressSpace,
+                                        Loc, DiagPrefix);
   auto *Stop = getSectionRangeBoundary(CGF.CGM, StopName, SectionAddressSpace,
                                        Loc, DiagPrefix);
   if (!Start || !Stop)

``````````

</details>


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


More information about the cfe-commits mailing list